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

Delay read of instcat until data is needed #466

Closed rmjarvis closed 3 months ago

rmjarvis commented 4 months ago

Address #464 take two.

I removed the approx_nobject keyword, and now implement getApproxNObjects() by just counting the lines in the instance catalog file. This will always be >= the number of objects in that file that fall on the image, so it works as a good approx value. And it's quite fast, so should address the original problem about reading the file twice taking a long time.

esheldon commented 4 months ago

Now the catalog is read once for a single CCD

However it is still reading it again for each CCD that is simulated.

rmjarvis commented 4 months ago

However it is still reading it again for each CCD that is simulated.

Yes, it selects the galaxies in the input catalog that will fall on (or near) the CCD, so that is required.