Package ucar.nc2.iosp.mcidas
Class McIDASGridReader
- java.lang.Object
-
- ucar.nc2.iosp.mcidas.McIDASGridReader
-
public class McIDASGridReader extends Object
Read grid(s) from a McIDAS grid file
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
needToSwap
swap flagprotected RandomAccessFile
rf
The file
-
Constructor Summary
Constructors Constructor Description McIDASGridReader()
Bean ctorMcIDASGridReader(String filename)
Create a McIDASGrid Reader from the fileMcIDASGridReader(RandomAccessFile raf)
Create a McIDASGrid Reader from the file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridIndex
getGridIndex()
to get the grid header corresponding to the last grid readprotected boolean
init()
Initialize this reader.protected boolean
init(boolean fullCheck)
Initialize this reader.void
init(RandomAccessFile raf)
Initialize the file, read in all the metadata (ala DM_OPEN)boolean
init(RandomAccessFile raf, boolean fullCheck)
Initialize the file, read in all the metadata (ala DM_OPEN)float[]
readGrid(McIDASGridRecord gr)
Read the gridint
readInt(int word)
Read an integer
-
-
-
Field Detail
-
rf
protected RandomAccessFile rf
The file
-
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 gridsraf
- 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
-
readGrid
public float[] readGrid(McIDASGridRecord gr) throws IOException
Read the grid- Parameters:
gr
- the grid record- Returns:
- the data
- Throws:
IOException
-
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
-
-