-
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
AZFP parser error catch to handle case of raw file with no temperature or tilt #1020
Conversation
This PR will be ready for review once all the CI tests pass. |
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 have a suggestion re the statement you used to handle the temperature conversion error.
Also, while you are on it, I think we should change the tilt calculations too. All tilt-related parameters in self.parameters
are also all 0 in the case of the glider, likely due to the same reason that the glider is recording the attitude separately just like the temperature. I suggest that in compute_tilt
we check for the parameter values, and if they are all 0, return NaN (instead of 0 as it currently returns), so that users do not think that they are actually getting tilt=0 data.
Makes sense. I'll take a closer look. I think it'll be more efficient, computationally, to do these tests outside the |
As an overall comment: I am about to write AZFP an email so I'll include the questions about whether these values are always zero in it! |
New commits:
For both tests, I set the testing of actual parameter values outside the Also, in the test module I replaced the use of |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## dev #1020 +/- ##
==========================================
- Coverage 80.45% 77.63% -2.82%
==========================================
Files 67 18 -49
Lines 6038 2880 -3158
==========================================
- Hits 4858 2236 -2622
+ Misses 1180 644 -536
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 51 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Great, thanks @emiliom! I'll comment on this once we hear from ASL and if the 0s are indeed the default behavior, we can merge this. Also, in looking at the code, I had the urge to move the |
…pgraded to drop_vars cases of deprecated xr drop usage
Pushed new commit to add test checks for |
You can submit a PR against my PR. I'll take a quick look before merging. |
@emiliom : the movements end up to be a much broader job than I originally thought (it's too fun to refactor!), so I think I'll submit a separate PR for that... |
I haven't heard from AZFP. I think we can merge this tomorrow if I don't hear back by then, so that this and #1024 can both get merged. We have a few small fixes in v0.7.1 and it'll be good to release by end of this week so that those changes get to actual package. |
Per email from ASL Environmental to @leewujung, it's been confirmed that the temperature (and tilt?) parameters in the XML file are set to zero when the sensor is deactivated. So, we can merge this PR as is, right? Then, PR #1024 can be merged, after updating it to reflect this PR. |
Yes, the values for temperature and tilt sensor coefficients will be 0 in glider-specific AZFP deployments. Feel free to merge this, and then I'll update #1024 and merge that too! |
Addresses remaining issue in #198, where an AZFP raw file without temperature data leads to a failure during
open_raw
. As diagnosed there, the failure comes about inparser_azfp.compute_temp
due to invalidR
values passed tomath.log
. A test has been added that will catch cases of theR
denominator being <= 0 and returnnp.nan
instead.This has been tested with an AZFP file (and corresponding XML) provided by @dsmossman.
Remaining tasks: