Closed jklenzing closed 1 year ago
Note that the fix we implemented for similar issues elsewhere is already in the load_xarray routine:
@JonathonMSmith, if this is a straightforward fix, let's try to get this into 0.0.5. I'm worried that this may require fixes at pysat though, in which case we'll delay and transfer the issue if appropriate.
If I run this code:
import pysat swepam = pysat.Instrument('ace', 'swepam_l2', inst_id='1hr', tag='key') swepam.load(2020, 1)
The variables "Time_PB5" and "Weight" are empty. This happens if I use the cdflib xarray interface, or vanilla cdflib.
These values are not in cdaweb, so It's fine that there's no data, but srange to me that they're even populated to begin with.
I'd also like to note, that ace won't load at all if "pandas_format" is true With an error from cdflib: ValueError: No records found for variable Time_PB5
I don't know if all of this is directly related, but I'm finding these quirks and want to note them
I don't know how to fix this, because as soon as you add a variable with more meta than the others, they all get this extra metadata added on. I see a couple of options.
I think the extra meta issue will have to be solved by pysat. Looking over the max / min / fill, value_min and value_max are set correctly, but not fill. I think if we can sort that out we're good on this package.
Ohh, I think I completely misunderstood this issue
If I change 'fill_val' to 'fill' on Line 281 above, this fixes the problem. I've found an even deeper issue: the multi-dimensions are for storing time values (year, day, something?). Probably need to drop these and convert to pandas.
I've got a fix set up. running the full suite of tests now.
Ohh, I think I completely misunderstood this issue
That's probably expected the way I wrote it up. There are 2 issues buried up there.
Describe the bug When loading ACE data, a number of metadata parameters are dropped. For swepam_l2,
Similar warnings are thrown for all ACE instruments here, but not other xarray cdf instruments.
To Reproduce Compare the values of
and
cdflib produces:
pysat produces
Expected behavior Meta data should be transferred, not dropped.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context value_min1, etc are part of another issue (though potentially linked), to be added to pysat. Some variables here have multiple additional value_min, value_max, scaletyp, etc. Because pysat meta is stored as a dataframe, these get automatically initiated to default values for all variables.