Hi
For memory reasons, I am slicing a cube, performing a few operations, then trying to save with append =True. The slices are along pressure levels, so when I slice, pressure is still showing as a Dim Coord.
>>> pressure_cube =(u.slices(['time', 'grid_latitude', 'grid_longitude'])).next()
>>> pressure_cube.coord('pressure')
DimCoord(array([ 100.], dtype=float32), standard_name=None, units=Unit('hPa'), long_name='pressure')
But also as a scalar coordinate.
>>> pressure_cube
<iris 'Cube' of eastward_wind / (m s-1) (forecast_reference_time: 84; forecast_period: 6; grid_latitude: 199; grid_longitude: 200)>
>>> print pressure_cube
eastward_wind / (m s-1) (forecast_reference_time: 84; forecast_period: 6; grid_latitude: 199; grid_longitude: 200)
Dimension coordinates:
forecast_reference_time x - - -
forecast_period - x - -
grid_latitude - - x -
grid_longitude - - - x
Auxiliary coordinates:
time x x - -
Scalar coordinates:
pressure: 100.0 hPa
Attributes:
STASH: m01s30i201
source: Data from Met Office Unified Model 8.02
When I try to save with 'append =True' at the end of each loop, the pressure coord is not being recognised and all are saved at the same pressure.
Below is an example of what the cubes look like before saving.
print D_save
iris.save(D_save, '%s%s/%s/divergence.pp' % (pp_file_path, expmin1, experiment_id), append=True)
unknown / (unknown) (time: 477; latitude: 219; longitude: 169)
Dimension coordinates:
time x - -
latitude - x -
longitude - - x
Auxiliary coordinates:
forecast_period x - -
forecast_reference_time x - -
Scalar coordinates:
pressure: 100.0 hPa
Attributes:
history: unknown * array
DimCoord(array([ 100.], dtype=float32), standard_name=None, units=Unit('hPa'), long_name='pressure')
unknown / (unknown) (time: 477; latitude: 219; longitude: 169)
Dimension coordinates:
time x - -
latitude - x -
longitude - - x
Auxiliary coordinates:
forecast_period x - -
forecast_reference_time x - -
Scalar coordinates:
pressure: 150.0 hPa
Attributes:
history: unknown * array
DimCoord(array([ 150.], dtype=float32), standard_name=None, units=Unit('hPa'), long_name='pressure')
unknown / (unknown) (time: 477; latitude: 219; longitude: 169)
Dimension coordinates:
time x - -
latitude - x -
longitude - - x
Auxiliary coordinates:
forecast_period x - -
forecast_reference_time x - -
Scalar coordinates:
pressure: 200.0 hPa
Attributes:
history: unknown * array
DimCoord(array([ 200.], dtype=float32), standard_name=None, units=Unit('hPa'), long_name='pressure')
Thanks
Peter