Skip to content

Commit

Permalink
var_name in AuxCoord created by trajectory.interpolate() (#3718)
Browse files Browse the repository at this point in the history
* var_name in AuxCoord created by trajectory.interpolate()

* Updated tri_polar_latitude_slice.cml

* What's New for #3718
  • Loading branch information
SimonPeatman authored Sep 12, 2020
1 parent b04a3ca commit a338ca5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/iris/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ Incompatible Changes
Prior to Iris ``3.0.0``, these cases defaulted to ``units='1'``.
See :pull:`3795`.

* `Simon Peatman <https://github.com/SimonPeatman>`_ 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
========
Expand Down
1 change: 1 addition & 0 deletions lib/iris/analysis/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</coord>
<coord datadims="[2]">
<auxCoord id="11ca7825" long_name="Latitude" points="[-78.1906, -78.1906, -78.1906, ..., 83.8392,
86.2794, 87.9471]" shape="(90,)" standard_name="latitude" units="Unit('degrees')" value_type="float32">
86.2794, 87.9471]" shape="(90,)" standard_name="latitude" units="Unit('degrees')" value_type="float32" var_name="nav_lat">
<attributes>
<attribute name="nav_model" value="Default grid"/>
<attribute name="valid_max" value="89.6139"/>
Expand All @@ -87,7 +87,7 @@
</coord>
<coord datadims="[2]">
<auxCoord id="ee0adb2e" long_name="Longitude" points="[-84.0002, -90.0001, -90.0001, ..., -86.9366,
-88.8945, -100.0]" shape="(90,)" standard_name="longitude" units="Unit('degrees')" value_type="float32">
-88.8945, -100.0]" shape="(90,)" standard_name="longitude" units="Unit('degrees')" value_type="float32" var_name="nav_lon">
<attributes>
<attribute name="nav_model" value="Default grid"/>
<attribute name="valid_max" value="180.0"/>
Expand Down

0 comments on commit a338ca5

Please sign in to comment.