Uploaded image for project: 'Apache Open Climate Workbench (Retired)'
  1. Apache Open Climate Workbench (Retired)
  2. CLIMATE-818

local.load_dataset_from_multiple_netcdf_files() does not accept user entered lon_name and lat_name fields.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.1.0
    • data sources
    • None

    Description

      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:

      python
      ----> 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. 

      Attachments

        Issue Links

          Activity

            People

              agoodman Alex Goodman
              agoodman Alex Goodman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: