Package ucar.nc2.grib.grib2.table
Class Grib2Tables
- java.lang.Object
-
- ucar.nc2.grib.grib2.table.Grib2Tables
-
- All Implemented Interfaces:
thredds.featurecollection.TimeUnitConverter,GribTables
- Direct Known Subclasses:
EccodesLocalTables,FslHrrrLocalTables,GempakLocalTables,KmaLocalTables,MrmsLocalTables,NdfdLocalTables,NwsMetDevTables
@Immutable public class Grib2Tables extends Object implements GribTables, thredds.featurecollection.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.Grib2TableConfigconfig
-
Constructor Summary
Constructors Modifier Constructor Description protectedGrib2Tables(ucar.nc2.grib.grib2.table.Grib2TableConfig config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intconvertTimeUnit(int timeUnit)Deprecated.Remove in version 6, functionality moved to Grib2CollectionBuilderstatic Grib2Tablesfactory(int center, int subCenter, int masterVersion, int localVersion, int genProcessId)static Grib2Tablesfactory(Grib2Record gr)static com.google.common.collect.ImmutableList<Grib2Tables>getAllRegisteredTables()StringgetCategory(int discipline, int category)intgetCenterId()StringgetCodeTableValue(String tableName, int code)Grib2TablesIdgetConfigId()ucar.nc2.time.CalendarDategetForecastDate(Grib2Record gr)TimeCoordIntvDateValuegetForecastTimeInterval(Grib2Record gr)int[]getForecastTimeIntervalOffset(Grib2Record gr)If this has a time interval coordinate, get time intervaldoublegetForecastTimeIntervalSizeInHours(Grib2Pds pds)Get interval size in units of hours.StringgetGeneratingProcessName(int genProcess)StringgetGeneratingProcessTypeName(int genProcess)StringgetLevelName(int id)StringgetLevelNameShort(int id)StringgetName()GribTables.ParametergetParameter(int discipline, Grib2Pds pds)GribTables.ParametergetParameter(GribCollectionImmutable.VariableIndex vindex)GribTables.ParametergetParameter(Grib2Record gr)GribTables.ParametergetParameterRaw(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.StringgetParamTablePathUsedFor(int discipline, int category, int number)Get the name of the parameter table that is being used for this parameter.StringgetPath()StringgetProbabilityNameShort(int id)StringgetStatisticName(int id)StringgetStatisticNameShort(int id)GribStatTypegetStatType(int grib2StatCode)StringgetSubCenterName(int center_id, int subcenter_id)Grib2TablesId.TypegetType()StringgetVariableName(int discipline, int category, int parameter)Make a IOSP Variable name, using the Parameter name is available, otherwise a synthesized name.StringgetVariableName(Grib2Record gr)VertCoordTypegetVertUnit(int code)Unit of vertical coordinate.booleanisLayer(Grib2Pds pds)booleanisLevelUsed(int code)static booleanisLocal(int code)static booleanisLocal(int discipline, int category, int number)static booleanisLocal(GribTables.Parameter p)voidlookForProblems(Formatter f)static StringmakeParamCode(int code)static StringmakeParamCode(int discipline, int category, int number)static intmakeParamId(int discipline, int category, int number)voidsetTimeUnitConverter(thredds.featurecollection.TimeUnitConverter timeUnitConverter)Deprecated.Remove in version 6, functionality moved to Grib2CollectionBuildervoidshowDetails(Formatter f)voidshowEntryDetails(Formatter f, List<GribTables.Parameter> params)voidshowSpecialPdsInfo(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:
getSubCenterNamein interfaceGribTables
-
getGeneratingProcessName
@Nullable public String getGeneratingProcessName(int genProcess)
- Specified by:
getGeneratingProcessNamein interfaceGribTables
-
getGeneratingProcessTypeName
@Nullable public String getGeneratingProcessTypeName(int genProcess)
- Specified by:
getGeneratingProcessTypeNamein 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:
getStatTypein 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:
getVertUnitin 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:
getLevelNameShortin interfaceGribTables
-
setTimeUnitConverter
@Deprecated public void setTimeUnitConverter(thredds.featurecollection.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:
convertTimeUnitin interfacethredds.featurecollection.TimeUnitConverter
-
getForecastDate
@Nullable public ucar.nc2.time.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)
-
-