Closed rmjarvis closed 4 years ago
Some comparisons between old and new. These are a magnitude 10 star drawn with a typical Roman noise level. The script that made these is in devel/test_roman_psfs.py.
Old (master branch):
New (this branch):
The four choices of folding_threshold and pupil_bin are what the corresponding high_accuracy and approximate_struts get converted into along with a deprecation warning. The lower left is the most accurate, and that looks quite good I think. In all cases, the new version is (usually much!) faster and looks better.
Note that the central pixel of this star has a value of more than 1.e8. And the flux near the box edges, even in the upper right case is <1000, so the relative accuracy is always better than 1.e-5, which is usually the level that we shoot for with these kinds of things. So the variation among these options is mostly a cosmetic issue for extremely bright things. The usual faint galaxies we mostly care about will be just fine with even the 8x8 binning and normal folding_threshold.
@rmandelb I'm still waiting on responses from project re filter throughputs. I'm still not positive which ones are the really official ones. I had thought to update those on this PR too, but if you have time to take a look at what's here, we can go ahead and finish this PR up and I'll make another one for the other cycle 8 updates that need to happen, once I figure out what the right values are.
Also, one update since I wrote the overview above: I updated the pupil plane images we had here with the new Cycle 8 ones from the project. They now have separate images for each SCA, so I use that. (We already had SCA as a parameter for the getPSF function, so I didn't need any API change to allow this.) They also don't have the weird 0.03 artifact, so I was able to remove that bit of code to fix that up.
@rmjarvis - I got eaten up by other things this week, and have a full-afternoon Zoom commitment Thurs+Fri. Realistically I can't do a deep dive into this until the weekend. Just wanted to let you know in case that affects your thinking about what to include in this versus punting. Sorry -
That's fine. I think this is a good set of work to review for now. There'll be more Roman prs this summer with other bits, but we should get this one merged I think.
Thanks Rachel! I reworked parts of the doc string to clear things up. And I took your other suggestions as well. Thanks for the review.
This PR fixes a number of problems with the Roman PSFs in GalSim noticed by @matroxel in his recent simulations of the Roman telescope.
The fixes implemented here are as follows:
obj.withGSParams(folding_threshold=2.e-3)
rather thanobj.withGSParams(galsim.GSParams(folding_threshold=2.e-3))
, which is almost equivalent. However, the latter syntax isn't always safe, since it loses any other non-default GSParams thatobj
might already have had set. The new syntax will preserve any non-default values that aren't explicitly overridden in the kwargs.ii_pad_factor
for PhaseScreenPSFs from 4 to 1.5. I realized when working on this that there was no point to setting it to 4. The whole reason for InterpolatedImage's pad_factor is to accurately render sheared interpolated images. PSFs are vv rarely sheared and not much if at all. So the analysis that led us to recommend pad_factor=4 for (galaxies using) InterpolatedImage doesn't apply. I think 1.0 would be fine, but I chose 1.5 in case there was some need for a little bit of padding.