v1.10 (05 Sep 2016)¶
This document explains the changes made to Iris for this release (View all changes.)
Features¶
Support has now been added for the iris_grib package, which provides GRIB format support in an optional package, separate from Iris.
If
iris_gribis available, it will always be used in place of the older iris moduleiris.fileformats.grib.The capabilities of
iris_gribare essentially the same as the existingiris.fileformats.gribwhen used withiris.FUTURE.strict_grib_load=True, with only small detail differences.The old
iris.fileformats.gribmodule is now deprecated and may shortly be removed.If you are already using the recommended
iris.FUTUREsettingiris.FUTURE.strict_grib_load=Truethis should not cause problems, as the new package is all-but identical.However, the option
iris.FUTURE.strict_grib_loadis itself now deprecated, so you should remove code that sets it.
If, however, your code is still using the older “non-strict” grib loading, then you may need to make code changes.
In particular, the
fieldobject passed to load callbacks is different. Seeiris.fileformats.grib.message.GribMessage(theiris_grib.message.GribMessageclass is the same as this, for now).
Please exercise your code with the new iris_grib module, and let us know of any problems you uncover, such as files that will no longer load with the new implementation.
iris.experimental.regrid.PointInCell.regridder()now works across coordinate systems, including non latlon systems. Additionally, the requirement that the source data X and Y coordinates be 2D has been removed. NB: some aspects of this change are backwards incompatible.Plotting non-Gregorian calendars is now supported. This adds nc_time_axis as a dependency.
Promoting a scalar coordinate to a dimension coordinate with
iris.util.new_axis()no longer loads deferred data.The parsing functionality for Cell Methods from netCDF files is available as part of the
iris.fileformats.netcdfmodule asiris.fileformats.netcdf.parse_cell_methods().Support for the NameIII Version 2 file format has been added.
Loading netcdf data in Mercator and Stereographic projections now accepts optional extra projection parameter attributes (
false_easting,false_northingandscale_factor_at_projection_origin), if they match the default values.NetCDF files which define a Mercator projection where the
false_easting,false_northingandscale_factor_at_projection_originmatch the defaults will have the projection loaded correctly. Otherwise, a warning will be issued for each parameter that does not match the default and the projection will not be loaded.NetCDF files which define a Steroegraphic projection where the
scale_factor_at_projection_originis equal to 1.0 will have the projection loaded correctly. Otherwise, a warning will be issued and the projection will not be loaded.
The
iris.plotroutinescontour(),contourf(),outline(),pcolor(),pcolormesh()andpoints()now support plotting cubes with anonymous dimensions by specifying the numeric index of the anonymous dimension within thecoordskeyword argument.Note that the axis of the anonymous dimension will be plotted in index space.
NetCDF loading and saving now supports Cubes that use the LambertConformal coordinate system.
The experimental structured Fieldsfile loader
load()has been extended to also load structured PP files.Structured loading is a streamlined operation, offering the benefit of a significantly faster loading alternative to the more generic
iris.load()mechanism.Note that structured loading is not an optimised wholesale replacement of
iris.load(). Structured loading is restricted to input containing contiguously ordered fields for each phenomenon that repeat regularly over the same vertical levels and times. For further details, seeload()iris.experimental.regrid_conservativeis now compatible with ESMPy v7.Saving zonal (i.e. longitudinal) means to PP files now sets the ’64s’ bit in LBPROC.
Loading of ‘little-endian’ PP files is now supported.
All appropriate
iris.plotfunctions now handle anaxeskeyword, allowing use of the object oriented matplotlib interface rather than pyplot.The ability to pass file format object lists into the rules based load pipeline, as used for GRIB, Fields Files and PP has been added. The
iris.fileformats.pp.load_pairs_from_fields()andiris.fileformats.grib.load_pairs_from_fields()are provided to produce cubes from such lists. These lists may have been filtered or altered using the appropriateiris.fileformatsmodules.Cubes can now have an ‘hour’ coordinate added with
iris.coord_categorisation.add_hour().Time coordinates from PP fields with an lbcode of the form 3xx23 are now correctly encoded with a 360-day calendar.
The loading from and saving to netCDF of CF cell_measure variables is supported, along with their representation within a Cube as
cell_measures.Cubes with anonymous dimensions can now be concatenated. This can only occur along a dimension that is not anonymous.
NetCDF saving of
valid_range,valid_minandvalid_maxcube attributes is now allowed.
Bugs Fixed¶
Altered Cell Methods to display coordinate’s standard_name rather than var_name where appropriate to avoid human confusion.
Saving multiple cubes with netCDF4 protected attributes should now work as expected.
Concatenating cubes with singleton dimensions (dimensions of size one) now works properly.
Fixed the
grid_mapping_nameandsecant_latitudeshandling for the LambertConformal coordinate system.Fixed bug in
iris.analysis.cartography.project()where the output projection coordinates didn’t have units.Attempting to use
iris.sample_data_path()to access a file that isn’t actually Iris sample data now raises a more descriptive error. A note about the appropriate use of sample_data_path has also been added to the documentation.Fixed a bug where regridding or interpolation with the
Nearestscheme returned floating-point results even when the source data was integer typed. It now always returns the same type as the source data.Fixed a bug where regridding circular data would ignore any source masking. This affected any regridding using the
LinearandNearestschemes, and alsoiris.analysis.interpolate.linear().The
coord_nameparameter toscalar_cell_method()is now checked correctly.LBPROC is set correctly when a cube containing the minimum of a variable is saved to a PP file. The IA component of LBTIM is set correctly when saving maximum or minimum values.
The performance of
iris.cube.Cube.extract()when a list of values is given to an instance ofiris.Constrainthas been improved considerably.Fixed a bug with
iris.cube.Cube.data()where annumpy.ndarraywas not being returned for scalar cubes with lazy data.When saving in netcdf format, the units of ‘latitude’ and ‘longitude’ coordinates specified in ‘degrees’ are saved as ‘degrees_north’ and ‘degrees_east’ respectively, as defined in the CF conventions for netCDF files: sections 4.1 and 4.2.
Fixed a bug with a class of pp files with lbyr == 0, where the date would cause errors when converting to a datetime object (e.g. when printing a cube).
When processing a pp field with lbtim = 2x, lbyr == lbyrd == 0 and lbmon == lbmond, ‘month’ and ‘month_number’ coordinates are created instead of ‘time’.
Fixed a bug in
curl()where the sign of the r-component for spherical coordinates was opposite to what was expected.A bug that prevented cube printing in some cases has been fixed.
Fixed a bug where a deepcopy of a
DimCoordwould have writeablepointsandboundsarrays. These arrays can now no longer be modified in-place.Concatenation no longer occurs when the auxiliary coordinates of the cubes do not match. This check is not applied to AuxCoords that span the dimension the concatenation is occurring along. This behaviour can be switched off by setting the
check_aux_coordskwarg iniris.cube.CubeList.concatenate()to False.Fixed a bug in
iris.cube.Cube.subset()where an exception would be thrown while trying to subset over a non-dimensional scalar coordinate.
Incompatible Changes¶
The source and target for
iris.experimental.regrid.PointInCell.regridder()must now have defined coordinate systems (i.e. notNone). Additionally, the source data X and Y coordinates must have the same cube dimensions.
Deprecations¶
Deprecated the
iris.Futureoptioniris.FUTURE.strict_grib_load. This only affected the moduleiris.fileformats.grib, which is itself now deprecated. Please see iris_grib package, above.Deprecated the module
iris.fileformats.grib. The new package iris_grib replaces this functionality, which will shortly be removed. Please see iris_grib package, above.The use of
iris.config.SAMPLE_DATA_DIRhas been deprecated and replaced by the now importable iris_sample_data package.Deprecated the module
iris.analysis.interpolate. This contains the following public items, all of which are now deprecated and will be removed in a future release:linear()regrid()regrid_to_max_resolution()nearest_neighbour_indices()nearest_neighbour_data_value()extract_nearest_neighbour()class
Linear1dExtrapolator.
Please use the replacement facilities individually noted in the module documentation for
iris.analysis.interpolateThe method
iris.cube.Cube.regridded()has been deprecated. Please useiris.cube.Cube.regrid()instead (seeregridded()for details).Deprecated
iris.fileformats.grib.hindcast_workaroundandiris.fileformats.grib.GribWrapper. The classiris.fileformats.grib.message.GribMessageprovides alternative means of working with GRIB message instances.Deprecated the module
iris.fileformats.ff. Please use the replacement facilities in moduleiris.fileformats.um:iris.fileformats.um.um_to_pp()replacesiris.fileformats.ff.FF2PP.iris.fileformats.um.load_cubes()replacesiris.fileformats.ff.load_cubes().iris.fileformats.um.load_cubes_32bit_ieee()replacesiris.fileformats.ff.load_cubes_32bit_ieee().
All other public components are generally deprecated and will be removed in a future release.
The
iris.fileformats.pp.as_pairs()andiris.fileformats.grib.as_pairs()are deprecated. These are replaced withiris.fileformats.pp.save_pairs_from_cube()andiris.fileformats.grib.save_pairs_from_cube().iris.fileformats.pp_packinghas been deprecated. Please install the separate mo_pack package instead. This provides the same functionality.Deprecated logging functions (currently used only for rules logging):
iris.config.iris.config.RULE_LOG_DIR,iris.config.iris.config.RULE_LOG_IGNOREandiris.fileformats.rules.log.Deprecated all the remaining text rules mechanisms:
iris.fileformats.rules.DebugString,iris.fileformats.rules.CMAttribute,iris.fileformats.rules.CMCustomAttribute,iris.fileformats.rules.CoordAndDims,iris.fileformats.rules.Rule,iris.fileformats.rules.FunctionRule,iris.fileformats.rules.ProcedureRule,iris.fileformats.rules.RulesContainerandiris.fileformats.rules.calculate_forecast_period().Deprecated the custom pp save rules mechanism implemented by the functions
iris.fileformats.pp.add_save_rules()andiris.fileformats.pp.reset_save_rules(). The functionsiris.fileformats.pp.as_fields(),iris.fileformats.pp.as_pairs()andiris.fileformats.pp.save_fields()provide alternative means of achieving the same ends.
Documentation¶
It is now clear that repeated values will form a group under
iris.cube.Cube.aggregated_by()even if they aren’t consecutive. Hence, the documentation foriris.cubehas been changed to reflect this.The documentation for
iris.analysis.calculus.curl()has been updated for clarity.False claims about
iris.fileformats.pp.save(),iris.fileformats.pp.as_pairs(), andiris.fileformats.pp.as_fields()being able to take instances ofiris.cube.CubeListas inputs have been removed.A new code example Plotting Wind Direction Using Quiver, demonstrating the use of a quiver plot to display wind speeds over Lake Victoria, has been added.
The docstring for
iris.analysis.SUMhas been updated to explicitly state that weights passed to it aren’t normalised internally.A note regarding the impossibility of partially collapsing multi-dimensional coordinates has been added to the user guide.