Class N3iosp

    • Field Detail

      • MAX_VARSIZE

        public static final long MAX_VARSIZE
        Deprecated.
        Each fixed-size variable and the data for one record's worth of a single record variable are limited to a little less than 4 GiB.
        See Also:
        Constant Field Values
      • MAX_NUMRECS

        public static final int MAX_NUMRECS
        Deprecated.
        The maximum number of records is 2^32-1.
        See Also:
        Constant Field Values
      • readonly

        protected boolean readonly
        Deprecated.
      • header

        protected N3header header
        Deprecated.
      • lastModified

        protected long lastModified
        Deprecated.
      • debug

        protected boolean debug
        Deprecated.
      • debugSize

        protected boolean debugSize
        Deprecated.
      • debugSPIO

        protected boolean debugSPIO
        Deprecated.
      • debugRecord

        protected boolean debugRecord
        Deprecated.
      • debugRead

        protected boolean debugRead
        Deprecated.
      • showHeaderBytes

        protected boolean showHeaderBytes
        Deprecated.
      • useRecordStructure

        protected boolean useRecordStructure
        Deprecated.
      • fill

        protected boolean fill
        Deprecated.
    • Constructor Detail

      • N3iosp

        public N3iosp()
        Deprecated.
    • Method Detail

      • getFillValueDefault

        public static Number getFillValueDefault​(DataType dtype)
        Deprecated.
      • setProperty

        public static void setProperty​(String name,
                                       String value)
        Deprecated.
        Set a static property. Supported static properties:
        • syncExtendOnly = "true" : assume all file changes are syncExtend only.
        Parameters:
        name - property name
        value - property value
      • isValidNetcdfObjectName

        public static boolean isValidNetcdfObjectName​(String name)
        Deprecated.
        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)
        Deprecated.
        Convert a name to a legal netcdf-3 name.
        Parameters:
        name - the name to convert.
        Returns:
        the converted name.
        See Also:
        isValidNetcdfObjectName(String)
      • makeValidNetcdf3ObjectName

        public static String makeValidNetcdf3ObjectName​(String name)
        Deprecated.
        use makeValidNetcdfObjectName
      • isValidNetcdf3ObjectName

        public static boolean isValidNetcdf3ObjectName​(String name)
        Deprecated.
        use isValidNetcdfObjectName
        Determine if the given name can be used for a Dimension, Attribute, or Variable name. Should match makeValidNetcdf3ObjectName.
        Parameters:
        name - test this.
        Returns:
        true if valid name.
      • getValidNetcdf3ObjectNamePattern

        public static com.google.re2j.Pattern getValidNetcdf3ObjectNamePattern()
        Deprecated.
        Valid Netcdf Object name as a regular expression.
        Returns:
        regular expression pattern describing valid Netcdf Object names.
      • createValidNetcdf3ObjectName

        public static String createValidNetcdf3ObjectName​(String name)
        Deprecated.
        use makeValidNetcdfObjectName
        Convert a name to a legal netcdf name. From the user manual: "The names of dimensions, variables and attributes consist of arbitrary sequences of alphanumeric characters (as well as underscore '_' and hyphen '-'), beginning with a letter or underscore. (However names commencing with underscore are reserved for system use.) Case is significant in netCDF names."

        Algorithm:

        1. leading character: if alpha or underscore, ok; if digit, prepend "N"; otherwise discard
        2. other characters: if space, change to underscore; other delete.
        Parameters:
        name - convert this name
        Returns:
        converted name
      • isValidFile

        public boolean isValidFile​(RandomAccessFile raf)
                            throws IOException
        Deprecated.
        Description copied from interface: IOServiceProvider
        Check if this is a valid file for this IOServiceProvider. You must make this method thread safe, ie dont keep any state.
        Specified by:
        isValidFile in interface IOServiceProvider
        Parameters:
        raf - RandomAccessFile
        Returns:
        true if valid.
        Throws:
        IOException - if read error
      • openForWriting

        public void openForWriting​(RandomAccessFile raf,
                                   NetcdfFile ncfile,
                                   CancelTask cancelTask)
                            throws IOException
        Deprecated.
        Description copied from interface: IOServiceProviderWriter
        Open existing file and allow writing. Netcdf-4 writing is general. Netcdf-3 writing is restricted to writing data into existing variables.
        Specified by:
        openForWriting in interface IOServiceProviderWriter
        Parameters:
        raf - the file to work on.
        ncfile - add objects to this empty NetcdfFile
        cancelTask - used to monitor user cancellation; may be null.
        Throws:
        IOException - if I/O error
      • open

        public void open​(RandomAccessFile raf,
                         NetcdfFile ncfile,
                         CancelTask cancelTask)
                  throws IOException
        Deprecated.
        Description copied from interface: IOServiceProvider
        Open existing file, and populate ncfile with it. This method is only called by the NetcdfFile constructor on itself. The provided NetcdfFile object will be empty except for the location String and the IOServiceProvider associated with this NetcdfFile object.
        Specified by:
        open in interface IOServiceProvider
        Overrides:
        open in class AbstractIOServiceProvider
        Parameters:
        raf - the file to work on, it has already passed the isValidFile() test.
        ncfile - add objects to this empty NetcdfFile
        cancelTask - used to monitor user cancellation; may be null.
        Throws:
        IOException - if read error
      • setFill

        public void setFill​(boolean fill)
        Deprecated.
        Description copied from interface: IOServiceProviderWriter
        Set the fill flag. For new files, set in the create() method. This method is to set fill for existing files that you want to write. If true, the data is first written with fill values. Set to false if you expect to write all data values, set to true if you want to be sure that unwritten data values have the fill value in it.
        Specified by:
        setFill in interface IOServiceProviderWriter
        Parameters:
        fill - set fill mode true or false
      • readData

        public Array readData​(Variable v2,
                              Section section)
                       throws IOException,
                              InvalidRangeException
        Deprecated.
        Description copied from interface: IOServiceProvider
        Read data from a top level Variable and return a memory resident Array. This Array has the same element type as the Variable, and the requested shape.
        Specified by:
        readData in interface IOServiceProvider
        Parameters:
        v2 - a top-level Variable
        section - the section of data to read. There must be a Range for each Dimension in the variable, in order. Note: no nulls allowed. IOSP may not modify.
        Returns:
        the requested data in a memory-resident Array
        Throws:
        IOException - if read error
        InvalidRangeException - if invalid section
        See Also:
        Range
      • create

        public void create​(String filename,
                           NetcdfFile ncfile,
                           int extra,
                           long preallocateSize,
                           boolean largeFile)
                    throws IOException
        Deprecated.
        Description copied from interface: IOServiceProviderWriter
        Create new file, populate it from the objects in ncfile.
        Specified by:
        create in interface IOServiceProviderWriter
        Parameters:
        filename - name of file to create.
        ncfile - get everything but data from here
        extra - if > 0, pad header with extra bytes
        preallocateSize - if > 0, set length of file to this upon creation - this (usually) pre-allocates contiguous storage.
        largeFile - if want large file format
        Throws:
        IOException - if I/O error
      • writeData

        public void writeData​(Variable v2,
                              Section section,
                              Array values)
                       throws IOException,
                              InvalidRangeException
        Deprecated.
        Description copied from interface: IOServiceProviderWriter
        Write data into a variable.
        Specified by:
        writeData in interface IOServiceProviderWriter
        Parameters:
        v2 - variable to write; must already exist.
        section - the section of data to write. There must be a Range for each Dimension in the variable, in order. The shape must match the shape of values. The origin and stride indicate where the data is placed into the stored Variable array.
        values - data to write. The shape must match section.getShape().
        Throws:
        IOException - if I/O error
        InvalidRangeException - if invalid section
      • updateAttribute

        public void updateAttribute​(Variable v2,
                                    Attribute att)
                             throws IOException
        Deprecated.
        Update the value of an existing attribute. Attribute is found by name, which must match exactly. You cannot make an attribute longer, or change the number of values. For strings: truncate if longer, zero fill if shorter. Strings are padded to 4 byte boundaries, ok to use padding if it exists. For numerics: must have same number of values.
        Specified by:
        updateAttribute in interface IOServiceProviderWriter
        Parameters:
        v2 - variable, or null for fglobal attribute
        att - replace with this value
        Throws:
        IOException
      • fillNonRecordVariables

        protected void fillNonRecordVariables()
                                       throws IOException
        Deprecated.
        Throws:
        IOException
      • syncExtend

        public boolean syncExtend()
                           throws IOException
        Deprecated.
        Description copied from interface: IOServiceProvider
        Extend the NetcdfFile if the underlying dataset has changed in a way that is compatible with the current metadata. For example, if the unlimited dimension has grown.
        Specified by:
        syncExtend in interface IOServiceProvider
        Overrides:
        syncExtend in class AbstractIOServiceProvider
        Returns:
        true if the NetcdfFile was extended.
        Throws:
        IOException - if a read error occured when accessing the underlying dataset.
      • getFileTypeId

        public String getFileTypeId()
        Deprecated.
        Description copied from interface: IOServiceProvider
        Get a unique id for this file type.
        Specified by:
        getFileTypeId in interface IOServiceProvider
        Returns:
        registered id of the file type
        See Also:
        "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
      • getFileTypeDescription

        public String getFileTypeDescription()
        Deprecated.
        Description copied from interface: IOServiceProvider
        Get a human-readable description for this file type.
        Specified by:
        getFileTypeDescription in interface IOServiceProvider
        Returns:
        description of the file type
        See Also:
        "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
      • readData

        protected abstract Object readData​(Layout index,
                                           DataType dataType)
                                    throws IOException
        Deprecated.
        Read data subset from file for a variable, create primitive array.
        Parameters:
        index - handles skipping around in the file.
        dataType - dataType of the variable
        Returns:
        primitive array with data read in
        Throws:
        IOException - on error
      • writeData

        protected abstract void writeData​(Array aa,
                                          Layout index,
                                          DataType dataType)
                                   throws IOException
        Deprecated.
        Write data subset to file for a variable, create primitive array.
        Parameters:
        aa - write data from this Array.
        index - handles skipping around in the file.
        dataType - dataType of the variable
        Throws:
        IOException - on error
      • _create

        protected abstract void _create​(RandomAccessFile raf)
        Deprecated.