def test_io_import_mch_gif_metadata(variable, expected, tolerance): """Test the importer MCH GIF.""" root_path = pysteps.rcparams.data_sources["mch"]["root_path"] filename = os.path.join(root_path, "20170131", "AQC170310945F_00005.801.gif") _, _, metadata = pysteps.io.import_mch_gif(filename, "AQC", "mm", 5.0) smart_assert(metadata[variable], expected, tolerance)
def test_io_import_bom_rf3_geodata(variable, expected, tolerance): """Test the importer Bom RF3.""" root_path = pysteps.rcparams.data_sources["bom"]["root_path"] rel_path = os.path.join("prcp-cscn", "2", "2018", "06", "16") filename = os.path.join(root_path, rel_path, "2_20180616_100000.prcp-cscn.nc") geodata = pysteps.io.importers._import_bom_rf3_geodata(filename) smart_assert(geodata[variable], expected, tolerance)
def test_io_import_saf_crri_geodata(variable, expected, tolerance): """Test the importer SAF CRRI.""" root_path = pysteps.rcparams.data_sources["saf"]["root_path"] rel_path = "20180601/CRR" filename = os.path.join(root_path, rel_path, "S_NWC_CRR_MSG4_Europe-VISIR_20180601T070000Z.nc") geodata = pysteps.io.importers._import_saf_crri_geodata(filename) smart_assert(geodata[variable], expected, tolerance)
def test_io_import_opera_hdf5_metadata(variable, expected, tolerance): """Test the importer OPERA HDF5.""" root_path = pysteps.rcparams.data_sources["opera"]["root_path"] filename = os.path.join(root_path, "20180824", "T_PAAH21_C_EUOC_20180824180000.hdf") _, _, metadata = pysteps.io.import_opera_hdf5(filename) print(metadata) # assert metadata[variable] == expected smart_assert(metadata[variable], expected, tolerance)
def test_io_import_knmi_hdf5_metadata(variable, expected, tolerance): """Test the importer KNMI HDF5.""" root_path = pysteps.rcparams.data_sources["knmi"]["root_path"] filename = os.path.join(root_path, "2010/08", "RAD_NL25_RAP_5min_201008260000.h5") __, __, metadata = pysteps.io.import_knmi_hdf5(filename) smart_assert(metadata[variable], expected, tolerance)
def test_io_import_fmi_pgm_geodata(variable, expected, tolerance): """Test the importer FMI pgm.""" root_path = pysteps.rcparams.data_sources["fmi"]["root_path"] filename = os.path.join( root_path, "20160928", "201609281600_fmi.radar.composite.lowest_FIN_SUOMI1.pgm.gz") metadata = pysteps.io.importers._import_fmi_pgm_metadata(filename, gzipped=True) geodata = pysteps.io.importers._import_fmi_pgm_geodata(metadata) smart_assert(geodata[variable], expected, tolerance)
def test_io_import_saf_crri_extent(extent, expected_extent, expected_shape, tolerance): """Test the importer SAF CRRI.""" root_path = pysteps.rcparams.data_sources["saf"]["root_path"] rel_path = "20180601/CRR" filename = os.path.join(root_path, rel_path, "S_NWC_CRR_MSG4_Europe-VISIR_20180601T070000Z.nc") precip, _, metadata = pysteps.io.import_saf_crri(filename, extent=extent) extent_out = (metadata["x1"], metadata["x2"], metadata["y1"], metadata["y2"]) smart_assert(extent_out, expected_extent, tolerance) smart_assert(precip.shape, expected_shape, tolerance)
def test_io_import_knmi_hdf5_metadata(variable, expected, tolerance): """Test the importer KNMI HDF5.""" smart_assert(metadata[variable], expected, tolerance)
def test_filter_uniform(variable, expected, tolerance): _filter = filter_uniform((8, 8), 1) smart_assert(_filter[variable], expected, tolerance)
def test_io_import_mch_gif_dataset_attrs(variable, expected, tolerance): """Test the importer FMI PMG.""" smart_assert(metadata[variable], expected, tolerance)
def test_io_import_mch_geodata(variable, expected, tolerance): """Test the importer MCH geodata.""" geodata = pysteps.io.importers._import_mch_geodata() smart_assert(geodata[variable], expected, tolerance)
def test_io_import_saf_crri_attrs(variable, expected, tolerance): """Test the importer SAF CRRI.""" smart_assert(metadata[variable], expected, tolerance)