Package ucar.nc2.grib.grib1.tables
Class Grib1ParamTables
- java.lang.Object
-
- ucar.nc2.grib.grib1.tables.Grib1ParamTables
-
@Immutable public class Grib1ParamTables extends Object
This is the interface to manage GRIB-1 Parameter Table lookups. A lookup is a (center, subcenter, version) --> Parameter Table path. The lookups are loaded at startup, but the Parameter Tables arent read until requested, via getParameter(int center, int subcenter, int tableVersion, int param_number). These are the tables that are loaded at runtime, matching center and versions. Allow different table versions in the same file. Allow overriding standard grib1 tables on the dataset level.- Since:
- 9/13/11
-
-
Constructor Summary
Constructors Constructor Description Grib1ParamTables()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddParameterTable(int center, int subcenter, int tableVersion, String tableFilename)Add table to standard tables for a specific center, subcenter and version.static booleanaddParameterTableLookup(String lookupFilename)Add all tables in list to standard tablesstatic Grib1ParamTablesfactory(String paramTablePath, String lookupTablePath)Get a Grib1ParamTables object, optionally specifying a parameter table or lookup table specific to this dataset.static Grib1ParamTablesfactory(org.jdom2.Element paramTableElem)Get a Grib1Tables object, optionally specifiying a parameter table in XML specific to this dataset.static Grib1ParamTableReadergetDefaultWmoTable()Grib1ParametergetParameter(int center, int subcenter, int tableVersion, int param_number)Grib1ParametergetParameter(Grib1Record record)Grib1ParamTableReadergetParameterTable(int center, int subcenter, int tableVersion)Debugging onlystatic List<Grib1ParamTableReader>getStandardParameterTables()static booleanisStrict()static voidsetStrict(boolean strict)Set strict mode.
-
-
-
Method Detail
-
isStrict
public static boolean isStrict()
-
setStrict
public static void setStrict(boolean strict)
Set strict mode.- If strict:
-
Must find a match in the tables. Otherwise, use default
-
Tables cannot override standard WMO parameters. Thus param_no < 128 and version < 128 must use default table
- Parameters:
strict- true for strict mode.
- If strict:
-
getDefaultWmoTable
public static Grib1ParamTableReader getDefaultWmoTable()
-
factory
public static Grib1ParamTables factory(String paramTablePath, String lookupTablePath) throws IOException
Get a Grib1ParamTables object, optionally specifying a parameter table or lookup table specific to this dataset.- Parameters:
paramTablePath- path to a parameter table, in format Grib1ParamTable can read.lookupTablePath- path to a lookup table, in format Lookup.readLookupTable() can read.- Returns:
- Grib1Tables
- Throws:
IOException- on read error
-
factory
public static Grib1ParamTables factory(org.jdom2.Element paramTableElem)
Get a Grib1Tables object, optionally specifiying a parameter table in XML specific to this dataset.- Parameters:
paramTableElem- parameter table in XML- Returns:
- Grib1Tables
-
getParameter
public Grib1Parameter getParameter(Grib1Record record)
-
getParameter
public Grib1Parameter getParameter(int center, int subcenter, int tableVersion, int param_number)
-
getParameterTable
public Grib1ParamTableReader getParameterTable(int center, int subcenter, int tableVersion)
Debugging only
-
getStandardParameterTables
public static List<Grib1ParamTableReader> getStandardParameterTables()
-
addParameterTableLookup
public static boolean addParameterTableLookup(String lookupFilename) throws IOException
Add all tables in list to standard tables- Parameters:
lookupFilename- filename containing list of tables- Returns:
- true if read ok, false if file not found
- Throws:
IOException- if file found but read error
-
addParameterTable
public static void addParameterTable(int center, int subcenter, int tableVersion, String tableFilename)Add table to standard tables for a specific center, subcenter and version.- Parameters:
center- center idsubcenter- subcenter id, or -1 for alltableVersion- table verssion, or -1 for alltableFilename- file to read parameter table from
-
-