GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
224 stars 105 forks source link

Double Zernikes #1221

Closed jmeyers314 closed 1 year ago

jmeyers314 commented 1 year ago

Adds support for Double Zernikes, which are Cartesian products of single Zernikes. These are useful for modeling, e.g., the combined field and pupil dependence of an optical wavefront. I added most of the functionality currently available for single Zernikes to the DZs, which is enough that one can quickly analytically produce a map of optical PSF second moments across the field-of-view from DZ coefficients. (see the new test_dz_to_T unit test).

Along the way, I also:

jmeyers314 commented 1 year ago

Hmm... Looks like I have a Heisenbug here. I was getting failures in identically evaluating DoubleZernikes before/after pickling here, but after adding some additional tests here (you might need to expand the test_zernike.py tab to see where I'm pointing), the originally failing do_pickle line is now passing. Best guess: something is slightly inconsistent in Horner2d (at ~1e-15 level) depending on whether SSE2 is used or not (which depends on memory alignment)?

jmeyers314 commented 1 year ago

I assume we can use this class in Piff in the Optical model to handle some of the bookkeeping more easily

Certainly this could be useful for bookkeeping. I'm not sure if the analytic size and ellipticity predictions will be useful or not; they technically depend on a full pupil annulus (no vignetting). It's possible they're still good approximations or heuristics though even when there is a small bit of vignetting.