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

data_source.local is unable to open RegCM data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4.0
    • 1.4.0
    • data sources
    • None

    Description

      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:

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

      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.

      >>> y = netCDF4.Dataset(x)
      >>> y.variables['prmax']
      <netCDF4.Variable object at 0x104f6c3b0>
      

      Attachments

        1. RegCM_4-3_SampleOutput.nc.zip
          7.78 MB
          Michael Joyce

        Activity

          People

            Unassigned Unassigned
            mjoyce Michael Joyce
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: