diff --git a/docs/iris/src/whatsnew/latest.rst b/docs/iris/src/whatsnew/latest.rst index a994a994e9..559d2483c1 100644 --- a/docs/iris/src/whatsnew/latest.rst +++ b/docs/iris/src/whatsnew/latest.rst @@ -126,6 +126,11 @@ Incompatible Changes Prior to Iris ``3.0.0``, these cases defaulted to ``units='1'``. See :pull:`3795`. +* `Simon Peatman `_ added attribute + ``var_name`` to coordinates created by the + :func:`iris.analysis.trajectory.interpolate` function. This prevents + duplicate coordinate errors in certain circumstances. (:pull:`3718`). + Internal ======== diff --git a/lib/iris/analysis/trajectory.py b/lib/iris/analysis/trajectory.py index 3a1f71a98b..d699b1c416 100644 --- a/lib/iris/analysis/trajectory.py +++ b/lib/iris/analysis/trajectory.py @@ -297,6 +297,7 @@ def interpolate(cube, sample_points, method=None): points = np.array([coord.points.flatten()[0]] * trajectory_size) new_coord = iris.coords.AuxCoord( points, + var_name=coord.var_name, standard_name=coord.standard_name, long_name=coord.long_name, units=coord.units, diff --git a/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml b/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml index 2224d12028..701ca7beb7 100644 --- a/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml +++ b/lib/iris/tests/results/trajectory/tri_polar_latitude_slice.cml @@ -77,7 +77,7 @@ + 86.2794, 87.9471]" shape="(90,)" standard_name="latitude" units="Unit('degrees')" value_type="float32" var_name="nav_lat"> @@ -87,7 +87,7 @@ + -88.8945, -100.0]" shape="(90,)" standard_name="longitude" units="Unit('degrees')" value_type="float32" var_name="nav_lon">