Beispiel #1
0
def test_smoke_execute_c3s_cmip6_subset_metadata(wps, tmp_path):
    inputs = [
        ("collection", C3S_CMIP6_MON_TASMIN_COLLECTION),
        ("time", "2010-01-01/2010-12-31"),
    ]
    urls = wps.execute("subset", inputs)
    assert len(urls) == 1
    assert (
        "tasmin_Amon_MPI-ESM1-2-HR_historical_r1i1p1f1_gn_20100116-20101216.nc"
        in urls[0])
    ds = open_dataset(urls[0], tmp_path)
    assert "tasmin" in ds.variables
    # check fill value in bounds
    assert "_FillValue" not in ds.lat_bnds.encoding
    assert "_FillValue" not in ds.lon_bnds.encoding
    assert "_FillValue" not in ds.time_bnds.encoding
    # check fill value in coordinates
    assert "_FillValue" not in ds.time.encoding
    assert "_FillValue" not in ds.lat.encoding
    assert "_FillValue" not in ds.lon.encoding
    assert "_FillValue" not in ds.height.encoding
    # check coordinates in bounds
    assert "coordinates" not in ds.lat_bnds.encoding
    assert "coordinates" not in ds.lon_bnds.encoding
    assert "coordinates" not in ds.time_bnds.encoding
Beispiel #2
0
def test_smoke_execute_c3s_cmip5_subset(wps, tmp_path):
    inputs = [
        ("collection", C3S_CMIP5_DAY_COLLECTION),
        ("time", "2005-01-01/2005-12-31"),
    ]
    urls = wps.execute("subset", inputs)
    assert len(urls) == 1
    assert "tas_day_EC-EARTH_historical_r1i1p1_20050101-20051231.nc" in urls[0]
    ds = open_dataset(urls[0], tmp_path)
    assert "tas" in ds.variables
Beispiel #3
0
def test_smoke_execute_c3s_cmip6_subset(wps, tmp_path):
    inputs = [
        ("collection", C3S_CMIP6_MON_COLLECTION),
        ("time", "2020-01-01/2020-12-30"),
    ]
    urls = wps.execute("subset", inputs)
    assert len(urls) == 1
    assert "rlds_Amon_INM-CM5-0_ssp245_r1i1p1f1_gr1_20200116-20201216.nc" in urls[
        0]
    ds = open_dataset(urls[0], tmp_path)
    assert "rlds" in ds.variables
Beispiel #4
0
def test_smoke_execute_c3s_cordex_subset(wps, tmp_path):
    inputs = [
        ("collection", C3S_CORDEX_MON_COLLECTION),
        ("time", "2020-01-01/2020-12-30"),
    ]
    urls = wps.execute("subset", inputs)
    assert len(urls) == 1
    assert (
        "tas_EUR-11_MOHC-HadGEM2-ES_rcp85_r1i1p1_CLMcom-CCLM4-8-17_v1_mon_20200116-20201216.nc"
        in urls[0])
    ds = open_dataset(urls[0], tmp_path)
    assert "tas" in ds.variables
Beispiel #5
0
def test_smoke_execute_c3s_cmip6_orchestrate_metadata(wps, tmp_path):
    inputs = [
        ("workflow", ComplexDataInput(WF_C3S_CMIP6)),
    ]
    urls = wps.execute("orchestrate", inputs)
    assert len(urls) == 1
    assert "rlds_Amon_INM-CM5-0_ssp245_r1i1p1f1_gr1_avg-t.nc" in urls[0]
    ds = open_dataset(urls[0], tmp_path)
    assert "rlds" in ds.variables
    # check fill value in bounds
    assert "_FillValue" not in ds.lat_bnds.encoding
    assert "_FillValue" not in ds.lon_bnds.encoding
    # assert "_FillValue" not in ds.time_bnds.encoding
    # check fill value in coordinates
    # assert "_FillValue" not in ds.time.encoding
    assert "_FillValue" not in ds.lat.encoding
    assert "_FillValue" not in ds.lon.encoding
    # assert "_FillValue" not in ds.height.encoding
    # check coordinates in bounds
    assert "coordinates" not in ds.lat_bnds.encoding
    assert "coordinates" not in ds.lon_bnds.encoding