Package ucar.nc2.grib.grib2.table
Class Grib2Tables
- java.lang.Object
-
- ucar.nc2.grib.grib2.table.Grib2Tables
-
- All Implemented Interfaces:
TimeUnitConverter
,GribTables
- Direct Known Subclasses:
EccodesLocalTables
,FslHrrrLocalTables
,GempakLocalTables
,KmaLocalTables
,MrmsLocalTables
,NdfdLocalTables
,NwsMetDevTables
@Immutable public class Grib2Tables extends Object implements GribTables, TimeUnitConverter
Grib 2 Tables - allows local overrides and augmentation of WMO tables. This class serves the standard WMO tables, local tables are subclasses that override. Methods are placed here because they may be overridden by local Tables. Tables include code, flag and parameter tables.- Since:
- 4/3/11
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ucar.nc2.grib.GribTables
GribTables.Parameter
-
-
Field Summary
Fields Modifier and Type Field Description protected ucar.nc2.grib.grib2.table.Grib2TableConfig
config
-
Constructor Summary
Constructors Modifier Constructor Description protected
Grib2Tables(ucar.nc2.grib.grib2.table.Grib2TableConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
convertTimeUnit(int timeUnit)
Deprecated.Remove in version 6, functionality moved to Grib2CollectionBuilderstatic Grib2Tables
factory(int center, int subCenter, int masterVersion, int localVersion, int genProcessId)
static Grib2Tables
factory(Grib2Record gr)
static com.google.common.collect.ImmutableList<Grib2Tables>
getAllRegisteredTables()
String
getCategory(int discipline, int category)
int
getCenterId()
String
getCodeTableValue(String tableName, int code)
Grib2TablesId
getConfigId()
CalendarDate
getForecastDate(Grib2Record gr)
TimeCoordIntvDateValue
getForecastTimeInterval(Grib2Record gr)
int[]
getForecastTimeIntervalOffset(Grib2Record gr)
If this has a time interval coordinate, get time intervaldouble
getForecastTimeIntervalSizeInHours(Grib2Pds pds)
Get interval size in units of hours.String
getGeneratingProcessName(int genProcess)
String
getGeneratingProcessTypeName(int genProcess)
String
getLevelName(int id)
String
getLevelNameShort(int id)
String
getName()
GribTables.Parameter
getParameter(int discipline, Grib2Pds pds)
GribTables.Parameter
getParameter(GribCollectionImmutable.VariableIndex vindex)
GribTables.Parameter
getParameter(Grib2Record gr)
GribTables.Parameter
getParameterRaw(int discipline, int category, int number)
Get the unprocessed parameter provided by this Grib2Table.com.google.common.collect.ImmutableList<GribTables.Parameter>
getParameters()
Get the list of parameters provided by this Grib2Table.String
getParamTablePathUsedFor(int discipline, int category, int number)
Get the name of the parameter table that is being used for this parameter.String
getPath()
String
getProbabilityNameShort(int id)
String
getStatisticName(int id)
String
getStatisticNameShort(int id)
GribStatType
getStatType(int grib2StatCode)
String
getSubCenterName(int center_id, int subcenter_id)
Grib2TablesId.Type
getType()
String
getVariableName(int discipline, int category, int parameter)
Make a IOSP Variable name, using the Parameter name is available, otherwise a synthesized name.String
getVariableName(Grib2Record gr)
VertCoordType
getVertUnit(int code)
Unit of vertical coordinate.boolean
isLayer(Grib2Pds pds)
boolean
isLevelUsed(int code)
static boolean
isLocal(int code)
static boolean
isLocal(int discipline, int category, int number)
static boolean
isLocal(GribTables.Parameter p)
void
lookForProblems(Formatter f)
static String
makeParamCode(int code)
static String
makeParamCode(int discipline, int category, int number)
static int
makeParamId(int discipline, int category, int number)
void
setTimeUnitConverter(TimeUnitConverter timeUnitConverter)
Deprecated.Remove in version 6, functionality moved to Grib2CollectionBuildervoid
showDetails(Formatter f)
void
showEntryDetails(Formatter f, List<GribTables.Parameter> params)
void
showSpecialPdsInfo(Grib2Record pds, Formatter f)
static int[]
unmakeParamId(int code)
-
-
-
Method Detail
-
factory
public static Grib2Tables factory(Grib2Record gr)
-
factory
public static Grib2Tables factory(int center, int subCenter, int masterVersion, int localVersion, int genProcessId)
-
makeParamId
public static int makeParamId(int discipline, int category, int number)
-
unmakeParamId
public static int[] unmakeParamId(int code)
-
makeParamCode
public static String makeParamCode(int discipline, int category, int number)
-
makeParamCode
public static String makeParamCode(int code)
-
isLocal
public static boolean isLocal(GribTables.Parameter p)
-
isLocal
public static boolean isLocal(int discipline, int category, int number)
-
isLocal
public static boolean isLocal(int code)
-
getAllRegisteredTables
public static com.google.common.collect.ImmutableList<Grib2Tables> getAllRegisteredTables()
-
getName
public String getName()
-
getCenterId
public int getCenterId()
-
getPath
public String getPath()
-
getConfigId
public Grib2TablesId getConfigId()
-
getType
public Grib2TablesId.Type getType()
-
getVariableName
public String getVariableName(Grib2Record gr)
-
getVariableName
public String getVariableName(int discipline, int category, int parameter)
Make a IOSP Variable name, using the Parameter name is available, otherwise a synthesized name.
-
getParameter
@Nullable public GribTables.Parameter getParameter(Grib2Record gr)
-
getParameter
@Nullable public GribTables.Parameter getParameter(GribCollectionImmutable.VariableIndex vindex)
-
getParameter
public GribTables.Parameter getParameter(int discipline, Grib2Pds pds)
-
getSubCenterName
@Nullable public String getSubCenterName(int center_id, int subcenter_id)
- Specified by:
getSubCenterName
in interfaceGribTables
-
getGeneratingProcessName
@Nullable public String getGeneratingProcessName(int genProcess)
- Specified by:
getGeneratingProcessName
in interfaceGribTables
-
getGeneratingProcessTypeName
@Nullable public String getGeneratingProcessTypeName(int genProcess)
- Specified by:
getGeneratingProcessTypeName
in interfaceGribTables
-
getCategory
@Nullable public String getCategory(int discipline, int category)
-
getStatisticName
public String getStatisticName(int id)
-
getStatisticNameShort
public String getStatisticNameShort(int id)
-
getStatType
@Nullable public GribStatType getStatType(int grib2StatCode)
- Specified by:
getStatType
in interfaceGribTables
-
getProbabilityNameShort
public String getProbabilityNameShort(int id)
-
getVertUnit
public VertCoordType getVertUnit(int code)
Unit of vertical coordinate. from Grib2 code table 4.5. Only levels with units get a dimension added- Specified by:
getVertUnit
in interfaceGribTables
- Parameters:
code
- code from table 4.5- Returns:
- level unit, default is empty unit string
-
isLevelUsed
public boolean isLevelUsed(int code)
-
getLevelName
@Nullable public String getLevelName(int id)
-
isLayer
public boolean isLayer(Grib2Pds pds)
-
getLevelNameShort
public String getLevelNameShort(int id)
- Specified by:
getLevelNameShort
in interfaceGribTables
-
setTimeUnitConverter
@Deprecated public void setTimeUnitConverter(TimeUnitConverter timeUnitConverter)
Deprecated.Remove in version 6, functionality moved to Grib2CollectionBuilder
-
convertTimeUnit
@Deprecated public int convertTimeUnit(int timeUnit)
Deprecated.Remove in version 6, functionality moved to Grib2CollectionBuilder- Specified by:
convertTimeUnit
in interfaceTimeUnitConverter
-
getForecastDate
@Nullable public CalendarDate getForecastDate(Grib2Record gr)
-
getForecastTimeInterval
public TimeCoordIntvDateValue getForecastTimeInterval(Grib2Record gr)
-
getForecastTimeIntervalSizeInHours
public double getForecastTimeIntervalSizeInHours(Grib2Pds pds)
Get interval size in units of hours. Only use in GribVariable to decide on variable identity when intvMerge = false.- Parameters:
pds
- must be a Grib2Pds.PdsInterval- Returns:
- interval size in units of hours LOOK generalize this to return a size and unit?
-
getForecastTimeIntervalOffset
@Nullable public int[] getForecastTimeIntervalOffset(Grib2Record gr)
If this has a time interval coordinate, get time interval- Parameters:
gr
- from this record- Returns:
- time interval in units of pds.getTimeUnit(), or null if not a time interval
-
getParameterRaw
@Nullable public GribTables.Parameter getParameterRaw(int discipline, int category, int number)
Get the unprocessed parameter provided by this Grib2Table.
-
getParamTablePathUsedFor
public String getParamTablePathUsedFor(int discipline, int category, int number)
Get the name of the parameter table that is being used for this parameter.
-
getParameters
public com.google.common.collect.ImmutableList<GribTables.Parameter> getParameters()
Get the list of parameters provided by this Grib2Table.
-
lookForProblems
public void lookForProblems(Formatter f)
-
showDetails
public void showDetails(Formatter f)
-
showEntryDetails
public void showEntryDetails(Formatter f, List<GribTables.Parameter> params)
-
showSpecialPdsInfo
public void showSpecialPdsInfo(Grib2Record pds, Formatter f)
-
-