Cheese with Multiple Overlapping Observations

This example shows how one can optimize point source detection for a set of observations that are almost entirely overlapping, such as three observations of the same target. It may not matter, but it is a good idea to run this from a window whose $SAS_CCF points to the CCF for the first observation.

# merge the attitude files for the three observations

merge set1=0820840301/analysis/atthk.fits set2=0820840401/analysis/atthk.fits outset=atthk_temp.fits 
  mergedifferentobs="yes"
merge set1=atthk_temp.fits set2=0820840501/analysis/atthk.fits outset=atthk.fits 
  mergedifferentobs="yes"
rm atthk_temp.fits

# Merge all of the mos1 event files

merge mergedifferentobs="yes" set1=0820840301/analysis/mos1S001-allevc.fits 
  set2=0820840401/analysis/mos1S001-allevc.fits outset=mos1_t1.fits
merge set1=mos1_t1.fits set2=0820840501/analysis/mos1S001-allevc.fits outset=mos1_event.fits
  mergedifferentobs="yes"
rm mos1_t?.fits

# merge all of the mos2 event files

merge mergedifferentobs="yes" set1=0820840301/analysis/mos2S002-allevc.fits
  set2=0820840401/analysis/mos2S002-allevc.fits outset=mos2_t1.fits mergedifferentobs="yes"
merge set1=mos2_t1.fits set2=0820840501/analysis/mos2U002-allevc.fits outset=mos2_event.fits
  mergedifferentobs="yes"
rm mos2_t?.fits

# merge all of the pn event files

merge set1=0820840301/analysis/pnS003-allevc.fits set2=0820840401/analysis/pnS003-allevc.fits
  outset=pn_t1.fits mergedifferentobs="yes"
merge set1=pn_t1.fits set2=0820840501/analysis/pnS003-allevc.fits outset=pn_event.fits
  mergedifferentobs="yes"
rm pn_t1.fits

# merge all of the pn oot event files

merge mergedifferentobs="yes" set1=0820840301/analysis/pnS003-allevcoot.fits 
  set2=0820840401/analysis/pnS003-allevcoot.fits outset=pn_t1.fits
merge set1=pn_t1.fits set2=0820840501/analysis/pnS003-allevcoot.fits outset=pn_oot_event.fits
  mergedifferentobs="yes"
rm pn_t1.fits

# now run cheese

cheese mos1file=mos1_event.fits mos2file=mos2_event.fits pnfile=pn_event.fits
  pnootfile=pn_oot_event.fits elowlist=350 ehighlist=1100 scale=0.5 mlmin=10 ratetotal=0.2 
  dist=50. keepinterfiles=no -V 7 >& cheese.log

# apply the results to the individual observations
# (A demonstration just for the first obsid)

  cp emllist_fixd_filt.fits 0820840301/analysis/emllist_joint.fits
  cd 0820840301/analysis

# building the region files and mask for MOS1

region eventset=${M1}-allevc.fits operationstyle=global srclisttab=emllist_joint.fits:SRCLIST 
  expression="(ID_INST == 2)&&(DET_ML >= 10)" bkgregionset=${M1}-bkgregtdet.fits
  energyfraction=0.4 radiusstyle=contour outunit=detxy verbosity=4
region eventset=${M1}-allevc.fits operationstyle=global srclisttab=emllist_joint.fits:SRCLIST
  expression="(ID_INST == 2)&&(DET_ML >= 10)" bkgregionset=${M1}-bkgregtsky.fits
  energyfraction=0.4 radiusstyle=contour outunit=xy verbosity=4
makemask imagefile=${M1}-fovimt.fits maskfile=${M1}-fovimtmask.fits regionfile=${M1}-bkgregtsky.fits
  cheesefile=${M1}-cheeset.fits

# building the region files and mask for MOS2

region eventset=${M2}-allevc.fits operationstyle=global srclisttab=emllist_joint.fits:SRCLIST 
  expression="(ID_INST == 3)&&(DET_ML >= 10)" bkgregionset=${M2}-bkgregtdet.fits
  energyfraction=0.4 radiusstyle=contour outunit=detxy verbosity=4
region eventset=${M2}-allevc.fits operationstyle=global srclisttab=emllist_joint.fits:SRCLIST 
  expression="(ID_INST == 3)&&(DET_ML >= 10)" bkgregionset=${M2}-bkgregtsky.fits
  energyfraction=0.4 radiusstyle=contour outunit=xy verbosity=4
makemask imagefile=${M2}-fovimt.fits maskfile=${M2}-fovimtmask.fits regionfile=${M2}-bkgregtsky.fits
  cheesefile=${M2}-cheeset.fits

# building the region files and mask for PN

region eventset=${PN}-allevc.fits operationstyle=global srclisttab=emllist_joint.fits:SRCLIST 
  expression="(ID_INST == 1)&&(DET_ML >= 10)" bkgregionset=${PN}-bkgregtdet.fits
  energyfraction=0.4 radiusstyle=contour outunit=detxy verbosity=4
region eventset=${PN}-allevc.fits operationstyle=global srclisttab=emllist_joint.fits:SRCLIST
  expression="(ID_INST == 1)&&(DET_ML >= 10)" bkgregionset=${PN}$-bkgregtsky.fits
  energyfraction=0.4 radiusstyle=contour outunit=xy verbosity=4
makemask imagefile=${PN}-fovimt.fits maskfile=pnS003-fovimtmask.fits 
  regionfile=${PN}-bkgregtsky.fits cheesefile=${PN}-cheeset.fits