Package ucar.nc2.iosp.gempak
Class GempakGridReader
- java.lang.Object
-
- ucar.nc2.iosp.gempak.GempakFileReader
-
- ucar.nc2.iosp.gempak.GempakGridReader
-
- All Implemented Interfaces:
GempakConstants
public class GempakGridReader extends GempakFileReader
Read a GEMPAK grid file
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ucar.nc2.iosp.gempak.GempakFileReader
GempakFileReader.DMFileHeaderInfo, GempakFileReader.DMHeaders, GempakFileReader.DMKeys, GempakFileReader.DMParam, GempakFileReader.DMPart, GempakFileReader.Key, GempakFileReader.PackingInfo, GempakFileReader.RData
-
-
Field Summary
Fields Modifier and Type Field Description static StringANLBGrid analysis block identifierstatic StringGRIDGrid identifierstatic StringNAVBGrid nav block identifierbooleanuseDPflag for using DP_UGRB or not-
Fields inherited from class ucar.nc2.iosp.gempak.GempakFileReader
dmLabel, fileHeaderInfo, fileSize, headers, keys, MTMACH, mvmst, needToSwap, parts, rf
-
Fields inherited from interface ucar.nc2.iosp.gempak.GempakConstants
COL, IMISSD, LLGDHD, LLNANL, LLNNAV, LLSTHL, MBLKSZ, MDCHAR, MDGDEC, MDGDIF, MDGGRB, MDGNMC, MDGNON, MDGRB2, MDGRID, MDINTG, MDREAL, MDRPCK, MFGD, MFSF, MFSN, MTALPH, MTAPOL, MTHP, MTIBM, MTIGPH, MTIRIS, MTLNUX, MTSUN, MTULTX, MTVAX, RDIFFD, RMISSD, ROW
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float[]DM_RPKG(int isword, int nword, int decimalScale)Unpack a packed gridGempakGridRecordfindGrid(String parm)Find the first grid with this nameintgetGridCount()Get the grid countGridIndexgetGridIndex()Get the grid indexList<GridRecord>getGridList()Get list of gridsintgetGridPackingType(int gridNumber)Get the grid packing typestatic GempakGridReadergetInstance(ucar.unidata.io.RandomAccessFile raf, boolean fullCheck)Initialize the file, read in all the metadata (ala DM_OPEN)protected booleaninit(boolean fullCheck)Initialize this reader.voidprintAnalBlock()Print out the analysis block so it looks something like this:voidprintGrids()Print out the grids.voidprintNavBlock()Print out the navigation block so it looks something like this:float[]readGrid(GridRecord gr)Read the datavoidshowGridInfo(boolean printGrids)List out the grid information (aka GDINFO)-
Methods inherited from class ucar.nc2.iosp.gempak.GempakFileReader
DM_RDTR, DM_RDTR, DM_RFLT, DM_RFLT, DM_RFLT, DM_RINT, DM_RINT, DM_RINT, DM_RSTR, DM_RSTR, DM_UNPK, findFileHeader, findKey, getBits, getByteOrder, getByteOrder, getDataPointer, getErrorMessage, getFile, getFileHeader, getFilename, getInitFileSize, getOffset, getPart, getPartNumber, init, init, logError, printFileLabel, printHeaders, printKeys, printParts, readFileHeaderInfo, readHeaders, readKeys, readParts
-
-
-
-
Field Detail
-
GRID
public static final String GRID
Grid identifier- See Also:
- Constant Field Values
-
ANLB
public static final String ANLB
Grid analysis block identifier- See Also:
- Constant Field Values
-
NAVB
public static final String NAVB
Grid nav block identifier- See Also:
- Constant Field Values
-
useDP
public boolean useDP
flag for using DP_UGRB or not
-
-
Method Detail
-
getInstance
public static GempakGridReader getInstance(ucar.unidata.io.RandomAccessFile raf, boolean fullCheck) throws IOException
Initialize the file, read in all the metadata (ala DM_OPEN)- Parameters:
raf- RandomAccessFile to read.fullCheck- if true, check entire structure- Returns:
- A GempakGridReader
- Throws:
IOException- problem reading file
-
init
protected boolean init(boolean fullCheck) throws IOExceptionInitialize this reader. Get the Grid specific info- Overrides:
initin classGempakFileReader- Parameters:
fullCheck- check to make sure there are grids we can handle- Returns:
- true if successful
- Throws:
IOException- problem reading the data
-
getGridIndex
public GridIndex getGridIndex()
Get the grid index- Returns:
- the GridIndex
-
getGridCount
public int getGridCount()
Get the grid count- Returns:
- the count
-
getGridPackingType
public int getGridPackingType(int gridNumber) throws IOExceptionGet the grid packing type- Parameters:
gridNumber- grid number- Returns:
- packing type or error number
- Throws:
IOException- problem reading file
-
findGrid
public GempakGridRecord findGrid(String parm)
Find the first grid with this name- Parameters:
parm- name of grid- Returns:
- the grid header or null
-
readGrid
public float[] readGrid(GridRecord gr) throws IOException
Read the data- Parameters:
gr- grid record- Returns:
- the data array
- Throws:
IOException- problem reading file
-
DM_RPKG
public float[] DM_RPKG(int isword, int nword, int decimalScale) throws IOExceptionUnpack a packed grid- Overrides:
DM_RPKGin classGempakFileReader- Parameters:
isword- starting word (1 based)nword- number of words to readdecimalScale- decimal scale- Returns:
- array of unpacked data or null;
- Throws:
IOException- problem reading data
-
printNavBlock
public void printNavBlock()
Print out the navigation block so it looks something like this:GRID NAVIGATION: PROJECTION: LCC ANGLES: 25.0 -95.0 25.0 GRID SIZE: 93 65 LL CORNER: 12.19 -133.46 UR CORNER: 57.29 -49.38
-
printAnalBlock
public void printAnalBlock()
Print out the analysis block so it looks something like this:
-
getGridList
public List<GridRecord> getGridList()
Get list of grids- Returns:
- list of grids
-
printGrids
public void printGrids()
Print out the grids.
-
showGridInfo
public void showGridInfo(boolean printGrids)
List out the grid information (aka GDINFO)- Parameters:
printGrids- print each grid record
-
-