def get_true_latitude_variables(nc):
    '''
    Returns a list of variables defining true latitude.

    CF Chapter 4 refers to latitude as a coordinate variable that can also be
    used in non-standard coordinate systems like rotated pole and other
    projections. Chapter 5 refers to a concept of true latitude where the
    variabe defines latitude in a standard projection.

    True latitude, for lack of a better definition, is simply latitude where
    the standard_name is latitude or the units are degrees_north.

    :param netCDF4.Dataset nc: An open netCDF dataset
    '''
    lats = get_latitude_variables(nc)
    true_lats = []
    for lat in lats:
        standard_name = getattr(nc.variables[lat], "standard_name", None)
        units = getattr(nc.variables[lat], "units", None)
        if standard_name == 'latitude':
            true_lats.append(lat)
        elif isinstance(units, basestring) and units.lower() in VALID_LAT_UNITS:
            true_lats.append(lat)
    return true_lats
def get_true_latitude_variables ( nc ) : lats = get_latitude_variables ( nc ) true_lats = [ ] for lat in lats : standard_name = getattr ( nc . variables [ lat ] , "standard_name" , None ) units = getattr ( nc . variables [ lat ] , "units" , None ) if standard_name == 'latitude' : true_lats . append ( lat ) elif isinstance ( units , basestring ) and units . lower ( ) in VALID_LAT_UNITS : true_lats . append ( lat ) return true_lats
Returns a list of variables defining true latitude.

    CF Chapter 4 refers to latitude as a coordinate variable that can also be
    used in non-standard coordinate systems like rotated pole and other
    projections. Chapter 5 refers to a concept of true latitude where the
    variabe defines latitude in a standard projection.

    True latitude, for lack of a better definition, is simply latitude where
    the standard_name is latitude or the units are degrees_north.

    :param netCDF4.Dataset nc: An open netCDF dataset