-
Notifications
You must be signed in to change notification settings - Fork 1
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
minmax reports strange values, when all the array is masked (2.12) #20
Comments
@dnadeau4 I am wondering whether this masking behaviour is related to the other issues we've been having with masks with regridding? |
Marking issue as stale, since there has been no activity in 30 days. Unless the issue is updated or the 'stale' tag is removed, this issue will be closed in 7 days. |
@jypeter is this still an issue with CDAT 8.2.1? |
@durack1 I have not installed 8.2.1 yet (and no time for that now, unfortunately). I have shared again my time_counter_bounds_pb.nc test file, with a valid link Can somebody give this a try The strange behavior is still here with the python 3 version of CDAT 8.1:
|
I've been able to replicate this with the latest version 8.2.1. You are correct the returned values in this case are the min and max float32 values. This behavior can be traced back to these lines. Lines 34 to 35 in d0ed149
I don't think this is correct behavior as I assume a masked values don't exist. I believe the goal of this function is to accept any number or array of numbers and return a package-agnostic value for min and max, returning I think returning |
Thanks for testing this! You could also return (np.masked, np.masked). Best is to try to stay consistent with numpy. Could you check the return value of |
It seems that the order of the returned values described in #20 (comment) is inconsistent with the order in #20 (comment) , which probably explains why in #20 (comment) the reported max is less than the reported min. |
I have come across some slightly anomalous data (see CDAT/cdms#235 for details) that led to a completely masked array. But
minmax
reports very big values instead ofmasked
2 interesting things to note here:
1.7976931348623157e+308
is the exact max value for IEEE real*8-1.797...
is negative and therefore lower than the min...Should
minmax
report(np.ma.masked, np.ma.masked)
instead ?Input data for the file
The following lines generated masked data
Note that I also get the same crazy big values when working with some dummy data
Oh, I also get the same crazy big values when working with real*4 data
The text was updated successfully, but these errors were encountered: