Class ZarrUtils


  • public class ZarrUtils
    extends Object
    • Constructor Detail

      • ZarrUtils

        public ZarrUtils()
    • 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 dimension
        nChunks - 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
      • trimLocation

        public static String trimLocation​(String location)
        Remove characters outside logical filepath, e.g. S3 tags
        Parameters:
        location -
        Returns:
        logical filepath