Package ucar.nc2.grib
Class GribUtils
- java.lang.Object
-
- ucar.nc2.grib.GribUtils
-
public class GribUtils extends Object
General Utilities used by GRIB code.- Since:
- 11/16/11
-
-
Field Summary
Fields Modifier and Type Field Description static String
CENTER
static String
GEN_PROCESS
static String
SUBCENTER
static String
TABLE_VERSION
-
Constructor Summary
Constructors Constructor Description GribUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
cleanupDescription(String desc)
static String
cleanupUnits(String unit)
static CalendarPeriod
getCalendarPeriod(int timeUnit)
Convert a time unit to a CalendarPeriod GRIB1 and GRIB2 are the same (!)static CalendarDate
getValidTime(CalendarDate refDate, int timeUnit, int offset)
static String
makeNameFromDescription(String desc)
static boolean
scanModeSameDirection(int scanMode)
All rows scan in the same/opposite direction.static boolean
scanModeXisConsecutive(int scanMode)
Adjacent points in x/y direction are consecutive.static boolean
scanModeXisPositive(int scanMode)
X Points scan in +/- direction.static boolean
scanModeYisPositive(int scanMode)
Y Points scan in +/- direction.
-
-
-
Field Detail
-
CENTER
public static final String CENTER
- See Also:
- Constant Field Values
-
SUBCENTER
public static final String SUBCENTER
- See Also:
- Constant Field Values
-
GEN_PROCESS
public static final String GEN_PROCESS
- See Also:
- Constant Field Values
-
TABLE_VERSION
public static final String TABLE_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCalendarPeriod
public static CalendarPeriod getCalendarPeriod(int timeUnit)
Convert a time unit to a CalendarPeriod GRIB1 and GRIB2 are the same (!)- Parameters:
timeUnit
- (GRIB1 table 4) (GRIB2 Code table 4.4 : Indicator of unit of time range)- Returns:
- equivalent CalendarPeriod
-
getValidTime
public static CalendarDate getValidTime(CalendarDate refDate, int timeUnit, int offset)
-
scanModeXisPositive
public static boolean scanModeXisPositive(int scanMode)
X Points scan in +/- direction. Grib 1 or 2. Positive means west to east along a parallel, or left to right along an X-axis..- Parameters:
scanMode
- scanMode byte- Returns:
- true: x points scan in positive direction, false: x points scan in negetive direction
-
scanModeYisPositive
public static boolean scanModeYisPositive(int scanMode)
Y Points scan in +/- direction. Grib 1 or 2. Positive means south to north along a meridian, or bottom to top along a Y-axis.- Parameters:
scanMode
- scanMode byte- Returns:
- true: y points scan in positive direction, false: y points scan in negetive direction
-
scanModeXisConsecutive
public static boolean scanModeXisConsecutive(int scanMode)
Adjacent points in x/y direction are consecutive. Grib 1 or 2.- Parameters:
scanMode
- scanMode byte- Returns:
- true: x points are consecutive (row) false: y points are consecutive (col)
-
scanModeSameDirection
public static boolean scanModeSameDirection(int scanMode)
All rows scan in the same/opposite direction. Grib 2 only.- Parameters:
scanMode
- scanMode byte- Returns:
- true: All rows scan in the same direction, false: Adjacent rows scan in the opposite direction, the first row scan is as defined by previous flags
-
-