Skip to content

Commit

Permalink
Fix NASC (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
simedroniraluca committed Nov 9, 2023
1 parent d8c5dac commit 5a5b795
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions oceanstream/L3_regridded_data/nasc_computation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Dict, Union

import echopype as ep
import numpy as np
import xarray as xr


Expand Down Expand Up @@ -39,13 +40,13 @@ def compute_per_dataset_nasc(Sv_ds: xr.Dataset) -> Dict[str, Union[xr.Dataset, s

# Get the maximum distance from the Sv dataset
dist = ep.commongrid.utils.get_distance_from_latlon(Sv_ds)
# max_dist = np.nanmax(dist)
max_dist = dist.max()
max_dist = np.nanmax(dist)
# max_dist = dist.max()
max_dist_str = str(max_dist) + "nmi"

# Get the maximum depth from the Sv dataset
# max_depth = np.nanmax(Sv_ds["depth"].values)
max_depth = Sv_ds.depth.values.max()
max_depth = np.nanmax(Sv_ds["depth"].values)
# max_depth = Sv_ds.depth.values.max()
max_depth_str = str(max_depth) + "m"

# Compute NASC using the determined max depth and max distance - one bin per channel
Expand Down

0 comments on commit 5a5b795

Please sign in to comment.