Skip to content

Commit 2bf8cc1

Browse files
committed
fix: allow trimming beyond mid point
1 parent 4c5a810 commit 2bf8cc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/e3sm_quickview/plugins/eam_projection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,19 +482,19 @@ def __init__(self):
482482
self._cached_output = None
483483

484484
def SetTrimLongitude(self, left, right):
485-
if left < 0 or left > 180 or right < 0 or right > 180:
485+
if left < 0 or left > 360 or right < 0 or right > 360 or left > (360 - right):
486486
print_error(
487-
f"SetTrimLongitude called with parameters outside [0, 180]: {left=}, {right=}"
487+
f"SetTrimLongitude called with invalid parameters: {left=}, {right=}"
488488
)
489489
return
490490
if self.trim_lon[0] != left or self.trim_lon[1] != right:
491491
self.trim_lon = [left, right]
492492
self.Modified()
493493

494494
def SetTrimLatitude(self, left, right):
495-
if left < 0 or left > 90 or right < 0 or right > 90:
495+
if left < 0 or left > 180 or right < 0 or right > 180 or left > (180 - right):
496496
print_error(
497-
f"SetTrimLatitude called with parameters outside [0, 180]: {left=}, {right=}"
497+
f"SetTrimLatitude called with invalid parameters: {left=}, {right=}"
498498
)
499499
return
500500
if self.trim_lat[0] != left or self.trim_lat[1] != right:

0 commit comments

Comments
 (0)