LSSTDESC / imSim

GalSim based Rubin Observatory image simulation package
https://lsstdesc.org/imSim
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

Calculate centers #461

Open esheldon opened 7 months ago

esheldon commented 7 months ago

This adds code to calculate centers from shot photons

These positions will be accurate in all cases, whereas the current available x, y are from converting ra, dec to x, y using the batoid wcs. That wcs does not include all physics (e.g. DCR) making the WCS inaccurate in some cases.

Currently this is "always on" and uses a fixed number of photons.

I need help to understand how to make this configurable within the galsim config system, as imsim interfaces with it.

esheldon commented 7 months ago

The tests such as test_lsst_silicon_builder_passes_correct_photon_ops_to_drawImage don't actually result in any flux in the image, so the code is currently failing. Was no flux drawn the intention?

esheldon commented 7 months ago

Anyone know how to make the tests draw a non zero flux?

rmjarvis commented 7 months ago

Rather than change what that test does, probably better to make this centroid calculation optional, which we need to do anyway. We definitely don't want it turned on by default, since it's much too slow for objects that have very few photons. (Which are the vast majority of objects in typical use cases.)

esheldon commented 7 months ago

The recent commits make it optional

esheldon commented 7 months ago

I can't make any progress on this PR until I can get the tests to actually produce photons. Currently the tests as set up produce zero flux drawn in the stamp but I don't understand why. Does anyone know how to modify the test to produce flux?

esheldon commented 7 months ago

I think this is ready for review.

esheldon commented 5 months ago

I have my own issues with this PR, mainly that it is calculating a centroid for every object which is not necessary.

For images with a lot of galaxies this slows down the code significantly.

We only need a subset of the objects, say a random 100 or 200, with which to fit a WCS and validate it.