-
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
Fix regression bug in computing MVBS in selecting echo_range
for specific frequency
#736
Conversation
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## dev #736 +/- ##
==========================================
+ Coverage 82.16% 88.87% +6.70%
==========================================
Files 45 9 -36
Lines 4183 683 -3500
==========================================
- Hits 3437 607 -2830
+ Misses 746 76 -670
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 |
Should include a typing error fix in the input |
echo_range
for specific frequency
# Order the dimensions | ||
out["echo_range"] = out["echo_range"].transpose("channel", "ping_time", "range_sample") | ||
|
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.
@leewujung I am wondering if this is the most appropriately place for this. This line is necessary because of how we create the EchoData object for AZFP, correct? If so, should we instead correct the order in set_groups_azfp
? I am fine with leaving this as is, I just thought I would bring this up.
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.
Good point, I agree this is the best done in set_groups_azfp
. In fact this was part of my test to see if we can do without .drop("channel")
in this line:
echopype/echopype/preprocess/api.py
Line 79 in b6205e5
ds["echo_range"].isel(ping_time=0).squeeze().drop("channel").data, |
Somehow that extra dimension/coordinate only shows up for AZFP data, and I was wondering if it had anything to do with the order of the dimension, but that wasn't the reason.
I'll create an issue so we remember to do this in set_groups_azfp
instead of here.
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.
Sounds good!
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 actually, now that I looked at this again, the order of dimension to be changed is for echo_range
and not Sv
(which came from backscatter_r
), so I guess nothing has to change for set_groups_azfp
, but it is the AZFP part of compute_range
that needs to change.
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 was having a little trouble tracking down where that happened. The AZFP part of compute_range
was using parts of the EchoData object, so I assumed that we needed to make corrections in set_groups_azfp
. After looking into this a little further, I found that in the EK
else statement of compute_range
we do range_meter = range_meter.transpose("channel", "ping_time", "range_sample")
, so maybe the fix is as simple as adding that to the AZFP if statement block.
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 right, cool that you tracked it down! I'll link your comment to that issue... v0.6.2... so that we don't have to do this now. :P
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 to me.
Thanks @b-reyes ! I'll merge now! |
This PR fixes a few small things in related to
compute_MVBS
operation. Does not address #662 😕Tasks
echo_range
from the first channel for all channels: this is a bug from the process of converting the data to be aligned with dimensionfrequency
tochannel
in v0.6.0echo_range
in the AZFP Sv output to be consistent with data variableSv
range_meter_bin
currently listed as int, but should be general as float