-
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
Modify combine_echodata
check for reversed time coordinates
#689
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #689 +/- ##
===========================================
- Coverage 79.26% 27.76% -51.51%
===========================================
Files 43 41 -2
Lines 3888 3882 -6
===========================================
- Hits 3082 1078 -2004
- Misses 806 2804 +1998
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.
I think the changes are ready to go once that repeated block is factored out. Thanks!
# time3 before reversal correction | ||
old_time3 = None | ||
# time3 after reversal correction | ||
new_time3 = None |
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.
Why do all these old_*
and new_*
variables need to be declared? I see that in check_and_correct_reversed_time
, old_time
is tested for None
. But as far as I can see, the old_time
value passed to that function will always be None
, at this time. Same for new_time
: the value passed to check_and_correct_reversed_time
seems like it's always None
at this time. The function arguments old_time
and new_time
could be changed from positional to keyword arguments with default None
values; or removed altogether, but then you'd have tweak the function code itself.
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.
From my understanding the code right now basically uses old_*
and new_*
as flags. You are right that how it is done does not make too much sense and we could probably create a better solution to this. I suggest that we open up a new issue and deal with this after 0.6.0, @emiliom if you agree, can you open up an issue for 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.
Thanks. That makes sense, and I'll open the issue.
Regarding the time reversal corrections in the combine operation, you and @leewujung have probably already discussed this, but I'm curious if you explicitly came to agreement to also apply time reversal corrections to variables in |
This looks good. The suggestions I've made don't involve actual problems, except for the simple change to the |
Co-authored-by: Emilio Mayorga <[email protected]>
We have not discussed this. As it stands right now, this function will apply time reversal to the |
I have committed your change to the |
Thanks. I'll follow up with 1-2 new issues (see my comments). We can merge now, right? |
Almost forgot this:
I don't know if it's a cause for concern. I'm fine leaving things as is in this PR, with respect to |
Yes, I think we can merge now. |
While looking into
ep.combine_echodata
, I noticed that we do not test for reversed time coordinates for all sensors and all times. This PR solves this. Specifically, the following items were completed.Top-level
,Sonar
,Provenance
, andPlatform/NMEA
) and correct them if necessary.concat_dims
incore.py
for each sensor. While creating consistent time coordinates, these were not modified, but they should have been. The modifications include:time2
to theplatform
keyping_time
totime2
for theplatform
keytime3
to theplatform
keytime3
to theplatform
key