Class GempakUtil


  • public final class GempakUtil
    extends Object
    Class for static GEMPAK utility methods
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String[] vertCoords
      day of month string
    • Constructor Summary

      Constructors 
      Constructor Description
      GempakUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean ERMISS​(float value)
      Test for missing value
      static String getDataType​(int typrt)
      Get a name for the data packing type
      static String getGridPackingName​(int pktyp)
      Get a name for the grid packing type
      static boolean LEAP​(int iyr)
      Check for leap year
      static String LV_CCRD​(int ivcord)
      This subroutine translates a numeric value for IVCORD into its character value in VCOORD.
      static String ST_INCH​(int value)
      Convert a value to a string
      static String ST_ITOC​(int value)
      Convert the int bits to a string
      static String ST_ITOC​(int[] values)
      Convert the int bits to a string
      static int swp4​(int value)
      Swap the order of the integer.
      static int[] swp4​(int[] values, int startIndex, int number)
      Swap the order of the integers in place.
      static String[] TG_CFTM​(int ifcast)
      This subroutine converts an integer grid forecast time into the character forecast type and time.
      static int[] TG_FTOI​(int[] iftime, int start)
      This subroutine converts the two integers stored in a grid file into three integers containing the date, time and forecast time.
      static String TG_ITOC​(int[] intdtf)
      This subroutine converts an integer time array containing the date, time and forecast time into a GEMPAK grid time.
      static String TI_CDTM​(int idate, int itime)
      This subroutine converts an integer date (YYMMDD) and time (HHMM)
      static int TI_DAYM​(int iyear, int imon)
      This subroutine returns the number of days in the given month.
      static String TI_ITOC​(int[] idtarr)
      This subroutine converts an integer time array into a standard GEMPAK time.
    • Field Detail

      • vertCoords

        public static String[] vertCoords
        day of month string
    • Constructor Detail

      • GempakUtil

        public GempakUtil()
    • Method Detail

      • TG_FTOI

        public static int[] TG_FTOI​(int[] iftime,
                                    int start)
        This subroutine converts the two integers stored in a grid file into three integers containing the date, time and forecast time.
        Parameters:
        iftime - input time array
        start - offset into the array
        Returns:
        int[3] with date time and forecast time
      • TG_ITOC

        public static String TG_ITOC​(int[] intdtf)
        This subroutine converts an integer time array containing the date, time and forecast time into a GEMPAK grid time.
        Parameters:
        intdtf - integer array of date, time and forecast time
        Returns:
        formatted string
      • TG_CFTM

        public static String[] TG_CFTM​(int ifcast)
        This subroutine converts an integer grid forecast time into the character forecast type and time. The forecast type is A (analysis), F (forecast), G (guess) or I (initialize). If the forecast time is less than 100 and the minutes are 00, only hh is returned.
        Parameters:
        ifcast - integer forecast time
        Returns:
        type and time.
      • TI_CDTM

        public static String TI_CDTM​(int idate,
                                     int itime)
        This subroutine converts an integer date (YYMMDD) and time (HHMM)
        Parameters:
        idate - integer date
        itime - integer time
        Returns:
        string date/time
      • TI_ITOC

        public static String TI_ITOC​(int[] idtarr)
        This subroutine converts an integer time array into a standard GEMPAK time. The integers are checked for validity.
        Parameters:
        idtarr - Time array (YYYY,MM,DD,HH,MM)
        Returns:
        time as a string
      • TI_DAYM

        public static int TI_DAYM​(int iyear,
                                  int imon)
        This subroutine returns the number of days in the given month. The year must be a full four-digit year.
        Parameters:
        iyear - integer year
        imon - integer month
        Returns:
        number of days
      • LEAP

        public static boolean LEAP​(int iyr)
        Check for leap year
        Parameters:
        iyr - year to check
        Returns:
        true if leap year
      • ST_INCH

        public static String ST_INCH​(int value)
        Convert a value to a string
        Parameters:
        value - value to convert
        Returns:
        string representation
      • ST_ITOC

        public static String ST_ITOC​(int value)
        Convert the int bits to a string
        Parameters:
        value - value to convert
        Returns:
        string representation
      • ST_ITOC

        public static String ST_ITOC​(int[] values)
        Convert the int bits to a string
        Parameters:
        values - array of values to convert
        Returns:
        string representation
      • ERMISS

        public static boolean ERMISS​(float value)
        Test for missing value
        Parameters:
        value - value to check
        Returns:
        true if missing
      • LV_CCRD

        public static String LV_CCRD​(int ivcord)
        This subroutine translates a numeric value for IVCORD into its character value in VCOORD.
        Parameters:
        ivcord - integer coordinate value
        Returns:
        string coordinate name
      • swp4

        public static int swp4​(int value)
        Swap the order of the integer.
        Parameters:
        value - array of int values
        Returns:
        swapped value
      • swp4

        public static int[] swp4​(int[] values,
                                 int startIndex,
                                 int number)
        Swap the order of the integers in place.
        Parameters:
        values - array of int values
        startIndex - starting index of the array
        number - of bytes
        Returns:
        input array with values swapped
      • getGridPackingName

        public static String getGridPackingName​(int pktyp)
        Get a name for the grid packing type
        Parameters:
        pktyp - packing type
        Returns:
        String version of packing type
      • getDataType

        public static String getDataType​(int typrt)
        Get a name for the data packing type
        Parameters:
        typrt - data type
        Returns:
        String version of data type