Skip to content

Commit

Permalink
Add test file
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Apr 23, 2024
1 parent 8306c81 commit 27ed3ae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Binary file added tests/data/pandora-uvvis-no2-boulder-20231206.h5
Binary file not shown.
20 changes: 20 additions & 0 deletions tests/test_geoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
TEST_FP = (HERE / "data/tolnet-hdf4-test-data.hdf").absolute().as_posix()
TEST_FP_H4TONCCF = (HERE / "data/tolnet-hdf4-test-data_h4tonccf_nc4.nc").absolute().as_posix()

# https://data.pandonia-global-network.org/BoulderCO-NCAR/Pandora204s1/L2_geoms/groundbased_uvvis.doas.directsun.no2_ncar204_rd.rnvs3.1.8_boulder.ncar.co_20231206t145123z_20231206t230013z_001.h5
TEST_FP_PANDORA_NO2_TOTCOL = (
(HERE / "data/pandora-uvvis-no2-boulder-20231206.h5").absolute().as_posix()
)


def test_open():
ds = geoms.open_dataset(TEST_FP)
Expand Down Expand Up @@ -55,3 +60,18 @@ def test_cmp_h4tonccf():
ds_h4tonccf = xr.open_dataset(TEST_FP_H4TONCCF)
# Note: h4tonccf_nc4 replaces all `.` in var names to `_`
assert sorted(ds.sizes.values()) == sorted(ds_h4tonccf.squeeze().sizes.values())


def test_pandora_totcol():
with pytest.warns(match="more than 100 ms"):
ds = geoms.open_dataset(TEST_FP_PANDORA_NO2_TOTCOL)

assert set(ds.dims) == {"time"}
assert set(ds.coords) == {"time"}
assert ds.sizes["time"] > 1

assert "no2_column_absorption_solar" in ds.data_vars

assert "altitude" not in ds
assert "latitude" not in ds
assert "latitude_instrument" in ds

0 comments on commit 27ed3ae

Please sign in to comment.