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 (JIRA)" <ji...@apache.org> on 2017/11/26 23:30:00 UTC

[jira] [Commented] (CLIMATE-797) Attribute error in mask_missing_data

    [ https://issues.apache.org/jira/browse/CLIMATE-797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16266247#comment-16266247 ] 

Michael Anderson commented on CLIMATE-797:
------------------------------------------

The comments in the method in question state:
If any of dataset in dataset_array has missing values at a grid point,
the values at the grid point in all other datasets are masked.

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

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".  Other than None or NaN, are there any other values that by convention constitute missing?  The netCDF default fill values?

Preferences on the approach and / or suggestions on the second approach?

> Attribute error in mask_missing_data
> ------------------------------------
>
>                 Key: CLIMATE-797
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-797
>             Project: Apache Open Climate Workbench
>          Issue Type: Bug
>            Reporter: Ibrahim Jarif
>            Assignee: Michael Anderson
>            Priority: Critical
>             Fix For: 1.3.0
>
>
> The *mask_missing_data* function in *dataset processor* module throws *AttributeError: Object does not have attribute mask* when trying to execute the function.
> {code}
> Line 737: def mask_missing_data(dataset_array):
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)