Converting Xarray DataArray to Iris Cube

637 views Asked by At

I have a netCDF file which I have loaded as an Xarray DataArray:

data = xr.open_dataset('radar_data.nc')

I want to pull out the 'CZ' variable (radar reflectivity) and convert this to an Iris cube:

Z    = data['CZ']
Z_ir = Z.to_iris()

However, when I try this, I get the following error:

ValueError: 'CZ' is not a valid standard_name

I'm not really familiar with the Iris module at all, so I'm not really sure how to interpret that. What's going on here?

For reference, here is an example of a file I am trying to open: https://drive.google.com/file/d/1rj7O-pDhlsgC8-ajG1nxEKXVxhWkFzZr/view?usp=sharing

1

There are 1 answers

0
hm8 On BEST ANSWER

Was able to solve my problem by doing:

Z.attrs['standard_name'] = 'equivalent_reflectivity_factor'