ucar.nc2.iosp.mcidas
Class McIDASGridReader

java.lang.Object
  extended by ucar.nc2.iosp.mcidas.McIDASGridReader

public class McIDASGridReader
extends Object

Read grid(s) from a McIDAS grid file


Field Summary
protected  boolean needToSwap
          swap flag
protected  RandomAccessFile rf
          The file
 
Constructor Summary
McIDASGridReader()
          Bean ctor
McIDASGridReader(RandomAccessFile raf)
          Create a McIDASGrid Reader from the file
McIDASGridReader(String filename)
          Create a McIDASGrid Reader from the file
 
Method Summary
 GridIndex getGridIndex()
          to get the grid header corresponding to the last grid read
protected  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)
 void init(RandomAccessFile raf, boolean fullCheck)
          Initialize the file, read in all the metadata (ala DM_OPEN)
static void main(String[] args)
          for testing purposes
 float[] readGrid(McIDASGridRecord gr)
          Read the grid
 int readInt(int word)
          Read an integer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 void 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
Throws:
IOException - problem reading the data

readGrid

public float[] readGrid(McIDASGridRecord gr)
Read the grid

Parameters:
gr - the grid record
Returns:
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

main

public static void main(String[] args)
                 throws IOException
for testing purposes

Parameters:
args - file name
Throws:
IOException - problem reading file


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.