Skip to content

Commit 8d74210

Browse files
author
Mark Wieczorek
committed
update last commit
1 parent 2f54ada commit 8d74210

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pyshtools/shclasses/shcoeffs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ def expand(self, grid='DH2', lat=None, colat=None, lon=None, degrees=True,
23512351
if lmax is None:
23522352
lmax = self.lmax
23532353
if lmax_calc is None:
2354-
lmax_calc = self.lmax
2354+
lmax_calc = min(self.lmax, lmax)
23552355
if backend is None:
23562356
backend = preferred_backend()
23572357
if name is None:
@@ -2432,7 +2432,7 @@ def gradient(self, grid='DH2', lmax=None, lmax_calc=None, units=None,
24322432
if lmax is None:
24332433
lmax = self.lmax
24342434
if lmax_calc is None:
2435-
lmax_calc = self.lmax
2435+
lmax_calc = min(self.lmax, lmax)
24362436
if backend is None:
24372437
backend = preferred_backend()
24382438
if name is None:

pyshtools/shclasses/shgravcoeffs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,7 +2534,7 @@ def expand(self, a=None, f=None, r=None, colat=None, lat=None, lon=None,
25342534
if lmax is None:
25352535
lmax = self.lmax
25362536
if lmax_calc is None:
2537-
lmax_calc = self.lmax
2537+
lmax_calc = min(self.lmax, lmax)
25382538
if name is None:
25392539
name = self.name
25402540

@@ -2647,7 +2647,7 @@ class instance. The components are
26472647
if lmax is None:
26482648
lmax = self.lmax
26492649
if lmax_calc is None:
2650-
lmax_calc = self.lmax
2650+
lmax_calc = min(self.lmax, lmax)
26512651
if name is None:
26522652
name = self.name
26532653

@@ -2741,7 +2741,7 @@ class instance.
27412741
if lmax is None:
27422742
lmax = self.lmax
27432743
if lmax_calc is None:
2744-
lmax_calc = self.lmax
2744+
lmax_calc = min(self.lmax, lmax)
27452745
if name is None:
27462746
name = self.name
27472747

pyshtools/shclasses/shmagcoeffs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,7 @@ def expand(self, a=None, f=None, r=None, lat=None, colat=None, lon=None,
20412041
if lmax is None:
20422042
lmax = self.lmax
20432043
if lmax_calc is None:
2044-
lmax_calc = self.lmax
2044+
lmax_calc = min(self.lmax, lmax)
20452045
if name is None:
20462046
name = self.name
20472047

@@ -2150,7 +2150,7 @@ class instance. The components are
21502150
if lmax is None:
21512151
lmax = self.lmax
21522152
if lmax_calc is None:
2153-
lmax_calc = self.lmax
2153+
lmax_calc = min(self.lmax, lmax)
21542154
if name is None:
21552155
name = self.name
21562156

0 commit comments

Comments
 (0)