예제 #1
0
def test_read_using_list_of_variables():
    for nc_file in NETCDF_FILES:
        meta = load_netcdf_meta(nc_file)
        ds = load_netcdf_array(nc_file, meta, variables_list)
        _validate_array_test_result(ds)
        variables_list2 = [BandSpec('', '', v) for v in variables_list]
        ds = load_netcdf_array(nc_file, meta, variables_list2)
        _validate_array_test_result(ds)
예제 #2
0
def _load_meta(filename, ftype, **kwargs):

    if ftype == 'netcdf':
        return load_netcdf_meta(filename)
    elif ftype == 'hdf5':
        return load_hdf5_meta(filename)
    elif ftype == 'hdf4':
        return load_hdf4_meta(filename)
    elif ftype == 'tif':
        return load_dir_of_tifs_meta(filename, **kwargs)
    elif ftype == 'hdf':
        try:
            return load_hdf4_meta(filename, **kwargs)
        except Exception as e:
            logger.info('NOTE: guessed HDF4 type. Failed: {}. \nTrying HDF5'.format(repr(e)))
            return load_hdf5_meta(filename, **kwargs)
예제 #3
0
def test_read_using_dict_of_variables():
    for nc_file in NETCDF_FILES:
        meta = load_netcdf_meta(nc_file)
        ds = load_netcdf_array(nc_file, meta, variables_dict)
        _validate_array_test_result(ds)
예제 #4
0
def test_read_meta():
    for nc_file in NETCDF_FILES:
        meta = load_netcdf_meta(nc_file)
        assertions_on_metadata(meta)