PhoSim Tutorial 22: How to Use Custom Truth Images and Match its Intensity and Scale
Previously Tutorial 16 demonstrated how to use a custom truth image as an arbitrary input. There the scale (WCS) as well as the intensity (magnitude) was specified by the user. This is very useful when using an image just as an example of an object that could occur in the Universe. Then the user can scale it in size and intensity, and even use the same truth image many times in a large field.
However, there is also a common situation where you actually want to simulate the truth image as observed, and simulate it through a new telescope system. There the intensity and scale is not arbitrary, and you might want to have PhoSim match the observed size and intensity exactly. This can be modified by hand using the interfaces described in Tutorial 16, but the calculation is complex so there is a script that can do this for you.
In this example, we use green filter image of Antennae Galaxies again. We then use the script with the following command:
python tools/make_catalog.py green.fits 60
This script takes the input image makes a new catalog. The new catalog will have an exposure time of 60 seconds in this case. It will calculate the target intensity by using the exposure time in the image and the zeropoint that is defined in the header. The script makes a new image in an input image in data/images/temp.fits. The script also makes a new catalog in /examples/temp.txt. Inspecting this file you will find the line:
object 0 180.471657 -18.882025 16.649 ../sky/sed_flat.txt 0 0 0 0 0 0 temp.fits -1 0 none none
Here it has calculated the target magnitude of 16.69 and note that the scale is -1, which instructs PhoSim to automatically search and match WCS if it is available in header. You can then run this catalog with the command:
./phosim examples/temp.txt -c examples/nobackground
The output image is: