Пример #1
0
def test_read_file(npl_data):
    parsed_surface_metachecker(data=npl_data)

    co2_data = npl_data["CO2"]["data"]
    ch4_data = npl_data["CH4"]["data"]

    assert check_cf_compliance(dataset=co2_data)

    assert co2_data.time[0] == pd.Timestamp("2020-06-12")
    assert co2_data["co2"][0] == pytest.approx(424.1672774)
    assert co2_data.time[-1] == pd.Timestamp("2020-07-01T00:24:00")
    assert co2_data["co2"][-1] == pytest.approx(419.9544809)

    assert ch4_data.time[0] == pd.Timestamp("2020-06-12")
    assert ch4_data["ch4"][0] == pytest.approx(2004.462127)
    assert ch4_data.time[-1] == pd.Timestamp("2020-07-01T00:24:00")
    assert ch4_data["ch4"][-1] == pytest.approx(1910.546256)
Пример #2
0
def test_read_file():
    filepath = get_datapath(filename="THB_hourly_means_test.csv",
                            data_type="Cranfield_CRDS")
    data = parse_cranfield(data_filepath=filepath, sampling_period="1200")

    assert sorted(list(data.keys())) == sorted(["co2", "co", "ch4"])

    ch4_data = data["ch4"]["data"]
    co2_data = data["co2"]["data"]
    co_data = data["co"]["data"]

    assert check_cf_compliance(dataset=co2_data)

    assert ch4_data["ch4"][0] == pytest.approx(2585.6510)
    assert ch4_data["ch4 variability"][0] == pytest.approx(75.502187065)

    assert co_data["co"][0] == pytest.approx(289.697545)
    assert co_data["co variability"][0] == pytest.approx(6.999084)

    assert co2_data["co2"][0] == pytest.approx(460.573223)
    assert co2_data["co2 variability"][0] == pytest.approx(0.226956417)

    parsed_surface_metachecker(data=data)
Пример #3
0
def test_noaa_site_filename_cf_compliance(scsn06_data):
    ch4_data = scsn06_data["ch4"]["data"]

    assert check_cf_compliance(dataset=ch4_data)
Пример #4
0
def test_thd_cf_compliance(thd_data):
    meas_data = thd_data["ch4_10m"]["data"]
    assert check_cf_compliance(dataset=meas_data)
Пример #5
0
def test_crds_cf_compliance(crds_data):
    ch4_data = crds_data["ch4"]["data"]
    assert check_cf_compliance(dataset=ch4_data)
Пример #6
0
def test_btt_cf_compliance(btt_data):
    co2_data = btt_data["CO2"]["data"]
    assert check_cf_compliance(dataset=co2_data)
Пример #7
0
def test_tmb_cf_compliance(tmb_data):
    co_data = tmb_data["CO"]["data"]
    assert check_cf_compliance(dataset=co_data)
Пример #8
0
def test_npl_cf_compliance(npl_data):
    co2_data = npl_data["CO2"]["data"]
    assert check_cf_compliance(dataset=co2_data)