You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by Michael Anderson <mi...@gmail.com> on 2017/11/26 23:44:50 UTC

utils.calc_subregion_area_mean_and_std Throws AttributeError

I'm also working on https://issues.apache.org/jira/browse/CLIMATE-803.

The problem here is that the method assumes the first dataset passed
is a masked array.  If a regular numpy array (e.g. OCW dataset) is
passed, it does not have a mask attribute and an error is thrown


After calculating the mean and std, it attempts to apply the mask of
the first dataset to the results.


As mentioned for the other JIRA I'm looking at:


1.  I could tidy up the error handling to make it more clear to the
caller that a masked array was expected.


2.  I could check if a mask exists and use that.  In the case of the
mask not being supplied, I could carry out the intent of the function
and manually check the array for "missing values".


Alternatively


3.  In this case, the error is happening in
utils.calc_subregion_area_mean_and_std.  It could be assumed that the
masking should have occurred in the data processing and could simply
be removed from this method.


Preferences on the approach?


Thanks,


Michael A. Anderson