From f6de81fbd61f5fb6b0625a413433148fdeec9bab Mon Sep 17 00:00:00 2001 From: Emilio Mayorga Date: Sun, 30 Jul 2023 12:45:05 -0700 Subject: [PATCH 1/3] AZFP: add mandatory beam_type and transmit_type --- echopype/convert/set_groups_azfp.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/echopype/convert/set_groups_azfp.py b/echopype/convert/set_groups_azfp.py index 76da16019..3ae19ce91 100644 --- a/echopype/convert/set_groups_azfp.py +++ b/echopype/convert/set_groups_azfp.py @@ -340,6 +340,19 @@ def set_beam(self) -> List[xr.Dataset]: "standard_name": "sound_frequency", }, ), + # TODO: Add channel dim, to match ek60 and ek80? + "beam_type": ( + [], + 0, + { + "long_name": "Beam type", + "flag_values": [0, 1], + "flag_meanings": [ + "Single beam", + "Split aperture beam", + ], + }, + ), "backscatter_r": ( ["channel", "ping_time", "range_sample"], N, @@ -382,6 +395,17 @@ def set_beam(self) -> List[xr.Dataset]: "valid_min": 0.0, }, ), + "transmit_type": ( + [], + "CW", + { + "long_name": "Type of transmitted pulse", + "flag_values": ["CW"], + "flag_meanings": [ + "Continuous Wave", + ], + }, + ), }, coords={ "channel": ( From fcc071b5ae1c4ea3a9beb4740ab4a0528acc98ef Mon Sep 17 00:00:00 2001 From: Emilio Mayorga Date: Mon, 31 Jul 2023 09:36:00 -0700 Subject: [PATCH 2/3] AZFP, add channel dimension to beam_type for consistency with EK60 & EK80 --- echopype/convert/set_groups_azfp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/echopype/convert/set_groups_azfp.py b/echopype/convert/set_groups_azfp.py index 3ae19ce91..88f203e06 100644 --- a/echopype/convert/set_groups_azfp.py +++ b/echopype/convert/set_groups_azfp.py @@ -340,10 +340,9 @@ def set_beam(self) -> List[xr.Dataset]: "standard_name": "sound_frequency", }, ), - # TODO: Add channel dim, to match ek60 and ek80? "beam_type": ( - [], - 0, + ["channel"], + [0] * len(self.channel_ids_sorted), { "long_name": "Beam type", "flag_values": [0, 1], From ec6e95e7197fd6e28c7dfb17278de7ea514e0114 Mon Sep 17 00:00:00 2001 From: Emilio Mayorga Date: Thu, 3 Aug 2023 19:12:12 -0700 Subject: [PATCH 3/3] Add beam_direction_x/y/z Beam_group1 variables to AZFP, setting them to nan --- echopype/convert/set_groups_azfp.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/echopype/convert/set_groups_azfp.py b/echopype/convert/set_groups_azfp.py index 7fafff1aa..3917af874 100644 --- a/echopype/convert/set_groups_azfp.py +++ b/echopype/convert/set_groups_azfp.py @@ -352,6 +352,20 @@ def set_beam(self) -> List[xr.Dataset]: ], }, ), + **{ + f"beam_direction_{var}": ( + ["channel"], + [np.nan] * len(self.channel_ids_sorted), + { + "long_name": f"{var}-component of the vector that gives the pointing " + "direction of the beam, in sonar beam coordinate " + "system", + "units": "1", + "valid_range": (-1.0, 1.0), + }, + ) + for var in ["x", "y", "z"] + }, "backscatter_r": ( ["channel", "ping_time", "range_sample"], np.array(N, dtype=np.float32),