ucar.grib.grib1
Class GribPDSParamTable

java.lang.Object
  extended by ucar.grib.grib1.GribPDSParamTable

public final class GribPDSParamTable
extends java.lang.Object

A class containing static methods which deliver descriptions and names of parameters, levels and units for byte codes from GRIB records.

Performs operations related to loading parameter tables stored in files. Through a lookup table (see readParameterTableLookup) all of the supported Parameter Tables are known. An actual table is not loaded until a parameter from that center/subcenter/table is loaded. see Parameters.txt

For now, the lookup table name is hard coded to "resources/grib/tables/tablelookup.lst"

Author:
Capt Richard D. Gonzalez modified by Robb Kambic threadsafe 9/25/08 jcaron see http://www.ibm.com/developerworks/java/library/j-hashmap.html

Method Summary
static void addParameterUserLookup(java.io.InputStream is)
          Reads in the list of tables available and stores them.
static void addParameterUserLookup(java.lang.String userGribTabList)
          Reads in the list of tables available and stores them.
 GridParameter getParameter(int id)
          Get the parameter with id id.
static GribPDSParamTable getParameterTable(int center, int subcenter, int number)
          Looks for the parameter table which matches the center, subcenter and table version from the tables array.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addParameterUserLookup

public static void addParameterUserLookup(java.io.InputStream is)
                                   throws java.io.IOException
Reads in the list of tables available and stores them. Does not actually open the parameter tables files, nor store the list of parameters, but just stores the file names of the parameter tables. Parameters for a table are read in when the table is requested (in the getParameterTable method).

Parameters:
is - UserGribTabList as a InputStream
Throws:
java.io.IOException - or read error

addParameterUserLookup

public static void addParameterUserLookup(java.lang.String userGribTabList)
                                   throws java.io.IOException
Reads in the list of tables available and stores them. Does not actually open the parameter tables files, nor store the list of parameters, but just stores the file names of the parameter tables. Parameters for a table are read in when the table is requested (in the getParameterTable method).

Parameters:
userGribTabList - string of userlookup file
Throws:
java.io.IOException - on read error

getParameterTable

public static GribPDSParamTable getParameterTable(int center,
                                                  int subcenter,
                                                  int number)
                                           throws NotSupportedException
Looks for the parameter table which matches the center, subcenter and table version from the tables array. If this is the first time asking for this table, then the parameters for this table have not been read in yet, so this is done as well.

Parameters:
center - - integer from PDS octet 5, representing Center.
subcenter - - integer from PDS octet 26, representing Subcenter
number - - integer from PDS octet 4, representing Parameter Table Version
Returns:
GribPDSParamTable matching center, subcenter, and number
Throws:
NotSupportedException - no table found

getParameter

public GridParameter getParameter(int id)
Get the parameter with id id.

Parameters:
id - the parameter id
Returns:
the GridParameter

main

public static void main(java.lang.String[] args)