improver.utilities.save module¶
Module for saving netcdf cubes with desired attribute types.
-
improver.utilities.save.append_metadata_cube(cubelist, global_keys)[source]¶ - Create a metadata cube associated with statistical
- post-processing attributes of the input cube list.
Parameters: - cubelist (iris.cube.CubeList) – List of cubes to be saved
- global_keys (list) – List of attributes to be treated as global across cubes and within any netCDF files produced using these cubes.
Returns: iris.cube.Cubelist with appended metadata cube
-
improver.utilities.save.order_cell_methods(cube)[source]¶ Sorts the cell methods on a cube such that if there are multiple methods they are always written in a consistent order in the output cube. The input cube is modified.
Parameters: cube (iris.cube.Cube) – The cube on which the cell methods are to be sorted.
-
improver.utilities.save.save_netcdf(cubelist, filename)[source]¶ Save the input Cube or CubeList as a NetCDF file.
Uses the functionality provided by iris.fileformats.netcdf.save with local_keys to record non-global attributes as data attributes rather than global attributes.
Parameters: - cubelist (iris.cube.Cube or iris.cube.CubeList) – Cube or list of cubes to be saved
- filename (str) – Filename to save input cube(s)