-
Notifications
You must be signed in to change notification settings - Fork 76
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
Update _calc_Sv_offset
for AZFP parsing
#1304
Conversation
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1304 +/- ##
==========================================
- Coverage 83.52% 77.94% -5.58%
==========================================
Files 64 16 -48
Lines 5686 2621 -3065
==========================================
- Hits 4749 2043 -2706
+ Misses 937 578 -359
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 look good. I am a bit curious about its usage though.
I'm looking at the code found here in parse_groups_azfp.py
set_vendor
function:
# Build variables in the output xarray Dataset
Sv_offset = np.zeros_like(self.freq_sorted)
for ind, ich in enumerate(self.freq_ind_sorted):
# TODO: should not access the private function, better to compute Sv_offset in parser
Sv_offset[ind] = self.parser_obj._calc_Sv_offset(
self.freq_sorted[ind], unpacked_data["pulse_len"][ich]
)
Perhaps it can be an independent function, but still in parse_azfp.py
, or we can (as the TODO says) create the Sv_offset
in the parser and pack it in parser_obj.unpacked_data
? I think the latter would be much nicer since set_vendor
should just be packing the vendor datasets, and it also gives the function an actual purpose within the parser class, rather than just being in it for encapsulation.
Yep, it'll be nice to have that in the parser so that we can keep the set group methods clean. Do you want to make a PR for that change? 😛 |
@leewujung Yeah I can do that. Perhaps, I do that PR in conjunction with when the test data arrives, so it's a little more than a few lines changed? |
Sure, let me email ASL and cc you. |
This PR includes the following:
_calc_Sv_offset
to use a param dictionary instead of nested if-elseOne existing test needs to be skipped because the pulse length is not in the Sv_offset dictionary.
We need to request a new file from ASL or Rutgers folks to make sure we still have tests covering files without temperature/pressure/tilt data (those on glider).
This is to address #1300.