Skip to content

Commit

Permalink
Merged changes from latest dev and resolved conflict with ek60 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliom committed Jul 31, 2023
2 parents ff082cc + de4fb4d commit 837dd2e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
6 changes: 4 additions & 2 deletions echopype/calibrate/cal_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,11 @@ def get_cal_params_EK(

# Private function to get fs
def _get_fs():
if "fs_receiver" in vend:
return vend["fs_receiver"]
# If receiver_sampling_frequency recorded, use it
if "receiver_sampling_frequency" in vend:
return vend["receiver_sampling_frequency"]
else:
# If receiver_sampling_frequency not recorded, use default value
# loop through channel since transceiver can vary
fs = []
for ch in vend["channel"]:
Expand Down
24 changes: 14 additions & 10 deletions echopype/convert/set_groups_ek60.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,17 @@ def set_beam(self) -> List[xr.Dataset]:
["channel"],
beam_params["gpt_software_version"],
),
"transmit_type": (
[],
"CW",
{
"long_name": "Type of transmitted pulse",
"flag_values": ["CW"],
"flag_meanings": [
"Continuous Wave",
],
},
),
"beam_stabilisation": (
[],
np.array(0, np.byte),
Expand Down Expand Up @@ -664,17 +675,10 @@ def set_beam(self) -> List[xr.Dataset]:
"flag_meanings": ["power only", "angle only", "power and angle"],
},
),
"sample_time_offset": (
"range_sample_offset": (
["ping_time"],
(
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",
},
np.array(self.parser_obj.ping_data_dict["offset"][ch], dtype=np.int32),
{"long_name": "First sample number"},
),
"channel_mode": (
["ping_time"],
Expand Down
2 changes: 1 addition & 1 deletion echopype/convert/set_groups_ek80.py
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ def set_vendor(self) -> xr.Dataset:
},
)
if "rx_sample_frequency" in param_dict:
ds_table["fs_receiver"] = xr.DataArray(
ds_table["receiver_sampling_frequency"] = xr.DataArray(
param_dict["rx_sample_frequency"].astype(float),
dims=["channel"],
coords={"channel": ds_table["channel"]},
Expand Down

0 comments on commit 837dd2e

Please sign in to comment.