From 6d98e1a7bab502c0d468b59a42315755e3b06283 Mon Sep 17 00:00:00 2001 From: lbdreyer Date: Thu, 29 Aug 2019 13:43:05 +0100 Subject: [PATCH] Fix naming of cubes from abf/abl files --- .../bugfix_2019-Aug-29_abf_abl_cube_names.txt | 1 + lib/iris/fileformats/abf.py | 6 +++--- lib/iris/tests/results/abf/load.cml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 docs/iris/src/whatsnew/contributions_2.3.0/bugfix_2019-Aug-29_abf_abl_cube_names.txt diff --git a/docs/iris/src/whatsnew/contributions_2.3.0/bugfix_2019-Aug-29_abf_abl_cube_names.txt b/docs/iris/src/whatsnew/contributions_2.3.0/bugfix_2019-Aug-29_abf_abl_cube_names.txt new file mode 100644 index 0000000000..e324f625d2 --- /dev/null +++ b/docs/iris/src/whatsnew/contributions_2.3.0/bugfix_2019-Aug-29_abf_abl_cube_names.txt @@ -0,0 +1 @@ +* The name of cubes loaded from abf/abl files has been corrected. diff --git a/lib/iris/fileformats/abf.py b/lib/iris/fileformats/abf.py index 061c65aa6a..17524717ff 100644 --- a/lib/iris/fileformats/abf.py +++ b/lib/iris/fileformats/abf.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2012 - 2015, Met Office +# (C) British Crown Copyright 2012 - 2019, Met Office # # This file is part of Iris. # @@ -118,9 +118,9 @@ def to_cube(self): # Name. if self.format.lower() == "abf": - cube.rename("leaf_area_index") - elif self.format.lower() == "abl": cube.rename("FAPAR") + elif self.format.lower() == "abl": + cube.rename("leaf_area_index") else: msg = "Unknown ABF/ABL format: {}".format(self.format) raise iris.exceptions.TranslationError(msg) diff --git a/lib/iris/tests/results/abf/load.cml b/lib/iris/tests/results/abf/load.cml index 25be488650..e470cbebf3 100644 --- a/lib/iris/tests/results/abf/load.cml +++ b/lib/iris/tests/results/abf/load.cml @@ -1,6 +1,6 @@ - +