Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge branch 'CLIMATE-797' of https://github.com/MichaelArthurAnderso…
  • Loading branch information
agoodm committed Dec 2, 2017
2 parents 2d30ef8 + 3e17f5c commit 8cf58f88fef22a3f50623f0af13b0cda899c4ffb
Showing 1 changed file with 7 additions and 3 deletions.
@@ -867,9 +867,13 @@ def mask_missing_data(dataset_array):

mask_array = np.zeros(dataset_array[0].values.shape)
for dataset in dataset_array:
index = np.where(dataset.values.mask == True)
if index[0].size > 0:
mask_array[index] = 1
# CLIMATE-797 - Not every array passed in will be a masked array.
# For those that are, action based on the mask passed in.
# For those that are not, take no action (else AttributeError).
if hasattr(dataset.values, 'mask'):
index = np.where(dataset.values.mask == True)
if index[0].size > 0:
mask_array[index] = 1
masked_array = []
for dataset in dataset_array:
dataset.values = ma.array(dataset.values, mask=mask_array)

0 comments on commit 8cf58f8

Please sign in to comment.