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 booleanneedToSwapswap flagprotected ucar.unidata.io.RandomAccessFilerfThe file
-
Constructor Summary
Constructors Constructor Description McIDASGridReader()Bean ctorMcIDASGridReader(String filename)Create a McIDASGrid Reader from the fileMcIDASGridReader(ucar.unidata.io.RandomAccessFile raf)Create a McIDASGrid Reader from the file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridIndexgetGridIndex()to get the grid header corresponding to the last grid readprotected booleaninit()Initialize this reader.protected booleaninit(boolean fullCheck)Initialize this reader.voidinit(ucar.unidata.io.RandomAccessFile raf)Initialize the file, read in all the metadata (ala DM_OPEN)booleaninit(ucar.unidata.io.RandomAccessFile raf, boolean fullCheck)Initialize the file, read in all the metadata (ala DM_OPEN)float[]readGrid(McIDASGridRecord gr)Read the gridintreadInt(int word)Read an integer
-
-
-
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(ucar.unidata.io.RandomAccessFile raf) throws IOExceptionCreate a McIDASGrid Reader from the file- Parameters:
raf- RandomAccessFile- Throws:
IOException- problem reading file
-
-
Method Detail
-
init
public final void init(ucar.unidata.io.RandomAccessFile raf) throws IOExceptionInitialize 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(ucar.unidata.io.RandomAccessFile raf, boolean fullCheck) throws IOExceptionInitialize 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 IOExceptionInitialize this reader. Get the Grid specific info- Returns:
- true if successful
- Throws:
IOException- problem reading the data
-
init
protected boolean init(boolean fullCheck) throws IOExceptionInitialize 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 IOExceptionRead an integer- Parameters:
word- word in file (0 based) to read- Returns:
- int read
- Throws:
IOException- problem reading file
-
-