|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jgrib.GribFile
public class GribFile
A class that represents a GRIB file. It consists of a number of records which are represented by GribRecord objects. To retrieve a specific record or records, the standard sequence of methods is: getGridsForType getZunitsForTypeGrid getLevelsForTypeGridUnit getDatesForTypeGridLevel get2dRecord or get3dRecord
Constructor Summary | |
---|---|
GribFile(BitInputStream in)
Constructs a GribFile object from a bit input stream |
|
GribFile(java.io.InputStream in)
Constructs a GribFile object from an input stream |
|
GribFile(java.lang.String filename)
Constructs a GribFile object from a file. |
Method Summary | |
---|---|
GribRecord |
get2dRecord(java.lang.String aType,
GribRecordGDS aGDS,
GribPDSLevel aLevel,
java.util.Date aDate)
rdg - added this method to work with refined methods. |
GribRecord[] |
get3dRecord(java.lang.String aType,
GribRecordGDS aGDS,
GribPDSLevel[] levels,
java.util.Date aDate)
rdg - added this method to work with refined methods. |
java.util.Date[] |
getDatesForTypeGridLevel(java.lang.String aType,
GribRecordGDS aGDS,
GribPDSLevel aLevel)
rdg - an override of the method passing a GribPDSLevel, vice a string for a level Get forecast times (sorted) for type and grid |
java.util.Date[] |
getDatesForTypeGridLevel(java.lang.String aType,
GribRecordGDS aGDS,
java.lang.String aLevel)
Deprecated. - use same method name that uses a GribPDSLevel vice a string |
java.lang.String |
getDescriptionForType(java.lang.String aType)
Get description for type name |
GribRecordGDS[] |
getGridForType(java.lang.String aType)
Deprecated. - use getGridsForType - it better reflects the functionality |
GribRecordGDS[] |
getGrids()
Get get grids |
GribRecordGDS[] |
getGridsForType(java.lang.String aType)
Get Grids used for type (variable) |
java.lang.String[] |
getLevelsForTypeGrid(java.lang.String aType,
GribRecordGDS aGDS)
Deprecated. - allows ambiguity - use getLevelsForTypeGridUnit instead |
GribPDSLevel[] |
getLevelsForTypeGridUnit(java.lang.String aType,
GribRecordGDS aGDS,
int aUnit)
rdg - added this method to distinguish between different vertical coordinate units (e.g. hPa vs. meters). |
GribRecordLight[] |
getLightRecords()
Get Light GRIB records |
GribRecord |
getRecord(int i)
Get a specific GRIB record of this GRIB file as GribRecord object. |
GribRecord |
getRecord(java.lang.String aType,
GribRecordGDS aGDS,
java.lang.String aLevel,
java.util.Date aDate)
Get a specified grid record |
int |
getRecordCount()
Get the number of records this GRIB file contains. |
GribRecordLight[] |
getRecordForDescription(java.lang.String aDesc)
Added by Richard Gonzalez 23 Sep 02 Get Records whose description matches (aDesc) |
GribRecordLight[] |
getRecordForType(java.lang.String aType)
Added by Richard Gonzalez 23 Sep 02 Get Records for type (variable) |
java.lang.String[] |
getTypeNames()
Get type names |
static java.lang.String |
getVersion()
Buildin version, so you can get it from within a jar file. |
int[] |
getZunitsForTypeGrid(java.lang.String aType,
GribRecordGDS aGDS)
rdg - added this method to distinguish between vertical coordinate types. |
void |
listParameters(java.io.PrintStream out)
Method added by Richard Gonzalez 23 Sep 02. |
void |
listRecords(java.io.PrintStream out)
Print out overview of GRIB file content. |
java.lang.String |
toString()
Get a string representation of the GRIB file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GribFile(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException, NotSupportedException, NoValidGribException
filename
- name of the GRIB file
java.io.FileNotFoundException
- if file can not be found
java.io.IOException
- if file can not be opened etc.
NotSupportedException
- if file contains features not yet in jgrib
NoValidGribException
- if file is no valid GRIB filepublic GribFile(java.io.InputStream in) throws java.io.IOException, NotSupportedException, NoValidGribException
in
- input stream with GRIB content
java.io.IOException
- if stream can not be opened etc.
NotSupportedException
- if file contains features not yet in jgrib
NoValidGribException
- if stream does not contain a valid GRIB filepublic GribFile(BitInputStream in) throws java.io.IOException, NotSupportedException, NoValidGribException
in
- bit input stream with GRIB content
java.io.IOException
- if stream can not be opened etc.
NotSupportedException
- if file contains features not yet in jgrib
NoValidGribException
- if stream does not contain a valid GRIB fileMethod Detail |
---|
public static java.lang.String getVersion()
public java.lang.String getDescriptionForType(java.lang.String aType)
aType
- type name
public GribRecordLight[] getRecordForDescription(java.lang.String aDesc)
aDesc
- String representing type name
public GribRecordLight[] getRecordForType(java.lang.String aType)
aType
- String representing type name
public GribRecordGDS[] getGridForType(java.lang.String aType)
aType
- type name
public GribRecordGDS[] getGridsForType(java.lang.String aType)
aType
- type name
public int[] getZunitsForTypeGrid(java.lang.String aType, GribRecordGDS aGDS)
aType
- type nameaGDS
- grid
public GribPDSLevel[] getLevelsForTypeGridUnit(java.lang.String aType, GribRecordGDS aGDS, int aUnit)
aType
- type nameaGDS
- gridaUnit
- index of vertical axis units from table 3
public java.lang.String[] getLevelsForTypeGrid(java.lang.String aType, GribRecordGDS aGDS)
aType
- type nameaGDS
- grid
public java.util.Date[] getDatesForTypeGridLevel(java.lang.String aType, GribRecordGDS aGDS, java.lang.String aLevel)
aType
- type nameaGDS
- gridaLevel
-
public java.util.Date[] getDatesForTypeGridLevel(java.lang.String aType, GribRecordGDS aGDS, GribPDSLevel aLevel)
aType
- type nameaGDS
- gridaLevel
-
public GribRecord getRecord(java.lang.String aType, GribRecordGDS aGDS, java.lang.String aLevel, java.util.Date aDate) throws java.io.IOException, NoValidGribException, NotSupportedException
aType
- type nameaGDS
- gridaLevel
- aDate
- forecast date
java.io.IOException
NoValidGribException
NotSupportedException
public GribRecord get2dRecord(java.lang.String aType, GribRecordGDS aGDS, GribPDSLevel aLevel, java.util.Date aDate) throws java.io.IOException, NoValidGribException, NotSupportedException
aType
- parameter type nameaGDS
- gridaLevel
- levelaDate
- forecast date
java.io.IOException
NoValidGribException
NotSupportedException
public GribRecord[] get3dRecord(java.lang.String aType, GribRecordGDS aGDS, GribPDSLevel[] levels, java.util.Date aDate) throws java.io.IOException, NoValidGribException, NotSupportedException
aType
- parameter type nameaGDS
- gridlevels
- levels to be retrieved - should already be sortedaDate
- forecast date
java.io.IOException
NoValidGribException
NotSupportedException
public GribRecord getRecord(int i) throws java.util.NoSuchElementException, java.io.IOException, NoValidGribException, NotSupportedException
i
- number of GRIB record, first record is number 1
java.util.NoSuchElementException
- if record number does not exist
java.io.IOException
- if record can not be opened etc.
NoValidGribException
- if record is no valid GRIB record
NotSupportedException
- if JGrib doesn't yet support the operationpublic java.lang.String[] getTypeNames()
public GribRecordLight[] getLightRecords()
public GribRecordGDS[] getGrids()
public int getRecordCount()
public void listRecords(java.io.PrintStream out) throws java.io.IOException, NoValidGribException, NotSupportedException
out
- print stream the output is written to
java.io.IOException
- if a record can not be opened etc.
NoValidGribException
- if a record is no valid GRIB record
NotSupportedException
- if JGrib doesn't support something yetpublic void listParameters(java.io.PrintStream out)
out
- print stream the output is written topublic java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |