Class GridVariable


  • public class GridVariable
    extends Object
    A Variable for a Grid dataset.
    • Field Detail

      • vname

        public String vname
        variable name
      • firstRecord

        protected GridRecord firstRecord
        first grid record
      • nlevels

        protected int nlevels
        number of levels
      • ntimes

        protected int ntimes
        number of times
      • recordTracker

        protected GridRecord[] recordTracker
        record tracker
    • Constructor Detail

      • GridVariable

        protected GridVariable​(String filename,
                               String name,
                               GridHorizCoordSys hcs,
                               GridTableLookup lookup)
        Create a new GridVariable
        Parameters:
        name - name with level
        hcs - horizontal coordinate system
        lookup - lookup table
    • Method Detail

      • getNEnsembles

        public int getNEnsembles()
        Get the number of Ensemble
        Returns:
        the number of Ensemble
      • isEnsemble

        protected boolean isEnsemble()
      • getVertIndex

        protected int getVertIndex​(GridRecord p)
        Get the index in the vertical for the particular grid
        Parameters:
        p - grid to check
        Returns:
        the index
      • trackRecords

        protected boolean trackRecords​(int time,
                                       int level,
                                       GridRecord p,
                                       RandomAccessFile raf,
                                       boolean messSent)
      • showRecord

        public void showRecord​(int recnum,
                               Formatter f)
      • showMissing

        public void showMissing​(Formatter f)
        Dump out the missing data
        Parameters:
        f - write to this
      • showMissingSummary

        public int showMissingSummary​(Formatter f)
        Dump out the missing data as a summary
        Parameters:
        f - write to this
        Returns:
        number of missing levels
      • findRecord

        public GridRecord findRecord​(int ens,
                                     int time,
                                     int level)
        Find the grid record for the time and level indices Canonical ordering is ens, time, level
        Parameters:
        ens - ensemble index
        time - time index
        level - level index
        Returns:
        the record or null
      • equals

        public boolean equals​(Object oo)
        Check for equality
        Overrides:
        equals in class Object
        Parameters:
        oo - object in question
        Returns:
        true if they are equal
      • getName

        public String getName()
        Get the name
        Returns:
        the name
      • hashCode

        public int hashCode()
        Override Object.hashCode() to implement equals.
        Overrides:
        hashCode in class Object
        Returns:
        equals;
      • dump

        public String dump()
        Dump this variable
        Returns:
        the variable
      • makeLongName

        protected String makeLongName()
        Make a long name for the variable
        Returns:
        long variable name
      • makeLevelName

        public String makeLevelName​(GridRecord gr,
                                    GridTableLookup lookup)
        Make the level name
        Parameters:
        gr - grid record
        lookup - lookup table
        Returns:
        name for the level
      • makeIntervalName

        public String makeIntervalName()