Class McIDASGridReader


  • public class McIDASGridReader
    extends Object
    Read grid(s) from a McIDAS grid file
    • Field Detail

      • needToSwap

        protected boolean needToSwap
        swap flag
    • Constructor Detail

      • McIDASGridReader

        public McIDASGridReader()
        Bean ctor
      • McIDASGridReader

        public McIDASGridReader​(String filename)
                         throws IOException
        Create a McIDASGrid Reader from the file
        Parameters:
        filename - filename
        Throws:
        IOException - problem reading file
      • McIDASGridReader

        public McIDASGridReader​(RandomAccessFile raf)
                         throws IOException
        Create a McIDASGrid Reader from the file
        Parameters:
        raf - RandomAccessFile
        Throws:
        IOException - problem reading file
    • Method Detail

      • init

        public final void init​(RandomAccessFile raf)
                        throws IOException
        Initialize the file, read in all the metadata (ala DM_OPEN)
        Parameters:
        raf - RandomAccessFile to read.
        Throws:
        IOException - problem reading file
      • init

        public final boolean init​(RandomAccessFile raf,
                                  boolean fullCheck)
                           throws IOException
        Initialize the file, read in all the metadata (ala DM_OPEN)
        Parameters:
        fullCheck - for a full check reading grids
        raf - RandomAccessFile to read.
        Throws:
        IOException - problem reading file
      • init

        protected boolean init()
                        throws IOException
        Initialize this reader. Get the Grid specific info
        Returns:
        true if successful
        Throws:
        IOException - problem reading the data
      • init

        protected boolean init​(boolean fullCheck)
                        throws IOException
        Initialize this reader. Get the Grid specific info
        Parameters:
        fullCheck - for a full check reading grids
        Returns:
        true if successful, false if not a mcidas grid file
        Throws:
        IOException - problem reading the data
      • getGridIndex

        public GridIndex getGridIndex()
        to get the grid header corresponding to the last grid read
        Returns:
        McIDASGridDirectory of the last grid read
      • readInt

        public int readInt​(int word)
                    throws IOException
        Read an integer
        Parameters:
        word - word in file (0 based) to read
        Returns:
        int read
        Throws:
        IOException - problem reading file