-
Notifications
You must be signed in to change notification settings - Fork 72
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
For EK60 and EK80 add beam
and ping_time
to Beam_groupX
#638
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #638 +/- ##
==========================================
- Coverage 78.43% 70.74% -7.69%
==========================================
Files 42 30 -12
Lines 3746 3394 -352
==========================================
- Hits 2938 2401 -537
- Misses 808 993 +185
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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.
Everything looks good! The only other thing I would suggest is to add tests for the dimensions after set_beam, perhaps best done as a separate test module (script) just for the dimensions?
Are the changes to |
Alright, I'm done. None of my comments involve the substance of your implementation. They're all either clarifications in comments and docstrings, or suggestions for small changes to the coding style largely for consistency. Since all CI tests are passing (woo-hoo!), I didn't bother pulling in your branch to test locally. This PR does what it sets out to do, and it does it in a very clean and parsimonious way. As you mentioned, it also sets up reusable machinery for the I'm not suggesting we change your scheme, though. I see it as a great transitional approach, since it cleanly handles both the addition of the missing dimensions on |
Actually, I have two suggestions to create some separation of sensor-specific from generic stuff. I think this would work well for the
|
I forgot to comment on downstream impacts on processed data like Sv. It looks like |
@emiliom these changes are required because of the addition of the dimensions. I have added an edit to my initial comment. |
Late to the party! On the potential blurring between This is along the same line as in our |
Good question. The main reason is because for EK80 complex data ( echopype/echopype/calibrate/calibrate_ek.py Line 706 in bfc22eb
echopype/echopype/calibrate/calibrate_ek.py Line 726 in bfc22eb
So, there is a conceptual incongruence and potential confusion that takes place here. This is related to how we use the I wonder if it may be better if we remove the
No, the complex and power/angle data are calibrated separately in the current echopype/echopype/calibrate/api.py Lines 126 to 143 in bfc22eb
Outputs would always just be length=1 along the beam dimension.
|
Thanks, @leewujung ! I just realized that this question of mine was non-sensical as written:
I was conflating the existence of 2 beam groups with the 4 @leewujung can you confirm? If you do, then, @b-reyes please push a new commit with this change. Note that you'll have to undo some of your changes to |
@emiliom I think this could work. It wouldn't have too much of an effect on my plans for
Using |
For the beam dimension on outputs of compute_Sv:
Yes, it is always length=1 and let's just squeeze it out. |
Thanks! @b-reyes : please go ahead and apply the changes I've suggested above. As you'll see, even though the squeeze operation will be implemented in the |
Great. I'm glad this is workable. Please see also @leewujung's alternative approach for accomplishing the same thing. I don't have a strong preference for either my or her approach. You two can decide 😃 |
I don't have a strong preference either. @b-reyes can decide :) |
@leewujung I definitely see how this could be done and it has the upside of being very simple to implement! I think the only downside to this type of approach is that sensor specific information would be in several places. I kind of like the idea of having one place for all of the information necessary for setting the groups (analogous to Since it is up to me ... I guess I will go with @emiliom's approach as it has the upside that all of this information is in one place. |
@emiliom and @leewujung based on the above comment it seems like the conclusion was that However, after running the tests I came across a situation where the parameters As this seems like unexpected behavior, how should we handle this? |
@b-reyes : Thanks for finding this out! The extra |
@emiliom and @leewujung I have addressed all of the comments you have suggested. The main portion of code that I modified was changing where the sensor-specific sets for adding the dimensions are located. This was done following @emiliom's suggestions, mainly:
Via Slack, it was decided that we will not be implementing the squeezing of |
echopype/convert/set_groups_ek60.py
Outdated
beam_ping_time_names are used in set_groups_base and | ||
in converting from v0.5.x to v0.6.0. The values within | ||
these sets are applied to all Sonar/Beam_groupX groups. | ||
""" |
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'm not sure, but the presence of this string block here threw me off. It's like a docstring right after a docstring.
Also, I may be wrong here, but I don't think I've seen "stuff" placed here in a class, outside of __init__
. I guess it works! But I would've expected it to be within __init__
.
Same goes for SetGroupsEK80
and SetGroupsAZFP
.
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.
These are "class variables" that are not instance variables under __init__
.
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.
Oh maybe you're just referring to the docstrings. Ha, I think there's some debate on where those go.
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 know this string looks out of place. I was using it for a multiline comment, but if you prefer, I can use #. In regards to the variables. I placed them before the __init__
this makes them global variables of the class. The benefit of this placement is that you do not have to initialize the class to use them. If you prefer, we can put them outside of the class at the top of the file.
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, and sorry for my ignorance there. I like @leewujung 's description -- class variables rather than instance variables.
I think I'd vote for using #'s. Otherwise my first instinct was to read that block as part of the class docstring.
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, and sorry for my ignorance there. I like @leewujung 's description -- class variables rather than instance variables.
Yes, that is a correct and a good description.
I think I'd vote for using #'s. Otherwise my first instinct was to read that block as part of the class docstring.
Sounds good, unless @leewujung has any objections, I will go ahead and 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.
Go ahead and change this, and feel free to self-merge!
Looks good, thanks! I just had one style comment; see my inline comment. |
I don't have other comments. I think this is ready to be merged! |
This PR addresses the addition of the dimensions
beam
andping_time
to variables withinBeam_groupX
. The specific variables were identified in #520. Note that this PR is only concerned with the sensors EK60 and EK80. The modifications necessary for AZFP will take place in a different PR.To complete this task, I have added the function
beamgroups_to_convention()
inechopype/convert/set_groups_base.py
. This function depends on several dictionaries I have defined at the top of the file. This function is called at the bottom ofset_beam()
in theset_groups_ekXX.py
files. Note: currently, my intention is to use this function again when I create my code for the conversion from v0.5.x to v0.6.x inopen_converted
.Edit:
The above additions cause some issues downstream. For this reason, I had to also change lines in
echopype/calibrate/calibrate_ek.py
andechopype/visualize/plot.py
to account for either the addition of thebeam
orping_time
dimension.