Package ucar.nc2.iosp.zarr
Class ZarrUtils
- java.lang.Object
-
- ucar.nc2.iosp.zarr.ZarrUtils
-
public class ZarrUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ZarrUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getDataFileName(String filePath)
Get name of an file within a Zarr object, i.e.static String
getObjectNameFromPath(String filePath)
Get the name of the current Zarr object (variable or group) Defined as the name of the current directorystatic String
getParentGroupNameFromPath(String filePath, String rootPath)
Get the name of the parent Group of an object Defined as the name of the directory two level upstatic int
subscriptsToIndex(int[] subs, int[] nChunks)
Converts subscripted chunk number to a flat indexstatic String
trimLocation(String location)
Remove characters outside logical filepath, e.g.
-
-
-
Method Detail
-
subscriptsToIndex
public static int subscriptsToIndex(int[] subs, int[] nChunks)
Converts subscripted chunk number to a flat index- Parameters:
subs
- - chunk index in each dimensionnChunks
- number of chunks per dimension- Returns:
- chunk number as a flat index
-
getDataFileName
public static String getDataFileName(String filePath)
Get name of an file within a Zarr object, i.e. name of file e.g. 0.0.0 or, in the case of a nested store, 0/0/0- Parameters:
filePath
-- Returns:
- data path relative to Zarr object
-
getObjectNameFromPath
public static String getObjectNameFromPath(String filePath)
Get the name of the current Zarr object (variable or group) Defined as the name of the current directory- Parameters:
filePath
-- Returns:
- name of directory containing filepath as a String or empty String if unresolved
-
getParentGroupNameFromPath
public static String getParentGroupNameFromPath(String filePath, String rootPath)
Get the name of the parent Group of an object Defined as the name of the directory two level up- Parameters:
filePath
-- Returns:
- name of the grandparent directory of filepath as a String
-
-