We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a76f7af commit 98ef6a6Copy full SHA for 98ef6a6
1 file changed
galsim/zernike.py
@@ -421,14 +421,15 @@ def describe_zernike(j):
421
first = True
422
out = "sqrt({}) * (".format(var)
423
424
+ # i, k indicate powers of x and y, respectively.
425
for (i, k), val in np.ndenumerate(arr):
426
if val != 0:
427
if not first:
428
out += " + "
429
first = False
430
ival = int(np.round(val))
- if ival != 1:
431
- out += str(int(np.round(val)))
+ if ival != 1 or (i == 0 and k == 0):
432
+ out += str(ival)
433
if i >= 1:
434
out += "x"
435
if i >= 2:
@@ -442,8 +443,6 @@ def describe_zernike(j):
442
443
out = out.replace("(-1x", "(-x")
444
out = out.replace("(-1y", "(-y")
445
out = out.replace("+ -", "- ")
- if out == "sqrt(1) * ()":
446
- out = "sqrt(1) * (1)"
447
return out
448
449
0 commit comments