Class GempakStationFileIOSP

    • Field Detail

      • parseInfo

        protected StringBuilder parseInfo
        place to store debug stuff
      • RMISS

        protected static final Number RMISS
        Float missing attribute
      • IMISS

        protected static final Number IMISS
        Integer missing attribute
      • DIM_LEN8

        protected static final Dimension DIM_LEN8
        static for shared dimension of length 4
      • DIM_LEN4

        protected static final Dimension DIM_LEN4
        static for shared dimension of length 4
      • DIM_LEN2

        protected static final Dimension DIM_LEN2
        static for shared dimension of length 2
    • Constructor Detail

      • GempakStationFileIOSP

        public GempakStationFileIOSP()
    • Method Detail

      • isValidFile

        public boolean isValidFile​(RandomAccessFile raf)
                            throws IOException
        Is this a valid file?
        Parameters:
        raf - RandomAccessFile to check
        Returns:
        true if a valid Gempak grid file
        Throws:
        IOException - problem reading file
      • makeStationReader

        protected abstract AbstractGempakStationFileReader makeStationReader()
        Make the appropriate station file reader, subclasses need to implement this
        Returns:
        the appropriate reader for that subclass
      • buildNCFile

        protected void buildNCFile()
                            throws IOException
        Build the netCDF file
        Throws:
        IOException - problem reading the file
      • fillNCFile

        protected abstract void fillNCFile()
                                    throws IOException
        Fill the contents of the netCDF file. Assumes that the file has been cleared.
        Throws:
        IOException - problem reading the file
      • makeStructure

        protected Structure makeStructure​(String partName,
                                          List<Dimension> dimensions,
                                          boolean includeMissing)
        Make a structure for the part
        Parameters:
        partName - partname
        dimensions - dimensions for the structure
        includeMissing - true to include the missing variable
        Returns:
        a Structure
      • makeMissingVariable

        protected Variable makeMissingVariable()
        Make the missing variable
        Returns:
        the missing variable
      • makeParamVariable

        protected Variable makeParamVariable​(GempakParameter param,
                                             List<Dimension> dims)
        Make a variable from a GempakParmaeter
        Parameters:
        param - GempakParameter
        dims - Variable dimensions
        Returns:
        the Variable
      • addGlobalAttributes

        protected void addGlobalAttributes()
        Add on global attributes for all types
      • getConventions

        public String getConventions()
        Get the netCDF conventions identifier.
        Returns:
        the convention name
      • getCFFeatureType

        public String getCFFeatureType()
        Get the CF feature type, subclasses should override
        Returns:
        the feature type
      • getStnVarSize

        protected int getStnVarSize​(String name)
        Get the size of a particular station variable
        Parameters:
        name - name of the variable (key)
        Returns:
        size or -1
      • makeStationVars

        protected List<Variable> makeStationVars​(List<GempakStation> stations,
                                                 Dimension dim)
        Make the station variables from a representative station
        Parameters:
        stations - list of stations
        dim - station dimension
        Returns:
        the list of variables
      • makeStationVariable

        protected Variable makeStationVariable​(String varname,
                                               Dimension firstDim)
        Make a station variable
        Parameters:
        varname - variable name
        firstDim - station dimension
        Returns:
        corresponding variable