imSim icon indicating copy to clipboard operation
imSim copied to clipboard

Add a "layering" mode to allow users to add objects to already simulated fields.

Open cwwalter opened this issue 8 years ago • 5 comments

Recently @kadrlica did some dark matter work where he and others simulated a ultra-diffuse galaxy on a pre-existing field by generating the sources he needed with no sky or instrumental background and adding the resulting images to the background image.

With the recent checkpointing code added by @jchiang87 it is always now possible to start accumulating photons on an existing exposure.

As an enhancement, it might be nice in the future to add an official "layering" mode where the user could specify an existing image which already included the sky and other sources and an instance catalog of new sources to simulate.

This way people could take (for example) a subset of imSim DC2 images and then layer/add whatever sorts of sources they wanted to them for specialized studies as Alex did above. This could even be used for small manual sprinkler type studies where a (e.g.) time varying SN was added to a host galaxy in an image. The same base image could be used for each exposure and it would be very fast to add the magnitude varying SN to each one.

cwwalter avatar Apr 21 '18 13:04 cwwalter

Seems like a cool idea. The way that I did it was just to use the top level instCat specifications for the telescope pointing, orientation, and other environmental factors, and then swap in my object list for the original imported object list. I was actually mixing phosim "background" with an imsim "front layer", which I guess has it's pluses and minuses. Unless there is something obviously wrong with this procedure, it seems easy enough that no further development is needed for my specific application.

kadrlica avatar Apr 22 '18 04:04 kadrlica

@jchiang87 Did the changes that allowed us to turn of the sky also allow the user to specify a preexisting image to draw on. I think 'no' but wanted to double check. (I know this is possible via manipulating checkpoints.)

cwwalter avatar Mar 09 '20 18:03 cwwalter

I wanted to ping this old issue to surface it.

This is something we effectively did do before in with the checkpoints to layer on transient objects. This has come up again in the context of both the Roman-Rubin simulations and implementing things like SSI.

Mike and I talked about this at the PCW and I he also mentioned he had a way he was interested in doing this.

cwwalter avatar Aug 15 '23 17:08 cwwalter

This will be easier in GalSim 2.5. I have a solution in progress. The gist is that we will be able to add an initial_image input item that reads in an existing image file and then add things to it.

rmjarvis avatar Aug 15 '23 19:08 rmjarvis

https://github.com/GalSim-developers/GalSim/pull/1237

rmjarvis avatar Aug 15 '23 20:08 rmjarvis