-
Notifications
You must be signed in to change notification settings - Fork 77
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
Overhaul and fix Sonar beam_group variables #658
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
11758c1
Corrected Sonar beam_group_ variable assignments to support EK80 1- v…
emiliom 107ad22
Renamed Sonar beam_group_name var to beam_group and made it the missi…
emiliom 7c91299
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 20080a3
Implement beamgroups_possible class variable in all SetGroups classes
emiliom 37cbe7a
Merge branch 'dev' into beamgroups_sonarvars
emiliom cbbd227
add beam_group coord to ek80 sonar group
b-reyes 91dc06d
Update echopype/convert/set_groups_ek80.py
emiliom 2706cfe
Update echopype/convert/set_groups_ek80.py
emiliom 62912fa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emiliom I don't think this function correctly accounts for the EK80 sensor. From my understanding, there do exist EK80 files that only have the power data. Thus, these types of files would have
Beam_group1
with the description "contains complex backscatter data and other beam or channel-specific data". If you want a file that exhibits this behavior, please seeechopype/test_data/ek80_new/D20211004-T234429.raw
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate? I think what you're saying is that the current group description for EK80
Beam_group1
is inadequate. If that's the case, then the fix would be to that text inSetGroupsEK80
(note that @leewujung composed that text). This function is generic and just sets up the beam_groups_descr variable and beam_group coord variable, based on the beam group information that's passed to it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the description is fine, just how you are assigning it to the beam group is incorrect. This is a known possibility, in
1.0.yml
we haveNote that we say either complex samples OR uncalibrated power samples
Basically, for EK80, your code should check if only one beam group exists and if only one beam group exists, then it should select the appropriate description. It seems like the issue here (at least for EK80) is that
beamgroups_possible
ties the description to a specific beam group i.e.Beam_group1
is always for the complex backscatter data. In practice,Beam_group1
can correspond to backscatter data that are complex samples OR power samples.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Let me chew on this. I'll get back to it mid-late afternoon, hopefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've looked at this more closely. For the sample file you listed (
test_data/ek80_new/D20211004-T234429.raw
-- thanks!), the data is written toBeam_group1
and its description becomes the EK80Beam_group1
description text we have, "contains complex backscatter data and other beam or channel-specific data." I'm not sure if you were saying that that's what should happen but doesn't or what does happen but shouldn't, but I believe you're saying the latter. That's the intended behavior, and not something that was changed in this PR. I think @leewujung provided that EK80 beam group description text.I still think that what you're getting at can be addressed by simply changing the description in
beamgroups_possible
that's associated withBeam_group1
. It sounds like something like this would be more appropriate: "contains backscatter data (either complex samples or uncalibrated power samples) and other beam or channel-specific data".Also, just to narrow down the problem, the function
beam_groups_vars
itself would not be the source of the potential problem, or solution. It's very generic. It just writes out what's passed to it. The issue you're getting at is what's passed to it bySetGroupsEK80.set_sonar
, which occurs here:echopype/echopype/convert/set_groups_ek80.py
Lines 171 to 172 in 91dc06d
The code does check -- elsewhere -- if only one beam group exists; if that's the case, that group will be
Beam_group1
and the corresponding dict frombeamgroups_possible
is passed to it. The description text for that group doesn't need to exactly specify whether the beam group is complex or power only; that would be nice, and we could look into it in the future, but it's not necessary. That description does need to be accurate and not misleading, though. It sounds like a change to that description along the lines of what I suggest would make it more accurate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was saying the latter. For the file you reference (and I provided), there is no complex backscatter data, so the description is wrong.
Although your change to the description does fix the issue I described, it somewhat conflicts with the
Beam_group2
description: "contains backscatter power (uncalibrated) and other beam or channel-specific data, including split-beam angle data when they exist." I am sure any user could infer thatBeam_group1
corresponds to "complex samples" when two beam groups exist. However, I liked the idea of being very specific and stating whether the beam group has complex or power only data. I think this would be simple to implement and would benefit the user by providing further clarity. If you think this change to a more specific description conflicts with the intent of this PR, I understand. I am willing to take on this issue, if you do not have the time for it.I see where you are coming from, maybe the function
beam_groups_vars
is not the most appropriate place to change this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you really think it'd be very simple to implement, go ahead; otherwise my vote would be for leaving it to 0.6.1. While the impact of this addition is "minor" on the scope of this PR (and it does fit its intent), I think it should be done in a different PR, mainly so we can move on with this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "simple" was the wrong word. I would say it is doable haha. I am fine if you would like to leave this for 0.6.1. I think we have enough on our plate for 0.6.0. I will create a new issue for this. For this PR, we can just change the
Beam_group1
description to "contains backscatter data (either complex samples or uncalibrated power samples) and other beam or channel-specific data", as you suggested.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be perfect, thank you. If you already had concrete ideas on how to accomplish this, I suggest you describe them at least briefly when creating the new issue, while they're fresh in your mind.
I'll go ahead and make the change now.