Skip to content

netcdf loading gives error #3261

@mada0007

Description

@mada0007

so I have GPCC precipitation data that I am trying to load into iris cube using the following code

import iris
import iris.plot as iplt
import iris.quickplot as qplt

# Enable a future option, to ensure that the netcdf load works the same way
# as in future Iris versions.
iris.FUTURE.netcdf_promote = True

# Load some test data.
fname = '/Users/mada0007/Documents/correct_data/precipA'

theta = iris.load_cube(fname, 'precip')

and I get this error

/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/iris/__init__.py:237: IrisDeprecation: setting the 'Future' property 'netcdf_promote' is deprecated and will be removed in a future release. Please remove code that sets this property.
  warn_deprecated(msg.format(name))
Traceback (most recent call last):
  File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/iris/__init__.py", line 377, in load_cube
    cube = cubes.merge_cube()
  File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/iris/cube.py", line 374, in merge_cube
    raise ValueError("can't merge an empty CubeList")
ValueError: can't merge an empty CubeList
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 3267, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-587-a23925d25d89>", line 12, in <module>
    theta = iris.load_cube(fname, 'precip')
  File "/Users/mada0007/anaconda3/envs/RAWORK/lib/python3.6/site-packages/iris/__init__.py", line 381, in load_cube
    raise iris.exceptions.ConstraintMismatchError('no cubes found')
iris.exceptions.ConstraintMismatchError: no cubes found

Could there be a better way to do this, what am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleA stale issue/pull-request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions