Package ucar.nc2.grib

Class GribUtils


  • public class GribUtils
    extends Object
    General Utilities used by GRIB code.
    Since:
    11/16/11
    • Constructor Detail

      • GribUtils

        public GribUtils()
    • 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
      • cleanupUnits

        public static String cleanupUnits​(String unit)
      • cleanupDescription

        public static String cleanupDescription​(String desc)
      • makeNameFromDescription

        public static String makeNameFromDescription​(String desc)
      • 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