Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop beam dimension #1056

Merged
merged 24 commits into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c589c35
Remove beam dimension previously added during EK60 conversion
emiliom May 26, 2023
09f033e
Handle case in EK calibration where beam dimension is not present
emiliom May 26, 2023
2445370
Merge branch 'dev' into drop_beam_dim
emiliom Jun 5, 2023
39521e6
Merge branch 'dev' into drop_beam_dim
emiliom Jul 14, 2023
3a0d892
Remove beam dimension previously added during AZFP conversion
emiliom Jul 14, 2023
86a833a
Remove handling of beam dimension in AZFP calibration
emiliom Jul 14, 2023
996d939
Update convert and echodata tests to account for elimination of beam …
emiliom Jul 14, 2023
111a3e1
Forgot to undo in previous commit the temporary removal of netcdf4 te…
emiliom Jul 15, 2023
7c6766f
Merge branch 'dev' into drop_beam_dim
emiliom Jul 17, 2023
acca64b
Remove forced addition of beam dim in EK80 when not required. Now use…
emiliom Jul 18, 2023
90a7315
Remove forced handling of beam dim in EK80 calibration when beam is n…
emiliom Jul 18, 2023
acbc8dd
Update convert, echodata and calibration tests to account for selecti…
emiliom Jul 18, 2023
d7cc8e9
Forgot to undo in previous commit the temporary removal of netcdf4 te…
emiliom Jul 18, 2023
4e011ab
fix test_nan_range_entries
leewujung Jul 19, 2023
cbed2ba
fix test mock ata
leewujung Jul 19, 2023
6094ec3
remove added if-else
leewujung Jul 19, 2023
43a9f92
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 19, 2023
2f694ca
remove beam dim handling in calibrate/cal_params.py
leewujung Jul 20, 2023
c53946d
revise comment re one place where the beam dim should be dropped expl…
leewujung Jul 20, 2023
9869507
remove outdated comments re which var has beam dim
leewujung Jul 20, 2023
4cf2c83
remove redundant check for if beam dim exists
leewujung Jul 20, 2023
ffb090c
remove beam dim from test_cal_params.py::beam_AZFP
leewujung Jul 22, 2023
537197b
remove beam dim check cal_params.py::_get_interp_da under the alterna…
leewujung Jul 22, 2023
d85d8c3
Merge branch 'dev' into drop_beam_dim
leewujung Jul 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions echopype/calibrate/calibrate_ek.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ def _cal_power_samples(self, cal_type: str) -> xr.Dataset:
if "time1" in out.coords:
out = out.drop("time1")

# Squeeze out the beam dim
# doing it here because both out and self.cal_params["equivalent_beam_angle"] has beam dim
return out.squeeze("beam", drop=True)
# Squeeze out the beam dim, if present.
# Doing it here because both out and self.cal_params["equivalent_beam_angle"] have` beam dim
if "beam" in out.dims:
return out.squeeze("beam", drop=True)
else:
return out
leewujung marked this conversation as resolved.
Show resolved Hide resolved


class CalibrateEK60(CalibrateEK):
Expand Down
15 changes: 10 additions & 5 deletions echopype/convert/set_groups_ek60.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ class SetGroupsEK60(SetGroupsBase):
# in converting from v0.5.x to v0.6.0. The values within
# these sets are applied to all Sonar/Beam_groupX groups.

# 2023-05-25 note: We have decided to remove the beam dimension from EK60,
# where it was added as a length-1 dimension only to more closely match
# the SONAR-netCDF4 v1 convention. For the time being, we are retaining the
# infrastructure that adds this dimension, but updating the variables lists.

# Variables that need only the beam dimension added to them.
beam_only_names = {"backscatter_r", "angle_athwartship", "angle_alongship"}
beam_only_names = set()

# Variables that need only the ping_time dimension added to them.
ping_time_only_names = {"beam_type"}

# Variables that need beam and ping_time dimensions added to them.
beam_ping_time_names = {
ping_time_only_names = {
"beam_direction_x",
"beam_direction_y",
"beam_direction_z",
Expand All @@ -45,6 +47,9 @@ class SetGroupsEK60(SetGroupsBase):
"gain_correction",
}

# Variables that need beam and ping_time dimensions added to them.
beam_ping_time_names = set()
leewujung marked this conversation as resolved.
Show resolved Hide resolved

beamgroups_possible = [
{
"name": "Beam_group1",
Expand Down