imSim icon indicating copy to clipboard operation
imSim copied to clipboard

Calculate centers

Open esheldon opened this issue 1 year ago • 7 comments

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 avatar Apr 11 '24 16:04 esheldon

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 avatar Apr 11 '24 17:04 esheldon

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

esheldon avatar Apr 11 '24 18:04 esheldon

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.)

rmjarvis avatar Apr 11 '24 19:04 rmjarvis

The recent commits make it optional

esheldon avatar Apr 11 '24 21:04 esheldon

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 avatar Apr 12 '24 14:04 esheldon

I think this is ready for review.

esheldon avatar Apr 12 '24 17:04 esheldon

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.

esheldon avatar Jun 10 '24 13:06 esheldon