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

Add missing, mandatory Beam_groupX variables #1103

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions echopype/convert/set_groups_azfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,34 @@ def set_beam(self) -> List[xr.Dataset]:
"valid_min": 0.0,
},
),
"beam_stabilisation": (
[],
np.array(0, np.byte),
{
"long_name": "Beam stabilisation applied (or not)",
"flag_values": [0, 1],
"flag_meanings": ["not stabilised", "stabilised"],
},
),
"non_quantitative_processing": (
[],
np.array(0, np.int16),
{
"long_name": "Presence or not of non-quantitative processing applied"
" to the backscattering data (sonar specific)",
"flag_values": [0],
"flag_meanings": ["None"],
},
),
"sample_time_offset": (
[],
0.0,
{
"long_name": "Time offset that is subtracted from the timestamp"
" of each sample",
"units": "s",
},
),
},
coords={
"channel": (
Expand Down
19 changes: 19 additions & 0 deletions echopype/convert/set_groups_ek60.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,25 @@ def set_beam(self) -> List[xr.Dataset]:
],
},
),
"beam_stabilisation": (
[],
np.array(0, np.byte),
{
"long_name": "Beam stabilisation applied (or not)",
"flag_values": [0, 1],
"flag_meanings": ["not stabilised", "stabilised"],
},
),
"non_quantitative_processing": (
[],
np.array(0, np.int16),
{
"long_name": "Presence or not of non-quantitative processing applied"
" to the backscattering data (sonar specific)",
"flag_values": [0],
"flag_meanings": ["None"],
},
),
},
coords={
"channel": (
Expand Down
32 changes: 29 additions & 3 deletions echopype/convert/set_groups_ek80.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,25 @@ def _assemble_ds_ping_invariant(self, params, data_type):
["channel"],
beam_params["transceiver_software_version"],
),
"beam_stabilisation": (
[],
np.array(0, np.byte),
{
"long_name": "Beam stabilisation applied (or not)",
"flag_values": [0, 1],
"flag_meanings": ["not stabilised", "stabilised"],
},
),
"non_quantitative_processing": (
[],
np.array(0, np.int16),
{
"long_name": "Presence or not of non-quantitative processing applied"
" to the backscattering data (sonar specific)",
"flag_values": [0],
"flag_meanings": ["None"],
},
),
},
coords={
"channel": (
Expand Down Expand Up @@ -921,10 +940,17 @@ def _assemble_ds_common(self, ch, range_sample_size):
"flag_meanings": ["CW", "FM", "FMD"],
},
),
"range_sample_offset": (
"sample_time_offset": (
["ping_time"],
np.array(self.parser_obj.ping_data_dict["offset"][ch], dtype=int),
{"long_name": "First sample number"},
(
np.array(self.parser_obj.ping_data_dict["offset"][ch])
* np.array(self.parser_obj.ping_data_dict["sample_interval"][ch])
),
{
"long_name": "Time offset that is subtracted from the timestamp"
" of each sample",
"units": "s",
},
),
},
coords={
Expand Down
3 changes: 2 additions & 1 deletion echopype/utils/coding.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"cal_channel_id": np.str_,
"beam": np.str_,
"channel_mode": np.byte,
"range_sample_offset": np.int32,
"beam_stabilisation": np.byte,
"non_quantitative_processing": np.int16,
} # channel name # beam name

PREFERRED_CHUNKS = "preferred_chunks"
Expand Down