-
Notifications
You must be signed in to change notification settings - Fork 415
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
Masked arrays break units #983
Comments
So if you read in NUCAPS data with xarray, nothing is masked and everything works just fine. However, if you use netcdf4 to read in the data, all variables are returned as masked arrays. Units are unable to be assigned to these, which then breaks calculations (more than just CAPE/CIN due to lack of units). How do we go about solving this, since it seems that the issue is on the data import side and not on the calculation side? |
I'm kind of embarrassed I didn't see that at the time since we've hit that in the past. I'm going to rename the issue to cover that part, but I don't think it's something we should be trying to fix for the next release. |
I'm not sure if this should go in this issue or a new one, but yet again there are breaks with the current master branch of Pint, this time with MaskedArrays. Since MaskedArrays do not currently defer properly on ufuncs, Pint's implementation of Also, I'm not sure if I'll have the time to patch MetPy with respect to this before I have to leave for travels tomorrow and be away from regular internet access for the next week, so I wanted to make sure I got this out there. If it isn't easy enough to fix quick, perhaps MetPy v0.12 needs to pin Pint to <0.10? I do apologize for creating a bit of a time bomb and not fixing it! |
No worries! It's good to know. Should be able to clean those up I think... |
The issue occurs only, when "x" in first_derivative is a masked array with units. As all arrays stemming from NetCDF access are basically masked arrays, we do not have non-masked arrays in our code, even though the mask is almost always 'False'. I added a test case demonstrating the problem, it fails without the contained fix. See issue Unidata#983
The issue occurs only, when "x" in first_derivative is a masked array with units. As all arrays stemming from NetCDF access are basically masked arrays, we do not have non-masked arrays in our code, even though the mask is almost always 'False'. I added a test case demonstrating the problem, it fails without the contained fix. See issue Unidata#983
Feeding masked arrays to the CAPE/CIN functions results in an error about masked points. Sample data can be pull for NUCAPS and/or taken from #973.
The text was updated successfully, but these errors were encountered: