As mentioned above, cheese was originally a Perl script that did the repetitive setup for edetect_chain, and then take the output from that and uses region and make_mask to produce the source masks. Now, cheese is a FORTRAN program that does the same thing. This section steps through the commands that one would need to use if, for some reason, cheese cannot be run. Similarly, one may have a different method for finding point sources. In that case, so long as one can create a correctly formatted file like the emlliist.fits file, one can use it with SAS and ESAS.
edetect_chain can handle up to six bands per instrument, but the bands must be the same among the different instruments. For each band of each instrument one needs to extract the image. In the following example, we extract a soft image from MOS1.
expression='(PATTERN12)&&(FLAG == 0)&&
(PI in [350:1100])'
Many of these parameters are required so that the images from different bands and different instruments will align correctly for use in edetect_chain. Executing this for multiple bands of multiple instruments is tedious and best put into a script, like cheese.
Since edetect_chain requires the attitude history file, it must be created if it does not already exist. This can be done simply:
atthkgen atthkset=atthk.fits timestep=1
The setup for edetect_chain is quite long and, in recognition of fat fingers and tiny typos, should not be attempted directly on the command line. Here is a relatively simple example:
pimin='350 2500 350 2500 350 2500'
pimax='1100 5000 1100 5000 1100 5000'
ecflist='1.2 1.2 1.2 1.2 3.2 3.2'
There are other parameters that may need to be tweaked as well. Note also that there are a large number of files created by edetect_chain.
Users will generally want to examine the emllist.fits file to determine what cuts best remove point sources for the scientific program at hand. This process can be quite subjective! For each source there are multiple entries in the emllist.fits table, all of which have the same ID_CLUSTER value. There will be an entry for each band/instrument combination, as well as one entry that is a summary (ID_INST=0). The region routine allows one to filter the emllist.fits by the values in its columns to determine which sources are excluded or not. In general, one would want to set a limiting flux (FLUX) and a limiting probability (DET_ML). One might also want to set the condition that the same sources be excluded from all instruments. This latter condition suggests that the summary entry be used. However, if a source does not fall into the FOV of every instrument, the flux for the summary entry may be listed as NULL, meaning that it would not be considered a real source for any filtering that relies on the FLUX column. Thus, it is important to look at the data in the emllist.fits file carefully before running region.
The next step is to create region files to exclude or excise the point sources. This is also done on an instrument by instrument basis. Again using mos1S001 as our example:
&&(FLUX=1e8)&&(ID_INST == 1)
&&(DET_ML >= 15)&&(ID_BAND == 1)'
Here the filtering uses a plethora of conditions, mostly to demonstrate the variables most likely to be used. Remember that region should also be run in detector coordinates: outunit=detxy bkgregionset=mos1S001-bkregsdet.fits.
The final step is to run makemask as was shown in the example in the previous section.
Often, the users objection to the output from cheese lies in the way the emllist.fits file was filtered by region. It is generally more efficient to run cheese, modify the emllist.fits file, and then rerun the region and makemask steps than it is to run all the constituent steps of cheese.