ucar.grib.grib1
Class GribPDSParamTable

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

public final class GribPDSParamTable
extends 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(InputStream is)
          Reads in the list of tables available and stores them.
static boolean addParameterUserLookup(String userGribTabList)
          Reads in the list of tables available and stores them.
 int getCenter_id()
           
 String getFilename()
           
 GridParameter getParameter(int id)
          Get the parameter with id id.
 Map<String,GridParameter> getParameters()
           
static GribPDSParamTable getParameterTable(int center, int subcenter, int tableVersion)
          Looks for the parameter table which matches the center, subcenter and table version from the tables array.
static GribPDSParamTable[] getParameterTables()
           
 String getPath()
           
 int getSubcenter_id()
           
 int getTable_number()
           
static void main(String[] args)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getParameterTables

public static GribPDSParamTable[] getParameterTables()

addParameterUserLookup

public static void addParameterUserLookup(InputStream is)
                                   throws 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:
IOException - or read error

addParameterUserLookup

public static boolean addParameterUserLookup(String userGribTabList)
                                      throws 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
Returns:
true if read ok, false if file not found
Throws:
IOException - if file found but read error

getParameterTable

public static GribPDSParamTable getParameterTable(int center,
                                                  int subcenter,
                                                  int tableVersion)
                                           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
tableVersion - - integer from PDS octet 4, representing Parameter Table Version
Returns:
GribPDSParamTable matching center, subcenter, and number
Throws:
NotSupportedException - no table found

getCenter_id

public int getCenter_id()

getSubcenter_id

public int getSubcenter_id()

getTable_number

public int getTable_number()

getPath

public String getPath()

getFilename

public String getFilename()

getParameters

public Map<String,GridParameter> getParameters()

getParameter

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

Parameters:
id - the parameter id
Returns:
the GridParameter

toString

public String toString()
Overrides:
toString in class Object

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


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