Skip to content

Commit e2c4cca

Browse files
committed
allow ellipse kwarg to be any iterable of length 2
1 parent 775b992 commit e2c4cca

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pyxlma/coords.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ def __init__(self, subsat_lon=0.0, subsat_lat=0.0, sweep_axis='y',
228228
A string representing a known ellipse to pyproj, or a list of [a, b] (semi-major
229229
and semi-minor axes) of the ellipse. Default is 'WGS84'.
230230
"""
231-
if type(ellipse) == list and len(ellipse) == 2:
231+
if type(ellipse) == str:
232+
ellipse_args = {'ellps': ellipse}
233+
elif hasattr(ellipse, '__iter__') and len(ellipse) == 2:
232234
rf = semiaxes_to_invflattening(ellipse[0], ellipse[1])
233235
ellipse_args = {'a': ellipse[0], 'rf': rf}
234-
elif type(ellipse) == str:
235-
ellipse_args = {'ellps': ellipse}
236236
else:
237237
raise ValueError("Ellipse must be a string or list of [a, b].")
238238
self.ECEFxyz = proj4.Proj(proj='geocent', **ellipse_args)

0 commit comments

Comments
 (0)