Skip to content

Commit

Permalink
Fixed interpolation to work with dask chuncked arrays and added haver…
Browse files Browse the repository at this point in the history
…sine to the conda env file (#126)
  • Loading branch information
mihaiboldeanu committed Nov 8, 2023
1 parent 86ec9a9 commit 6e6b869
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- more-itertools==8.13.0
- pydantic>2
- echopype
- haversine
- black
- bottleneck
- check-manifest
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
- more-itertools==8.13.0
- pydantic>2
- echopype
- haversine
- pip
- git
- pip:
Expand Down
2 changes: 1 addition & 1 deletion oceanstream/L2_calibrated_data/sv_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def interpolate_sv(
dataset = read_processed(path_to_file)

# Retrieve the Sv DataArray from the dataset
sv_dataarray = dataset["Sv"]
sv_dataarray = dataset["Sv"].chunk({"ping_time": -1})

# Initialize an empty list to store the processed channels
processed_channels = []
Expand Down
4 changes: 2 additions & 2 deletions tests/test_nasc_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def test_compute_per_dataset_nasc(ek_60_Sv_full_denoised):
def test_compute_masked_nasc(ek_60_Sv_shoal):
dataset = ek_60_Sv_shoal
fish_nasc = mask_nasc_data(dataset, {"mask_shoal": False}, True, "fish_NASC")
assert fish_nasc['fish_NASC_38000.0'] == 148692889.40505505
assert fish_nasc['fish_NASC_38000.0'] == pytest.approx(131203167, 0.0001)


def test_compute_full_nasc(ek_60_Sv_shoal):
dataset = ek_60_Sv_shoal
nasc = full_nasc_data(dataset, BASE_NASC_PARAMETERS)
assert len(nasc) == 24
assert nasc['fish_NASC_38000.0'] == 148692889.40505505
assert nasc['fish_NASC_38000.0'] == pytest.approx(131203167, 0.0001)

0 comments on commit 6e6b869

Please sign in to comment.