GalSim-developers / GalSim

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

Move Silicon recalculation logic to python layer #1141

Closed rmjarvis closed 2 years ago

rmjarvis commented 2 years ago

This PR moves all the logic of when to do the pixel updates from the C++ accumulate function to the python layer function.

This should make it much simpler for us to adjust how this is done when we are accumulating over the whole image at once rather than just doing one object at a time. But so far I haven't changed any logic -- just made the appropriate hooks available in python.

cwwalter commented 2 years ago

Thanks. I hadn't looked closely at this part of GalSim before.

What is "effective" about recalc now? It looks like the strength was also still used with the old recalc. Is it because you now need to track ._accum_flux_since_update?

rmjarvis commented 2 years ago

What is "effective" about recalc now?

It was always effective, but before it was a temporary variable in that function. I named it self.effective_recalc to not clash with the original input self.recalc.

It's only relevant when ramping up the BFE strength. Normally the two values are identical. But if the strength is high, you need to lower recalc to do the recalculations at the right points still. That's the "effective" meaning here.