[ https://issues.apache.org/jira/browse/CLIMATE-818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15351914#comment-15351914 ]
ASF GitHub Bot commented on CLIMATE-818: ---------------------------------------- GitHub user agoodm opened a pull request: https://github.com/apache/climate/pull/366 CLIMATE-818 - local.load_dataset_from_multiple_netcdf_files() does not accept user entered lon_name and lat_name fields. - Fixed ```load_dataset_from_multiple_netcdf_files()``` so that user entered ```lat_name```, ```lon_name```, and ```time_name``` are valid. - Slight change to handling of optional arguments in load_file() to ensure default behavior is handled correctly. @huikyole Please feel free to review before I merge this! You can merge this pull request into a Git repository by running: $ git pull https://github.com/agoodm/climate CLIMATE-818 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/climate/pull/366.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #366 ---- commit 009daf6f144965b86e993847ce21943c7c99eebb Author: Alex Goodman <ago...@users.noreply.github.com> Date: 2016-06-27T21:47:13Z CLIMATE-818 - local.load_dataset_from_multiple_netcdf_files() does not accept user entered lon_name and lat_name fields. ---- > local.load_dataset_from_multiple_netcdf_files() does not accept user entered > lon_name and lat_name fields. > ---------------------------------------------------------------------------------------------------------- > > Key: CLIMATE-818 > URL: https://issues.apache.org/jira/browse/CLIMATE-818 > Project: Apache Open Climate Workbench > Issue Type: Bug > Components: data sources > Affects Versions: 1.1 > Reporter: Alex Goodman > Assignee: Alex Goodman > Fix For: 1.1 > > > For netcdf files in which the lon and lat variable names which are not listed > in the defaults and must be entered by the user, > {{load_dataset_from_multiple_netcdf_files()}} fails: > {code:title=python|borderStyle=solid} > ----> 1 local.load_dataset_from_multiple_netcdf_files('T2M', lat_name='YDim', > lon_name='XDim', file_path='/home/goodman/data/MERRA', > filename_pattern=['/MERRA*.nc']) > /home/goodman/climate/ocw/data_source/local.py in > load_dataset_from_multiple_netcdf_files(variable_name, lat_name, lon_name, > time_name, name, file_list, file_path, filename_pattern, mask_file, > mask_variable, mask_value) > 497 for ifile, file in enumerate(nc_files): > 498 print 'NC file '+str(ifile+1)+'/'+str(nfile), file > --> 499 file_object0= load_file(file, variable_name) > 500 values0= file_object0.values > 501 times.extend(file_object0.times) > /home/goodman/climate/ocw/data_source/local.py in load_file(file_path, > variable_name, variable_unit, elevation_index, name, lat_name, lon_name, > time_name) > 242 > 243 if lat_name is None: > --> 244 lat_name = _get_netcdf_variable_name(LAT_NAMES, netcdf, > variable_name) > 245 if lon_name is None: > 246 lon_name = _get_netcdf_variable_name(LON_NAMES, netcdf, > variable_name) > /home/goodman/climate/ocw/data_source/local.py in > _get_netcdf_variable_name(valid_var_names, netcdf, netcdf_var) > 112 "supplied list of valid variable names. " > 113 ) > --> 114 raise ValueError(error) > 115 > 116 def load_WRF_2d_files(file_path=None, > ValueError: Unable to locate a single matching variable name from the > supplied list of valid variable names. {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)