Add CDAWeb CDF support for WIND and STEREO - #254
Conversation
| raw_freqs = cdf.varget("FREQUENCY") | ||
| freq_fill = cdf.varattsget("FREQUENCY").get("FILLVAL", -1e31) | ||
| valid_freq_mask = raw_freqs > freq_fill | ||
| freqs = raw_freqs[valid_freq_mask] << u.Unit(cdf.varattsget("FREQUENCY").get("UNITS", "Hz")) |
There was a problem hiding this comment.
Hum the fill value isn't used is it? Maybe do the assignment and filling the convert to a unit?
There was a problem hiding this comment.
Got it, working on the assignment. One doubt, what should i use to replace the fill values?? np.nan or 0???
|
I've pushed an update using |
hayesla
left a comment
There was a problem hiding this comment.
this is looking good! there are two small bugs thought when I tested it with the real data files.
also could you add tests for teh two new data file paths? (using @pytest.mark.remote_data tests), an online test against a real CDAWeb file would cover the real parsing (and would have caught the two plotting issues I raised here)
Thanks for testing this, i'll update the frequency handling accordingly and add online cdaweb tests for both the WIND and STEREO paths so we can cover the real parsing as well. |
|
It seems the failure was due to a deprecation warning in |
|
|
||
| meta = { | ||
| "cdf_globals": cdf_globals, | ||
| "detector": "LFR+HFR", |
There was a problem hiding this comment.
Im not too familiar with this data product or instruments but I think it makes sense to be able to read and plot the data from the different detectors separately. Unless it's only given by the instrument team as one file I can imagine a world where you would also like one without the other?
There was a problem hiding this comment.
Maybe the data can be separated using crop_freq() to get specific frequency range
There was a problem hiding this comment.
hmmm true, it looks like the freq ranges overlap though (10-160 kHz and 125kHz - 16MHz), I would vote to separate them but @samaloney or @hayesla might have better perspective
There was a problem hiding this comment.
I guess the question for @Amityush-lgtm is where did you get "LFR+HFR" from to hardcode in here? i think this reader works on one file (rather than seperate HFR+LFR files so i think its ok
There was a problem hiding this comment.
I wrote "LFR+HFR" because the CDAWeb files actually combines both the LFR and HFR into one single array so, i thought "LFR+HFR" would may be right name the detector
There was a problem hiding this comment.
Keeping this reader is the best! Maybe at one point we can add readers for the LFR and HFR data separately as they won't work by default with this one but, that can be for a different and future PR
from the CDF file it looks like it could be L3 data which was surprising @hayesla (Data_type : ['L3>Level 3'])
https://gist.github.com/Hermanlrx/0f149107efdb3c29e44759ae894c3294
There was a problem hiding this comment.
radiospectra shouldn't be changing the data only loading so if the file is combined leave it but this could make nice gallery example later showing how to split using crop_by_values.
There was a problem hiding this comment.
ok sounds good @Amityush-lgtm ! maybe open an issue to add support for the LFR/HFR seperate files @Hermanlrx and that can be in another PR
There was a problem hiding this comment.
Sounds good, I'll open the issue right away
There was a problem hiding this comment.
radiospectra shouldn't be changing the data only loading so if the file is combined leave it but this could make nice gallery example later showing how to split using
crop_by_values.
Should i add this in the issue or make a seperate issue for this?
|
|
||
| meta = { | ||
| "cdf_globals": cdf_globals, | ||
| "detector": "LFR+HFR", |
There was a problem hiding this comment.
ok sounds good @Amityush-lgtm ! maybe open an issue to add support for the LFR/HFR seperate files @Hermanlrx and that can be in another PR
PR Description
Fixes #199
This PR adds support for reading CDAWeb CDF files
Changes:
_read_cdfto handle WIND WAVES (RAD1/RAD2) files sourced from CDAWeb.AI Assistance Disclosure
AI tools were used for: