Closed jmeyers314 closed 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)?
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.
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:
zernikeGradBases
similar to the existingzernikeBasis
that returns basis vectors for the x and y gradients of Zernike terms. (I implemented this previously directly in the Rubin wavefront estimation pipeline here, but it's nice to have an officially supported API in GalSim for this).