cdm/src/main/java/ucar/nc2/iosp/grads/GradsUtil.java
public static double[] getGaussianLatitudes(String type, int start,
            int num)
            throws IllegalArgumentException {
        double[] baseArray = null;
        start--;  // it's one based
        if (type.equalsIgnoreCase(GAUST62)) {
            baseArray = gltst62;
        } else if (type.equalsIgnoreCase(GAUSR15)) {
            baseArray = glts15;
        } else if (type.equalsIgnoreCase(GAUSR20)) {
            baseArray = glts20;
        } else if (type.equalsIgnoreCase(GAUSR30)) {
            baseArray = glts30;
        } else if (type.equalsIgnoreCase(GAUSR40)) {
            baseArray = glats;
        } else {
            throw new IllegalArgumentException("Unsupported type: " + type);
        }
        if (start + num > baseArray.length) {
            throw new IllegalArgumentException("Maximum " + baseArray.length
                    + " latitudes exceeded");
        }
        double[] retVals = new double[num];
        for (int i = 0; i < num; i++) {
            retVals[i] = baseArray[start + i];
        }
        return retVals;
    }
public static double[] getGaussianLatitudes(String type, int start,
            int num)
            throws IllegalArgumentException {
        double[] baseArray = null;
        start--;  // it's one based
        if (type.equalsIgnoreCase(GAUST62)) {
            baseArray = gltst62;
        } else if (type.equalsIgnoreCase(GAUSR15)) {
            baseArray = glts15;
        } else if (type.equalsIgnoreCase(GAUSR20)) {
            baseArray = glts20;
        } else if (type.equalsIgnoreCase(GAUSR30)) {
            baseArray = glts30;
        } else if (type.equalsIgnoreCase(GAUSR40)) {
            baseArray = glats;
        } else {
            throw new IllegalArgumentException("Unsupported type: " + type);
        }
        if (start + num > baseArray.length) {
            throw new IllegalArgumentException("Maximum " + baseArray.length
                    + " latitudes exceeded");
        }
        double[] retVals = new double[num];
        for (int i = 0; i < num; i++) {
            retVals[i] = baseArray[start + i];
        }
        return retVals;
    }
public static double [ ] getGaussianLatitudes ( String type , int start , int num ) throws IllegalArgumentException { double [ ] baseArray = null ; start -- ; // it's one based if ( type . equalsIgnoreCase ( GAUST62 ) ) { baseArray = gltst62 ; } else if ( type . equalsIgnoreCase ( GAUSR15 ) ) { baseArray = glts15 ; } else if ( type . equalsIgnoreCase ( GAUSR20 ) ) { baseArray = glts20 ; } else if ( type . equalsIgnoreCase ( GAUSR30 ) ) { baseArray = glts30 ; } else if ( type . equalsIgnoreCase ( GAUSR40 ) ) { baseArray = glats ; } else { throw new IllegalArgumentException ( "Unsupported type: " + type ) ; } if ( start + num > baseArray . length ) { throw new IllegalArgumentException ( "Maximum " + baseArray . length + " latitudes exceeded" ) ; } double [ ] retVals = new double [ num ] ; for ( int i = 0 ; i < num ; i ++ ) { retVals [ i ] = baseArray [ start + i ] ; } return retVals ; }
Get the latitude values for the given type.

@param type gaussian type
@param start  starting index (1 based)
@param num  number of values

@return the values

@throws IllegalArgumentException  invalid or unsupported type
Get the latitude values for the given type .