Skip to content

Commit

Permalink
Mask -1 in AERONET test
Browse files Browse the repository at this point in the history
With recent AERONET web service change, now was getting some places
(sites 'USC_SEAPRISM', 'USC_SEAPRISM_2')
where old dataset was -1 but new dataset had some values,
giving diffs we don't want to test.
  • Loading branch information
zmoon committed Sep 25, 2023
1 parent 6b037b6 commit 58b1e55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions melodies_monet/tests/test_get_data_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def test_get_aeronet(tmp_path):
# since positions may differ due to NaN-lat/lon dropping or such
ds = xr.open_dataset(tmp_path / fn).squeeze().swap_dims(x="siteid")
ds0 = ds0_aeronet.sel(time=ds.time).squeeze().swap_dims(x="siteid")
# TODO: seems original loading missing value as -1 (on purpose, due to compress routine)
# NOTE: -1 in ds0 indicates missing value, due to compress routine

assert not ds.identical(ds0)
assert ds.time.equals(ds0.time)
# assert (np.abs(ds.aod_551nm - ds0.aod_551nm) < 1e-9).all()
ds0["aod_551nm"] = ds0["aod_551nm"].where(ds0["aod_551nm"] != -1)
assert (np.abs(ds.aod_551nm - ds0.aod_551nm).to_series().dropna() < 1e-9).all()
# - Many more site IDs in ds0 (400 vs 283), and one that is in ds but not ds0
# - In the above, only two sites
Expand Down

0 comments on commit 58b1e55

Please sign in to comment.