There was a hypothesis about a reason for some inefficiency in the current 2.1i run that some code in maybeSwitchPSF was inefficiency. I'm pretty sure this was a red herring, since the function only got called a handful of times (only when the flux was > 1.e6).
But since I had already started coding it up, I figured I'd go ahead an make a PR for it.
The two salient changes are:
Grab the Aperture from the geometric screen rather than make a new one when building the OpticalPSF, so it doesn't have to recalculate the pupil plane image.
Add an additional early exit that just checks the Kolmogorov max sb, since that should always be very quick to calculate. And if that peak is < thresh, then there is no point continuing on to put the object back together and check the full thing.
There was a hypothesis about a reason for some inefficiency in the current 2.1i run that some code in
maybeSwitchPSF
was inefficiency. I'm pretty sure this was a red herring, since the function only got called a handful of times (only when the flux was > 1.e6).But since I had already started coding it up, I figured I'd go ahead an make a PR for it.
The two salient changes are:
OpticalPSF
, so it doesn't have to recalculate the pupil plane image.