Exemple #1
0
def get_hdf4_file_variables(filename, data_type=None):
    """
    Get all variables from a file containing ungridded data.
    Concatenate variable from both VD and SD data

    :param filename: The filename of the file to get the variables from
    :param data_type: String representing the HDF data type, i.e. 'VD' or 'SD'. if None, both are computed.
    """

    SD_vars = VD_vars = None

    if data_type is None or data_type.lower() == "sd":
        SD_vars = hdf_sd.get_hdf_SD_file_variables(filename)
    elif data_type is None or data_type.lower() == "vd":
        VD_vars = hdf_vd.get_hdf_VD_file_variables(filename)
    else:
        raise ValueError("Invalid data-type: %s, HDF variables must be VD or SD only" % data_type)

    return SD_vars, VD_vars
Exemple #2
0
def get_hdf4_file_variables(filename, data_type=None):
    """
    Get all variables from a file containing ungridded data.
    Concatenate variable from both VD and SD data

    :param filename: The filename of the file to get the variables from
    :param data_type: String representing the HDF data type, i.e. 'VD' or 'SD'. if None, both are computed.
    """

    SD_vars = VD_vars = None

    if data_type is None or data_type.lower() == "sd":
        SD_vars = hdf_sd.get_hdf_SD_file_variables(filename)
    elif data_type is None or data_type.lower() == "vd":
        VD_vars = hdf_vd.get_hdf_VD_file_variables(filename)
    else:
        raise ValueError(
            "Invalid data-type: %s, HDF variables must be VD or SD only" %
            data_type)

    return SD_vars, VD_vars
Exemple #3
0
def test_that_can_read_all_variables():
    dict = hdf_vd.get_hdf_VD_file_variables(valid_hdf_vd_file)
    eq_(len(dict), 37)
    eq_(True, 'Longitude' in dict)
Exemple #4
0
def test_that_can_read_all_variables():
    dict = hdf_vd.get_hdf_VD_file_variables(escape_colons(valid_hdf_vd_file))
    eq_(len(dict), 37)
    eq_(True, 'Longitude' in dict)