Package ucar.nc2.iosp

Class NetcdfFormatUtils


  • public class NetcdfFormatUtils
    extends Object
    Utilities and Constants specific to the Netcdf file format (Netcdf-3 and Netcdf-4)
    • Constructor Detail

      • NetcdfFormatUtils

        public NetcdfFormatUtils()
    • Method Detail

      • getFillValueDefault

        public static Number getFillValueDefault​(ArrayType dtype)
        The default fill value for Netcdf 3 files.
      • isValidNetcdfObjectName

        public static boolean isValidNetcdfObjectName​(String name)
        Determine if the given name can be used for a NetCDF object, i.e. a Dimension, Attribute, or Variable. The allowed name syntax (in RE form) is:
         ([a-zA-Z0-9_]|{UTF8})([^\x00-\x1F\x7F/]|{UTF8})*
         
        where UTF8 represents a multi-byte UTF-8 encoding. Also, no trailing spaces are permitted in names. We do not allow '/' because HDF5 does not permit slashes in names as slash is used as a group separator. If UTF-8 is supported, then a multi-byte UTF-8 character can occur anywhere within an identifier.
        Parameters:
        name - the name to validate.
        Returns:
        true if the name is valid.
      • makeValidNetcdfObjectName

        public static String makeValidNetcdfObjectName​(String name)
        Convert a name to a legal netcdf-3 name.
        Parameters:
        name - the name to convert.
        Returns:
        the converted name.
        See Also:
        isValidNetcdfObjectName(String)