Class Ghcnm

  • All Implemented Interfaces:
    Comparable<ucar.nc2.iosp.IOServiceProvider>, ucar.nc2.iosp.IOServiceProvider

    public class Ghcnm
    extends ucar.nc2.iosp.AbstractIOServiceProvider
    Nomads GLOBAL HISTORICAL CLIMATOLOGY NETWORK MONTHLY (GHCNM) v3 Beta. Ascii file. Write index into .ncsx using protobug (experimental) IOSP can then recognize the ncsx file, so it can be passed into NetdfFile.open() instead of the ascii file. Otherwise you have to explicitly specify the iosp, eg:

    The index has list of stations and offsets into station file and data file. since the data file has one station's data grouped together, this efficiently answers "get all data for station". One could sort datafile by time, and add time index, to answer "get all data for time range".

     Protobuf generation:
     cd c:/dev/tds4.2/thredds/cdm/src/main/java
     protoc --proto_path=. --java_out=. ucar/nc2/iosp/noaa/GhcnmIndex.proto
     
    LOOK probable file leaks
    Since:
    Dec 8, 2010
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface ucar.nc2.iosp.IOServiceProvider

        ucar.nc2.iosp.IOServiceProvider.SortGroup
    • Field Summary

      • Fields inherited from class ucar.nc2.iosp.AbstractIOServiceProvider

        location, raf, rafOrder
    • Constructor Summary

      Constructors 
      Constructor Description
      Ghcnm()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      String getFileTypeDescription()
      Get a human-readable description for this file type.
      String getFileTypeId()
      Get a unique stnId for this file type.
      ucar.ma2.StructureDataIterator getStructureIterator​(ucar.nc2.Structure s, int bufferSize)
      Get the structure iterator
      boolean isValidFile​(ucar.unidata.io.RandomAccessFile raf)  
      void open​(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask)  
      ucar.ma2.Array readData​(ucar.nc2.Variable v2, ucar.ma2.Section section)
      Returns an ArraySequence, no subsetting is allowed.
      • Methods inherited from class ucar.nc2.iosp.AbstractIOServiceProvider

        build, buildFinish, getDetailInfo, getFileTypeVersion, getLastModified, isBuilder, reacquire, readSection, readToByteChannel, readToOutputStream, release, sendIospMessage, setNetcdfFile, streamToByteChannel, syncExtend, toStringDebug
      • Methods inherited from interface ucar.nc2.iosp.IOServiceProvider

        compareTo, getSortGroup
    • Constructor Detail

      • Ghcnm

        public Ghcnm()
    • Method Detail

      • isValidFile

        public boolean isValidFile​(ucar.unidata.io.RandomAccessFile raf)
                            throws IOException
        Throws:
        IOException
      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface ucar.nc2.iosp.IOServiceProvider
        Overrides:
        close in class ucar.nc2.iosp.AbstractIOServiceProvider
        Throws:
        IOException
      • open

        public void open​(ucar.unidata.io.RandomAccessFile raf,
                         ucar.nc2.NetcdfFile ncfile,
                         ucar.nc2.util.CancelTask cancelTask)
                  throws IOException
        Specified by:
        open in interface ucar.nc2.iosp.IOServiceProvider
        Overrides:
        open in class ucar.nc2.iosp.AbstractIOServiceProvider
        Throws:
        IOException
      • getFileTypeId

        public String getFileTypeId()
        Get a unique stnId for this file type.
        Returns:
        registered stnId of the file type
        See Also:
        "https://www.unidata.ucar.edu/software/netcdf-java/formats/FileTypes.html"
      • getFileTypeDescription

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

        public ucar.ma2.Array readData​(ucar.nc2.Variable v2,
                                       ucar.ma2.Section section)
                                throws IOException
        Returns an ArraySequence, no subsetting is allowed.
        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:
        ArraySequence
        Throws:
        IOException
      • getStructureIterator

        public ucar.ma2.StructureDataIterator getStructureIterator​(ucar.nc2.Structure s,
                                                                   int bufferSize)
                                                            throws IOException
        Get the structure iterator
        Specified by:
        getStructureIterator in interface ucar.nc2.iosp.IOServiceProvider
        Overrides:
        getStructureIterator in class ucar.nc2.iosp.AbstractIOServiceProvider
        Parameters:
        s - the Structure
        bufferSize - the buffersize
        Returns:
        the data iterator
        Throws:
        IOException - if problem reading data