Skip to content

Commit

Permalink
Fix test values (#150)
Browse files Browse the repository at this point in the history
* Fix test values

* Made sure nasc values aren't dask arrays
  • Loading branch information
ruxandra-valcu authored Dec 6, 2023
1 parent df9496c commit b9b4bc6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions oceanstream/L2_calibrated_data/noise_masks.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
},
},
"false_seabed": {
"method": "blackwell_mod",
"method": "blackwell",
"params": {
"theta": None,
"phi": None,
Expand All @@ -127,10 +127,6 @@
"tphi": 282,
"wtheta": 28,
"wphi": 52,
"rlog": None,
"tpi": None,
"freq": None,
"rank": 50,
},
},
}
Expand Down
3 changes: 3 additions & 0 deletions oceanstream/L3_regridded_data/nasc_computation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import Dict, Union

import dask.array as da
import echopype as ep
import numpy as np
import xarray as xr
Expand Down Expand Up @@ -51,6 +52,8 @@ def compute_per_dataset_nasc(Sv_ds: xr.Dataset) -> Dict[str, Union[xr.Dataset, s

# Compute NASC using the determined max depth and max distance - one bin per channel
nasc_ep = ep.commongrid.api.compute_NASC(Sv_ds, range_bin=max_depth_str, dist_bin=max_dist_str)
if isinstance(nasc_ep["NASC"], da.Array):
nasc_ep["NASC"] = nasc_ep["NASC"].compute()

return {
"NASC_dataset": nasc_ep,
Expand Down
8 changes: 3 additions & 5 deletions tests/test_noise_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@
"roff": 0,
"thr": -40,
"ec": 1,
"ek": (1, 3),
"dc": 10,
"dk": (3, 7),
"ek": (3, 3),
"dc": 3,
"dk": (3, 3),
},
},
"false_seabed": {
"method": "blackwell",
"params": {
"theta": None,
"phi": None,
"r0": 10,
"r1": 1000,
"tSv": -75,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sv_dataset_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ def test_add_seabed_depth(ed_ek_60_for_Sv):
res = add_seabed_depth(Sv_mask)
res_sl = res["seabed_level"]
assert res_sl.shape == (3, 1932)
assert res_sl[0, 0] == 464
assert res_sl[0, 0].item() == 445

0 comments on commit b9b4bc6

Please sign in to comment.