-
I am pretty new to using NetCDF files. I am trying to write a routine to create multiple plots visualising the output from my simulations. After reading in the cubes I have the following format: filename = '/home/users/---------.nc'
cubelist = iris.load(filename)
cons = iris.Constraint(cube_func=lambda x: x.var_name == 'gpp_gb')
cube = cubelist.extract_cube(cons)
print (cube)
type(cube)
print (cube.shape)
print (cube.ndim)
first_timestep = cube[0,...]
print (first_timestep) output:
However when i try to map the data with:
I get the following error message:
I think it could be because my coordinate data is not in a format the iris package can understand as it is in the auxiliary fields when i print the cube. I think the code should work if I could put the latitude and longitude data into the dimension coordinates. Any help or ideas would be much appreciated. Thank you for considering the problem. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @maczik, thanks for getting in touch.
These lines can be simplified: cube = iris.load_cube('gpp_gb')
A dimension coordinate is identified as a NetCDF variable that has the same shape and name as a dimension. This doesn't look possible for longitude and latitude in this case, as your data appears to be one dimensional with 7247 individual geographic points. I don't know what the extra 1-long dimension might be. Are you able to run |
Beta Was this translation helpful? Give feedback.
-
These look like JULES output files. If they are, and you have access to the Met Office Science Repository Service, then you should be able to make use of this module: |
Beta Was this translation helpful? Give feedback.
-
Archiving "answered" Q+As |
Beta Was this translation helpful? Give feedback.
These look like JULES output files. If they are, and you have access to the Met Office Science Repository Service, then you should be able to make use of this module:
https://code.metoffice.gov.uk/trac/utils/browser/smstress_jpeg/trunk/jules.py