Thursday, December 24, 2009

Preparing the data

Since the spectrum information seems to be reasonably under control, it's time to move on to processing the actual data.  The exact steps involved in this change reasonably frequently, and despite the fact that we're on the 4th processing of the data already, it may still not be up-to-date.  The place to check this is the Chandra data analysis page, which notes that CIAO 4.2 and CALDB 4.2.0 (the Chandra data analysis package and calibration database, respectively) are now out, and there is a helpful link that tells us what has changed.  At the bottom of the page, this notes that there has been a change for HRC-I (Imaging) data, and that's what this is all about.  So, time to reprocess.

Fortunately, there are a number of 'threads' that explain how to do standard analysis tasks, and there's nothing more 'standard' than reprocessing to pick up the latest calibration.  In Chandra-speak, this is called creating a level 2 event file.  The steps involved are pretty straightforward if you're moderately familiar with Unix.  If not, it's best to become moderately familiar first, as it's going to take a while otherwise.   I tend to create a file called LOG that contains all the steps I did to reprocess the data, starting from a directory I normally call 'repro'.  Given the number of distractions life has, maintaining some personal standards is vital as it may be 3 months or longer between periods of time when I can work on a project.  By always using the same names and formats, I can more easily remember where I've gotten to.  In this case, my LOG file contains the following:

ln -s ../../secondary/hrcf07029_000N004_evt1.fits hrc_evt1.fits

dmkeypar hrc_evt1.fits RANGELEV echo+
#116
#
#  Curious -- not the 115 I would expect from
#
#  http://cxc.harvard.edu/ciao/threads/createL2/index.html#hrc

#  I suspect it's out of date.
#

ln -s ../../primary/pcadf256045785N003_asol1.fits pcad_asol1.fits
ln -s ../../secondary/hrcf07029_000N004_bpix1.fits hrc_bpix1.fits
ln -s ../../secondary/hrcf07029_000N004_std_flt1.fits hrc_std_flt1.fits

punlearn hrc_process_events
hrc_process_events infile=hrc_evt1.fits outfile=hrc_new_evt1.fits \
   badpixfile=hrc_bpix1.fits  acaofffile=pcad_asol1.fits \
   badfile=NONE instrume=hrc-i do_amp_sf_cor=yes


punlearn dmcopy
dmcopy "hrc_new_evt1.fits[status=xxxxxx00xxxx0xxx00000000x0000000]"  \
      hrc_flt_evt1.fits

punlearn dmcopy
dmcopy "hrc_flt_evt1.fits[EVENTS][@hrc_std_flt1.fits][cols -crsu,-crsv,-amp_sf,-av1,-av2,-av3,-au1,-au2,-au3,-raw,-sumamps]" \
      hrc_evt2.fits

You can compare these to the thread, and see how I've 'shortened' the instructions down to the bare minimum. 

No comments:

Post a Comment