Dear CDS team, I am trying to visualize two datasets in the same ct.chart.line plot in the following workflow: https://sis-dev.climate.copernicus.eu/toolbox-editor/1474/humidity-and-temperature

When importing the 'reanalysis-era5-pressure-levels-monthly-means'-data, however, I receive the following error:

Traceback (most recent call last):
File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 49, in handle_request
result = cached(context.method, proc, context, context.args, context.kwargs)
File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached
result = proc(context, *context.args, **context.kwargs)
File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__
return p(*args, **kwargs)
File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__
return self.proc(context, *args, **kwargs)
File "/home/cds/cdsservices/services/retrieve.py", line 153, in execute
time_dimensions=time_dimensions, read_attributes=read_attributes
File "/opt/cdstoolbox/cdscompute/cdscompute/context.py", line 249, in call
return c.call(service, *args, **kwargs).value
File "/opt/cdstoolbox/cdsworkflows/cdsworkflows/future.py", line 76, in value
raise self._result
cdsworkflows.error.ClientError: {'traceback': 'Traceback (most recent call last):\n File "/usr/local/lib/python3.6/site-packages/cfgrib/dataset.py", line 450, in build_variable_components\n data_var_attrs = enforce_unique_attributes(index, data_var_attrs_keys, filter_by_keys)\n File "/usr/local/lib/python3.6/site-packages/cfgrib/dataset.py", line 259, in enforce_unique_attributes\n raise DatasetBuildError("multiple values for key %r" % key, key, fbks)\ncfgrib.dataset.DatasetBuildError: multiple values for key \'dataType\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/opt/cds/cdsinf/python/lib/cdsinf/runner/dispatcher.py", line 474, in handle_request\n context.get("method_config", None))\n File "/opt/cdstoolbox/cdscompute/cdscompute/cdshandlers/services/handler.py", line 49, in handle_request\n result = cached(context.method, proc, context, context.args, context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/caching.py", line 108, in cached\n result = proc(context, *context.args, **context.kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 118, in __call__\n return p(*args, **kwargs)\n File "/opt/cdstoolbox/cdscompute/cdscompute/services.py", line 59, in __call__\n return self.proc(context, *args, **kwargs)\n File "/home/cds/cdsservices/services/cdm_translate.py", line 55, in execute\n transformed = gridded.open_dataset(p, product=product, **xarray_kwargs)\n File "/opt/cdstoolbox/cdscdm/cdscdm/gridded.py", line 597, in open_dataset\n dataset = xr.open_mfdataset(path, decode_cf=False, **xarray_kwargs)\n File "/usr/local/lib/python3.6/site-packages/xarray/backends/api.py", line 900, in open_mfdataset\n datasets = [open_(p, **open_kwargs) for p in paths]\n File "/usr/local/lib/python3.6/site-packages/xarray/backends/api.py", line 900, in <listcomp>\n datasets = [open_(p, **open_kwargs) for p in paths]\n File "/usr/local/lib/python3.6/site-packages/xarray/backends/api.py", line 517, in open_dataset\n filename_or_obj, lock=lock, **backend_kwargs\n File "/usr/local/lib/python3.6/site-packages/xarray/backends/cfgrib_.py", line 43, in __init__\n self.ds = cfgrib.open_file(filename, **backend_kwargs)\n File "/usr/local/lib/python3.6/site-packages/cfgrib/dataset.py", line 641, in open_file\n return Dataset(*build_dataset_components(index, read_keys=read_keys, **kwargs))\n File "/usr/local/lib/python3.6/site-packages/cfgrib/dataset.py", line 586, in build_dataset_components\n raise DatasetBuildError(error_message, key, fbks)\ncfgrib.dataset.DatasetBuildError: multiple values for unique key, try re-open the file with one of:\n filter_by_keys={\'dataType\': \'em\'}\n filter_by_keys={\'dataType\': \'an\'}\n filter_by_keys={\'dataType\': \'es\'}\n'}

I hope you can help.

Thanks,

Huayuan

2 Comments

  1. Hi Huayuan,

    I cannot see any 'variable' or 'product_type' in your retrieve of 'reanalysis-era5-pressure-levels-monthly-means'.

    Use the form to build a valid request: https://sis-dev.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-pressure-levels-monthly-means?tab=form

    This is what I see in your workflow:

    data_era = ct.catalogue.retrieve(
            'reanalysis-era5-pressure-levels-monthly-means',
            {
                'area': [
                    20, -180, -20,
                    180,
                ],
                'time': '00:00',
                'month': [
                    '01', '02', '03',
                    '04', '05', '06',
                    '07', '08', '09',
                    '10', '11', '12',
                ],
                'year': [
                    '2007', '2008', '2009',
                    '2010', '2011', '2013',
                    '2014', '2015', '2016',
                ],
                'pressure_level': '1000',
            }
        )
  2. Thank you for pointing that out Vivien! I had not noticed that