Skip to content

Commit 98ef6a6

Browse files
committed
Fix describe_zernike(11)
1 parent a76f7af commit 98ef6a6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

galsim/zernike.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,14 +421,15 @@ def describe_zernike(j):
421421
first = True
422422
out = "sqrt({}) * (".format(var)
423423

424+
# i, k indicate powers of x and y, respectively.
424425
for (i, k), val in np.ndenumerate(arr):
425426
if val != 0:
426427
if not first:
427428
out += " + "
428429
first = False
429430
ival = int(np.round(val))
430-
if ival != 1:
431-
out += str(int(np.round(val)))
431+
if ival != 1 or (i == 0 and k == 0):
432+
out += str(ival)
432433
if i >= 1:
433434
out += "x"
434435
if i >= 2:
@@ -442,8 +443,6 @@ def describe_zernike(j):
442443
out = out.replace("(-1x", "(-x")
443444
out = out.replace("(-1y", "(-y")
444445
out = out.replace("+ -", "- ")
445-
if out == "sqrt(1) * ()":
446-
out = "sqrt(1) * (1)"
447446
return out
448447

449448

0 commit comments

Comments
 (0)