Returns true if the dataset's variable is likely a geophysical variable

def is_geophysical(ds, variable):
    '''
    Returns true if the dataset's variable is likely a geophysical variable
    '''
    ncvar = ds.variables[variable]
    # Does it have a standard name and units?
    standard_name = getattr(ncvar, 'standard_name', '')
    if not standard_name:
        return False
    if standard_name and standard_name not in get_unitless_standard_names():
        units = getattr(ncvar, 'units', '')
        if units == '':
            return False
    if not hasattr(ncvar, 'standard_name') or not hasattr(ncvar, 'units'):
        return False
    if getattr(ncvar, 'standard_name') in ('time', 'latitude', 'longitude', 'height', 'depth', 'altitude'):
        return False
    # Is it dimensionless?
    if len(ncvar.shape) == 0:
        return False
    # Is it a QC Flag?
    if 'status_flag' in ncvar.standard_name:
        return False

    if getattr(ncvar, 'cf_role', None):
        return False

    if getattr(ncvar, 'axis', None):
        return False

    return True