Skip to content

Commit

Permalink
Removes differences in spatial.py w.r.t. reviewed version
Browse files Browse the repository at this point in the history
  • Loading branch information
MoseleyS committed Aug 23, 2024
1 parent 265b280 commit d47f206
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions improver/utilities/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from numpy import ndarray
from numpy.ma import MaskedArray
from scipy.ndimage.filters import maximum_filter
from scipy.stats import circmean

from improver import BasePlugin, PostProcessingPlugin
from improver.metadata.amend import update_diagnostic_name
Expand Down Expand Up @@ -529,7 +528,7 @@ def _update_metadata(diff_cube: Cube, coord_name: str, cube_name: str) -> None:
diff_cube.attributes["form_of_difference"] = "forward_difference"
diff_cube.rename("difference_of_" + cube_name)

def create_difference_cube(self,
def create_difference_cube(
self, cube: Cube, coord_name: str, diff_along_axis: ndarray
) -> Cube:
"""
Expand Down Expand Up @@ -558,18 +557,6 @@ def create_difference_cube(self,
"circular x-axis that do not use a geographic (i.e. latlon) coordinate system."
)
mean_points = (points[1:] + points[:-1]) / 2
if self._axis_wraps_around_meridian(axis, cube):
if type(axis.coord_system) != GeogCS:
warnings.warn(
"DifferenceBetweenAdjacentGridSquares does not fully support cubes with "
"circular x-axis that do not use a geographic (i.e. latlon) coordinate system. "
"Such cubes will be handled as if they were not circular, meaning that the "
"differences cube returned will have one fewer points along the specified axis"
"than the input cube."
)
else:
extra_mean_point = self._get_wrap_around_mean_point(points)
mean_points = np.hstack([mean_points, extra_mean_point])

# Copy cube metadata and coordinates into a new cube.
# Create a new coordinate for the coordinate along which the
Expand Down

0 comments on commit d47f206

Please sign in to comment.