You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by "Huikyo Lee (JIRA)" <ji...@apache.org> on 2017/07/14 04:00:00 UTC

[jira] [Commented] (CLIMATE-919) load_dataset_from_multiple_netcdf_files() does not have default variable units

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

Huikyo Lee commented on CLIMATE-919:
------------------------------------

I see. Could you make a PR for fixing this? We should use '1' as the default unit if the unit does not exist (based on [http://cfconventions.org/cf-conventions/v1.6.0/cf-conventions.html#table-supported-units])



> load_dataset_from_multiple_netcdf_files() does not have default variable units
> ------------------------------------------------------------------------------
>
>                 Key: CLIMATE-919
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-919
>             Project: Apache Open Climate Workbench
>          Issue Type: Bug
>          Components: data sources
>    Affects Versions: 1.2.0
>            Reporter: Alex Goodman
>             Fix For: 1.3.0
>
>
> [~huikyole]
> load_dataset_from_multiple_netcdf_files() should read the variable units from the netcdf file by default. Because it does not, when not entering them manually in a config file I get this error:
> {code}
> TypeError                                 Traceback (most recent call last)
> /home/goodman/rcmes/climate/RCMES/run_RCMES.py in <module>()
>     247                                 reference_dataset, reference_name, target_datasets,
>     248                                 target_names,
> --> 249                                 path=workdir+config['output_netcdf_filename'])
>     250 
>     251 """ Step 7: Calculate metrics and draw plots """
> /home/goodman/rcmes/climate/ocw/dataset_processor.pyc in write_netcdf_multiple_datasets_with_subregions(ref_dataset, ref_name, model_dataset_array, model_names, path, subregions, subregion_array, ref_subregion_mean, ref_subregion_std, model_subregion_mean, model_subregion_std)
>     713             imodel].values
>     714         out_file.variables[model_names[imodel]].units = model_dataset_array[
> --> 715             imodel].units
>     716 
>     717     if subregions is not None:
> netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.__setattr__ (netCDF4/_netCDF4.c:38423)()
> netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.setncattr (netCDF4/_netCDF4.c:35603)()
> netCDF4/_netCDF4.pyx in netCDF4._netCDF4._set_att (netCDF4/_netCDF4.c:8002)()
> TypeError: illegal data type for attribute, must be one of ['i8', 'f4', 'u8', 'i1', 'u4', 'S1', 'i2', 'u1', 'i4', 'u2', 'f8'], got O
> {code}



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