Skip to content

Commit

Permalink
Merge pull request #312 from ecmwf/develop
Browse files Browse the repository at this point in the history
new version
  • Loading branch information
mathleur authored Jan 28, 2025
2 parents df210c1 + 535b11a commit 0ca8808
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ def __init__(self, base_axis, mapped_axes, resolution, md5_hash=None, local_area
raise NotImplementedError("Reduced lat-lon grid with first axis in decreasing order is not supported")

def first_axis_vals(self):
start_lat = 90
if self._resolution == 3601:
start_lat = 89.973092
resolution = 180 / (self._resolution - 1)
vals = [-90 + i * resolution for i in range(self._resolution)]
vals = [round(start_lat - i * resolution, 12) for i in range(self._resolution)]
return vals

def map_first_axis(self, lower, upper):
Expand Down Expand Up @@ -5084,8 +5087,11 @@ def lon_spacing(self):
def second_axis_vals(self, first_val):
first_idx = self._first_axis_vals.index(first_val[0])
Ny = self.lon_spacing()[first_idx]
second_spacing = 360 / Ny
return [i * second_spacing for i in range(Ny)]
if Ny != 0:
second_spacing = 360 / Ny
return [i * second_spacing for i in range(Ny)]
else:
raise ValueError("Requested latitude value is not within reduced latitude-longitude grid bounds")

def map_second_axis(self, first_val, lower, upper):
axis_lines = self.second_axis_vals(first_val)
Expand Down
2 changes: 1 addition & 1 deletion polytope_feature/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.23"
__version__ = "1.0.25"

0 comments on commit 0ca8808

Please sign in to comment.