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

Christopher Jack commented on CLIMATE-501:
------------------------------------------

Sorry to keep chiming in from the side lines... but this one is important to 
me.  I really think that the code generally needs to align itself with the CF 
standards  ( http://cfconventions.org/ ).  Its a bit of work but really 95% of 
climate model output will be complying with CF as it is a requirement for 
submission to CORDEX, CMIP, and other coordinated activities.  

In the CF standard, the coordinate variables do not have to have have any 
particular name.  Latitude and longitude variables are identified by their 
units attributes of "degrees_north" and "degrees_east" (with some variants 
allowed), or *optionally* by their standard_name attribute.   Its also 
important to note that some model output will legitimately have two different 
horizontal grids (for staggered output) so you'll have two sets of latitude and 
longitude variables and which one you use depends on the variable.  Its things 
like this that the OCW code really needs to be able to handle if its going to 
be used extensively.

I've written most/all of this logic in my own python libraries that handle 
climate model output so am happy to contribute but its going to take some 
rethinking of some aspects of the OCW code... not sure how to start that 
process or even if this is something that others want to consider.

> data_source.local is unable to open RegCM data
> ----------------------------------------------
>
>                 Key: CLIMATE-501
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-501
>             Project: Apache Open Climate Workbench
>          Issue Type: Bug
>          Components: data sources
>    Affects Versions: 0.3-incubating
>            Reporter: Michael Joyce
>             Fix For: 0.5
>
>         Attachments: RegCM_4-3_SampleOutput.nc.zip
>
>
> Per the discussion on the mailing list, data_source.local is unable to open a 
> RegCM file. It seems at first glance that it is failing to find the user 
> supplied variable names even though I'm able to access the requested variable 
> through the netCDF4.Dataset object in the REPL.
> Loading the attached example file with the following commands results in the 
> error:
> {code}
> >>> local.load_file('/Users/mjjoyce/Downloads/RegCM_4-3_SampleOutput.nc', 
> >>> 'prmax')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "ocw/data_source/local.py", line 216, in load_file
>     lat_name = _get_netcdf_variable_name(LAT_NAMES, netcdf, variable_name)
>   File "ocw/data_source/local.py", line 93, in _get_netcdf_variable_name
>     raise ValueError(error)
> ValueError: Unable to locate a single matching variable name in NetCDF 
> object. 
> {code}
> However, manually loading the dataset and attempting to access the same 
> variable works file. Note that 'x' here is simply the path to the same file.
> {code}
> >>> y = netCDF4.Dataset(x)
> >>> y.variables['prmax']
> <netCDF4.Variable object at 0x104f6c3b0>
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to