This Jupyter notebook uses the bash_kernel
. Users will need to have this kernel installed before they can run the commadns in this notebook.
CIAO 4.11 users with pip3
can use the following commands to install bash_kernel
into their CIAO installtion:
pip3 install bash_kernel
python -m bash_kernel.install --sys-prefix
jupyter kernelspec list
after which they can then run
jupyter notebook
These exercises are designed to familiarize students with Chandra data and some of the basics of X-ray data analysis using CIAO with Chandra data.
Students will use a variety of tools and scripts to perform typical Chandra data analysis tasks. These exercises are not intended to be a Cookbook for all Chandra data analysis, but rather are meant to expose students to basic X-ray analysis techniques.
Students should already have CIAO installed on their systems. The exercises here have been developed with CIAO 4.11, using the CIAO-4.11.1 contributed scripts package, with Chandra CALDB 4.8.2. Students should also have MARX installed. These exercises have been developed using MARX 5.4.0. The install_marx script in CIAO can be used to automate the installation process.
ciaover
CIAO 4.11 Wednesday, December 5, 2018 bindir : /export/ciao-4.11/bin CALDB : 4.8.2
In this section students will obtain Chandra data and learn some techniques to inspect the quality of the data and how to reprocess their dataset.
Obtain the standard data distribution for Chandra OBS_ID 13858.
Q: How did you obtain the data (Chaser, download_chandra_obsid, FTP)?
/bin/rm -rf 13858
download_chandra_obsid 13858
Downloading files for ObsId 13858, total size is 68 Mb. Type Format Size 0........H.........1 Download Time Average Rate --------------------------------------------------------------------------- readme ascii 11 Kb #################### < 1 s 150.9 kb/s oif fits 23 Kb #################### < 1 s 996.8 kb/s vv pdf 35 Kb #################### < 1 s 315.6 kb/s cntr_img fits 77 Kb #################### < 1 s 2046.4 kb/s cntr_img jpg 371 Kb #################### < 1 s 10757.1 kb/s evt2 fits 5 Mb #################### < 1 s 22074.2 kb/s full_img fits 52 Kb #################### < 1 s 4736.1 kb/s full_img jpg 42 Kb #################### < 1 s 2490.1 kb/s bpix fits 11 Kb #################### < 1 s 723.2 kb/s fov fits 6 Kb #################### < 1 s 717.4 kb/s eph1 fits 308 Kb #################### < 1 s 3212.8 kb/s asol fits 4 Mb #################### < 1 s 5839.1 kb/s evt1 fits 22 Mb #################### 2 s 14225.9 kb/s flt fits 6 Kb #################### < 1 s 129.6 kb/s msk fits 5 Kb #################### < 1 s 36.8 kb/s mtl fits 640 Kb #################### < 1 s 9206.5 kb/s stat fits 360 Kb #################### < 1 s 5311.4 kb/s bias fits 493 Kb #################### < 1 s 3922.4 kb/s bias fits 450 Kb #################### < 1 s 6816.9 kb/s bias fits 422 Kb #################### < 1 s 6443.3 kb/s bias fits 436 Kb #################### < 1 s 6731.9 kb/s pbk fits 4 Kb #################### < 1 s 273.2 kb/s vv pdf 32 Mb #################### 2 s 19850.3 kb/s eph1 fits 8 Kb #################### < 1 s 331.9 kb/s eph1 fits 303 Kb #################### < 1 s 2374.5 kb/s eph1 fits 283 Kb #################### < 1 s 2758.3 kb/s osol fits 368 Kb #################### < 1 s 4895.8 kb/s aqual fits 250 Kb #################### < 1 s 4394.2 kb/s osol fits 358 Kb #################### < 1 s 4826.9 kb/s osol fits 129 Kb #################### < 1 s 2249.6 kb/s osol fits 368 Kb #################### < 1 s 3816.5 kb/s Total download size for ObsId 13858 = 68 Mb Total download time for ObsId 13858 = 6 s
Students may want to uncompress, gunzip, all of the files in the top-level directory, along with the primary and secondary directories at this point.
gunzip 13858/primary/*gz
gunzip 13858/secondary/*gz
download_obsid_caldb 13858 ./CALDB
download_obsid_caldb infile = 13858 outdir = ./CALDB background = no missing = no clobber = no verbose = 1 mode = ql Retrieving files for CALDB_VER = 4.8.2 Retrieving CALDB index files Processing infile=13858/primary/acisf13858N001_evt2.fits Retrieving CALDB data files Filename: 0------------------1 telD1999-07-23skyN0002.fits #################### telD1999-07-23aimptsN0002.fits #################### telD1999-07-23tdetN0001.fits #################### telD1999-07-23sgeomN0001.fits #################### telD1999-07-23geomN0006.fits #################### acisD2010-02-01qeuN0007.fits #################### hrmaD1996-12-20vignetN0003.fits #################### hrmaD1996-12-20axeffaN0008.fits #################### acisD2000-11-28badpixN0003.fits #################### acisD1999-08-13contamN0012.fits #################### acisD1997-04-17qeN0006.fits #################### acisD2000-01-29gain_ctiN0007.fits #################### acisD2010-01-01ctiN0008.fits #################### acisD2005-07-01evtspltN0002.fits #################### acisD2012-05-01t_gainN0006.fits #################### acisD1996-11-01gradeN0004.fits #################### acisD2000-01-29grdimgN0001.fits #################### acisD1999-07-22subpixN0001.fits #################### acisD2000-01-29fef_pha_ctiN0004.fits #################### acisD1999-09-16dead_areaN0001.fits #################### hrmaD1996-12-20reefN0001.fits #################### acisD2000-01-29p2_respN0007.fits #################### hrmaD1996-11-01wpsfN0001.fits #################### acisD2000-01-29osip_ctiN0006.fits #################### acisD2002-11-15gtilimN0003.fits #################### Be sure to setup the following environment variables to use these CALDB files. (t)csh: setenv CALDB /data/lenin2/Conf_and_Work/AAS2019/Workbook/CALDB setenv CALDBCONFIG /data/lenin2/Conf_and_Work/AAS2019/Workbook/CALDB/software/tools/caldb.config setenv CALDBALIAS none bash: export CALDB=/data/lenin2/Conf_and_Work/AAS2019/Workbook/CALDB export CALDBCONFIG=/data/lenin2/Conf_and_Work/AAS2019/Workbook/CALDB/software/tools/caldb.config export CALDBALIAS=none
export CALDB=`pwd`/CALDB
export CALDBCONFIG=`pwd`/CALDB/software/tools/caldb.config
export CALDBALIS=none
Read the Chandra Verification and Validation report in the top level directory of the data distribution: axaff13858N001_VV001_vv2.pdf
acroread 13858/axaff13858N001_VV001_vv2.pdf &
[1] 813
Q: Summarize the V&V comments: Joint Proposal: NRAO
Q: What is the target of this observation? SDSS J091449.05+085321.1
Q: What is the sequence number SEQ_NUM of this observation? 702584
echo
(acroread:813): Gtk-WARNING **: /usr/lib64/gtk-2.0/2.10.0/engines/libcrux-engine.so: wrong ELF class: ELFCLASS64 (acroread:813): Gtk-WARNING **: /usr/lib64/gtk-2.0/2.10.0/engines/libcrux-engine.so: wrong ELF class: ELFCLASS64 Gtk-Message: Failed to load module "canberra-gtk-module" (acroread:813): Pango-WARNING **: /export/ciao-4.11/ots/lib/pango/1.6.0/modules/pango-basic-fc.so: wrong ELF class: ELFCLASS64 [1]+ Done acroread 13858/axaff13858N001_VV001_vv2.pdf
Locate the event files. There are two event files included in the standard data distribution. The Level 1 event file, evt1, is in the secondary/ directory, the Level 2 event file, evt2, is in the primary/ directory.
/bin/ls -1 13858/*/*evt*.fits
13858/primary/acisf13858N001_evt2.fits 13858/secondary/acisf13858_000N001_evt1.fits
Display the Level 2 event file using ds9. Make sure to use Log scale.
ds9 13858/primary/acisf13858N001_evt2.fits -scale log &
[1] 961
Q: Using the cursor, record the coordinate of the bright source in the center of the image:
xpaset -p ds9 crosshair 4103 4115 physical
xpaset -p ds9 saveimage png ds9_01.png
display < ds9_01.png
xpaget ds9 crosshair wcs fk5 sexagesimal
xpaset -p ds9 mode region
9:14:49.1404 +8:53:20.741
By default, ds9 only shows part of the Chandra dataset. Use the Bin menu to bin the data by a factor of 4 and then by a factor of 8.
Binning is different than Zooming. Zooming is done to the image (so after the event file has been binned). Set bin=1, and then zoom to ⅛.
xpaset -p ds9 bin factor 4
xpaset -p ds9 saveimage png ds9_exercise04_a.png
display < ds9_exercise04_a.png
xpaset -p ds9 bin factor 8
xpaset -p ds9 saveimage png ds9_exercise04_b.png
display < ds9_exercise04_b.png
xpaset -p ds9 bin factor 1
xpaset -p ds9 zoom 0.125
xpaset -p ds9 saveimage png ds9_exercise04_c.png
display < ds9_exercise04_c.png
Q: Describe why the Bin 8 image is different than the image Zoom'ed by ⅛:
Zooming takes the default 1024x1024 image and samples every 8th row and column to create the display. Binning rebins the original event file with 8x8 pixels.*
ds9 bins all the events in the event file into an image. That includes all events for all time and with all energies.
Use the Bin → Binning Parameters menu to add an energy=500:7000 as a Bin Filter.
xpaset -p ds9 zoom to 1
xpaset -p ds9 bin filter 'energy=500:7000'
xpaset -p ds9 saveimage png ds9_exercise05_a.png
display < ds9_exercise05_a.png
Q: Describe the difference in the images compared to the unfiltered image: Less background noise, max pixel value is lower (see colorbar scale compared to above)
Q: What unit is energy in? eV
Try different energy ranges
xpaset -p ds9 bin filter 'energy=2000:10000'
xpaset -p ds9 saveimage png ds9_exercise05_extra1.png
display < ds9_exercise05_extra1.png
Try different time ranges
dmlist 13858/primary/acisf13858N001_evt2.fits header | grep TST
0047 TSTART 456518974.4871399999 [s] Real8 Observation start time (MET) 0059 TSTOP 456536836.1380900145 [s] Real8 Observation end time (MET) 0085 STARTBEP 301280942 Int4 BEP timer value at TSTART 0086 STOPBEP 1808980142 Int4 BEP timer value at TSTOP -- HISTORY PARM :tstart=TSTART ASC00210 -- HISTORY PARM :tstop=TSTOP ASC00211
xpaset -p ds9 bin filter 'time=456520000:456530000'
xpaset -p ds9 saveimage png ds9_exercise05_extra2.png
display < ds9_exercise05_extra2.png
xpaset -p ds9 quit
[1]+ Done ds9 13858/primary/acisf13858N001_evt2.fits -scale log
Most Chandra data products are FITS files, specifically FITS binary tables, with extensive headers that fully describe the dataset. Students should become familiar with some of the basic keywords and tool used to examine those keywords
Open the Level 2 event file in prism
The EVENTS extension is automatically selected. The Header Keywords are shown in the top, right pane.
prism 13858/primary/acisf13858N001_evt2.fits &
[1] 1274
import -window prism prism_exercise7.png
display < prism_exercise7.png
Q: Record the value for the following keywords:
MISSION
: AXAFTELESCOP
: CHANDRAINSTRUME
: ACISDETNAM
: ACIS-5678GRATING
: NONEDATAMODE
: FAINTREADMODE
: TIMEDDATE-OBS
: 2012-06-19T18:49:34OBSERVER
: Dr. Kayhan GultekinONTIME
: 15069.1001159Q: What units are the ACIS focal plane temperature, FP_TEMP, recorded in? K
xpaset -p prism quit
[1]+ Done prism 13858/primary/acisf13858N001_evt2.fits
Use dmlist with the header option to display the header.
dmlist 13858/primary/acisf13858N001_evt2.fits header,clean | \
egrep '^._TARG|^.*_NOM|^.*_PNT|^SIM_|^DTCOR|^ASCDSVER|^CALDBVER'
ASCDSVER 8.4.5 Processing system revision SIM_X -0.68282252473119 [mm] SIM focus pos SIM_Y 0 [mm] SIM orthogonal axis pos SIM_Z -190.1400660499 [mm] SIM translation stage pos RA_PNT 138.7056392802 [deg] Pointing RA DEC_PNT 8.8865713396 [deg] Pointing Dec ROLL_PNT 241.1563944238 [deg] Pointing Roll RA_NOM 138.7056392802 [deg] Nominal RA DEC_NOM 8.8865713396 [deg] Nominal Dec ROLL_NOM 241.1563944238 [deg] Nominal Roll DTCOR 0.98693426381071 Dead time correction CALDBVER 4.4.10
Q: Record the value for the following header keywords: see above
Q: This is an "ACIS-S" observation. How can you tell this from the event file header information? **There is nothing in the header that says this is an
'ACIS-S' observation directly. The value of the SIM_Z
keyword indicates that
the aim point is located on the ACIS-S array**
dmkeypar 13858/primary/acisf13858N001_evt2.fits TIMEDEL echo+
3.14104
dmmakepar 13858/primary/acisf13858N001_evt2.fits[events] \
dmmakepar_exercise08.par clob+
pdump dmmakepar_exercise08.par | \
egrep -i '^._TARG|^.*_NOM|^.*_PNT|^SIM_|^DTCOR|^ASCDSVER|^CALDBVER'
ascdsver='8.4.5' sim_x='-0.68282252473119' sim_y='0' sim_z='-190.14006604987' ra_pnt='138.70563928021' dec_pnt='8.8865713395653' roll_pnt='241.15639442377' ra_nom='138.70563928021' dec_nom='8.8865713395653' roll_nom='241.15639442377' dtcor='0.98693426381071' caldbver='4.4.10'
plist dmmakepar_exercise08.par | \
egrep -i '^._TARG|^.*_NOM|^.*_PNT|SIM_|DTCOR|ASCDSVER|CALDBVER'
(ascdsver = 8.4.5) Processing system revision (sim_x = -0.68282252473119) SIM focus pos [mm] (sim_y = 0.0) SIM orthogonal axis pos [mm] (sim_z = -190.14006604987) SIM translation stage pos [mm] (ra_pnt = 138.70563928021) Pointing RA [deg] (dec_pnt = 8.8865713395653) Pointing Dec [deg] (roll_pnt = 241.15639442377) Pointing Roll [deg] (ra_nom = 138.70563928021) Nominal RA [deg] (dec_nom = 8.8865713395653) Nominal Dec [deg] (roll_nom = 241.15639442377) Nominal Roll [deg] (dtcor = 0.98693426381071) Dead time correction (caldbver = 4.4.10)
pget dmmakepar_exercise08.par \
sim_x sim_y sim_z ra_pnt dec_pnt roll_pnt ra_nom dec_nom roll_nom \
dtcor caldbver ascdsver
-0.68282252473119 0 -190.14006604987 138.70563928021 8.8865713395653 241.15639442377 138.70563928021 8.8865713395653 241.15639442377 0.98693426381071 4.4.10 8.4.5
dmhistory 13858/primary/acisf13858N001_evt2.fits acis_process_events
# dmhistory (CIAO 4.11): WARNING: Found and corrected "pixlib" library parameters # dmhistory (CIAO 4.11): WARNING: Found and corrected "pixlib" library parameters acis_process_events infile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/output/acisf13858_000N001_tmp_evt1.fits" outfile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/output/acisf13858_000N001_evt1.fits" acaofffile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/input/pcadf456520092N001_asol1.fits[time=456518974.4871400:456536836.1380900]" apply_cti="yes" apply_tgain="yes" alignmentfile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/input/pcadf456520092N001_asol1.fits[time=456518974.4871400:456536836.1380900]" obsfile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/output/axaff13858_000N001_obs0a.par" geompar="geom" logfile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/output/acis_process_events.log" gradefile="CALDB" grade_image_file="CALDB" gainfile="CALDB" badpixfile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/output/acisf13858_000N001_bpix1.fits" threshfile="CALDB" ctifile="CALDB" tgainfile="CALDB" mtlfile="/dsops/ap/sdp.10/opus/prs_run/tmp//ACIS_F_L1_456484176n330/output/acisf13858_000N001_fptemp_egti1.fits" eventdef="{d:time,s:ccd_id,s:node_id,i:expno,s:chip,s:tdet,f:det,f:sky,s:phas,l:pha,l:pha_ro,f:energy,l:pi,s:fltgrade,s:grade,x:status}" doevtgrade="yes" check_vf_pha="no" calc_cc_times="yes" trail="0.027" spthresh="13" time_offset="0" calculate_pi="yes" pi_bin_width="14.6" pi_num_bins="1024" max_cti_iter="15" cti_converge="0.1" tstart="TSTART" tstop="TSTOP" clobber="no" verbose="0" stop="sky" instrume="acis" rand_seed="1" rand_pha="yes" pix_adj="EDSER" subpixfile="CALDB" stdlev1="{d:time,s:ccd_id,s:node_id,i:expno,s:chip,s:tdet,f:det,f:sky,s:phas,l:pha,l:pha_ro,f:energy,l:pi,s:fltgrade,s:grade,x:status}" grdlev1="{d:time,s:ccd_id,s:node_id,i:expno,s:chip,s:tdet,f:det,f:sky,l:pha,l:pha_ro,s:corn_pha,f:energy,l:pi,s:fltgrade,s:grade,x:status}" cclev1="{d:time,d:time_ro,s:ccd_id,s:node_id,i:expno,s:chip,s:tdet,f:det,f:sky,f:sky_1d,s:phas,l:pha,l:pha_ro,f:energy,l:pi,s:fltgrade,s:grade,x:status}" ccgrdlev1="{d:time,d:time_ro,s:ccd_id,s:node_id,i:expno,s:chip,s:tdet,f:det,f:sky,f:sky_1d,l:pha,l:pha_ro,s:corn_pha,f:energy,l:pi,s:fltgrade,s:grade,x:status}"
The Chandra calibration database (CALDB) is continually updated. The then most recent CALDB is used for observations as they are taken. Some calibrations, such as the time dependent gain calibrations, can only be definitively computed based on historical observations; thus the file in the current CALDB is always predicted. These calibrations are later updated to be definitive post facto.
The CIAO team strongly advises users to always reprocess data obtained from the archive.
Use chandra_repro to reprocess the dataset.
chandra_repro 13858 out= clob+
Processing input directory '/data/lenin2/Conf_and_Work/AAS2019/Workbook/13858' Resetting afterglow status bits in evt1.fits file... Running the destreak tool on the evt1.fits file... Running acis_build_badpix and acis_find_afterglow to create a new bad pixel file... Running acis_process_events to reprocess the evt1.fits file... Output from acis_process_events: # acis_process_events (CIAO 4.11): The following error occurred 2 times: dsAPEPULSEHEIGHTERR -- WARNING: pulse height is less than split threshold when performing serial CTI adjustment. Filtering the evt1.fits file by grade and status and time... Applying the good time intervals from the flt1.fits file... The new evt2.fits file is: /data/lenin2/Conf_and_Work/AAS2019/Workbook/13858/repro/acisf13858_repro_evt2.fits Updating the event file header with chandra_repro HISTORY record Creating FOV file... Setting observation-specific bad pixel file in local ardlib.par. Cleaning up intermediate files WARNING: Observation-specific bad pixel file set for session use: /data/lenin2/Conf_and_Work/AAS2019/Workbook/13858/repro/acisf13858_repro_bpix1.fits Run 'punlearn ardlib' when analysis of this dataset completed. The data have been reprocessed. Start your analysis with the new products in /data/lenin2/Conf_and_Work/AAS2019/Workbook/13858/repro
dmdiff 13858/primary/acisf13858N001_evt2.fits 13858/repro/acisf13858_repro_evt2.fits data- || echo
Infile 1: 13858/primary/acisf13858N001_evt2.fits Infile 2: 13858/repro/acisf13858_repro_evt2.fits ----------------------- HEADER VALUE DIFFERENCES ----------------------- # dmdiff (CIAO 4.11): WARNING: header key "STARTMJF" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "STARTMNF" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "STOPMJF" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "STOPMNF" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "OBI_NUM" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "TIME_ADJ" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "CLSTBITS" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "STATFILT" not present in infile1. Message: Keyword: Value(s): Diff: -------- ------- --------- ----- Values are not equal CREATOR cxc - Version DS 8.4 acis_process_events - CIAO 4.11 Values are not equal ASCDSVER 8.4.5 CIAO 4.11 # dmdiff (CIAO 4.11): WARNING: ASCDSVER comments are different. # dmdiff (CIAO 4.11): comment1= "Processing system revision" # dmdiff (CIAO 4.11): comment2= "ASCDS version number" Values are not equal CHECKSUM 9L8RCL6R9L6RCL6R Z6a3g5Y1Z5a1d5W1 # dmdiff (CIAO 4.11): WARNING: CHECKSUM comments are different. # dmdiff (CIAO 4.11): comment1= "HDU checksum updated 2012-06-20T13:25:39" # dmdiff (CIAO 4.11): comment2= "HDU checksum updated 2018-12-18T15:36:38" Values are not equal DATASUM 3109198819 744352830 # dmdiff (CIAO 4.11): WARNING: DATASUM comments are different. # dmdiff (CIAO 4.11): comment1= "data unit checksum updated 2012-06-20T13:25:10" # dmdiff (CIAO 4.11): comment2= "data unit checksum updated 2018-12-18T15:36:38" Values are not equal CONTENT EVT2 EVT1 Values are not equal HDUCLAS2 ACCEPTED ALL Values are not equal DATE 2012-06-20T13:25:05 2018-12-18T15:36:06 Values are not equal GAINFILE acisD2000-01-29gain_ctiN0006.fits acisD2000-01-29gain_ctiN0007.fits Values are not equal CTIFILE acisD2002-08-01ctiN0007.fits acisD2010-01-01ctiN0008.fits Values are not equal MTLFILE acisf13858_000N001_fptemp_egti1.fits acisf13858_000N001_mtl1.fits Values are not equal TGAINFIL acisD2012-02-01t_gain_biN0002.fits acisD2012-05-01t_gainN0006.fits Values are not equal BPIXFILE acisf13858_000N001_bpix1.fits acisf13858_repro_bpix1.fits Values are not equal HISTNUM 518 647 +129 Values are not equal ONTIME 15069.100115895 15070.556907833 +1.45679 Values are not equal ONTIME7 15069.100115895 15070.556907833 +1.45679 Values are not equal ONTIME5 15069.100115895 15070.556907892 +1.45679 Values are not equal ONTIME6 15069.100115895 15070.556907833 +1.45679 Values are not equal ONTIME8 15069.100115895 15070.556907892 +1.45679 Values are not equal LIVETIME 14872.211229171 14873.648987049 +1.43776 Values are not equal LIVTIME7 14872.211229171 14873.648987049 +1.43776 Values are not equal LIVTIME5 14872.211229171 14873.648987108 +1.43776 Values are not equal LIVTIME6 14872.211229171 14873.648987049 +1.43776 Values are not equal LIVTIME8 14872.211229171 14873.648987108 +1.43776 Values are not equal EXPOSURE 14872.211229171 14873.648987049 +1.43776 Values are not equal EXPOSUR7 14872.211229171 14873.648987049 +1.43776 Values are not equal EXPOSUR5 14872.211229171 14873.648987108 +1.43776 Values are not equal EXPOSUR6 14872.211229171 14873.648987049 +1.43776 Values are not equal EXPOSUR8 14872.211229171 14873.648987108 +1.43776 -------------------------- SUBSPACE VALUE DIFFERENCES -------------------------- Message: Column: Row Value(s): Diff: -------- ------- --- --------- ----- Range mins are not equal expno 1 0 3 +3 ( +inf %) Range maxs are not equal expno 1 2147483647 4801 -2.14748e+09 ( -100 %) # dmdiff (CIAO 4.11): WARNING: subspace column "status" type unknown or not supported. # dmdiff (CIAO 4.11): WARNING: phas units are different. # dmdiff (CIAO 4.11): unit1= "" # dmdiff (CIAO 4.11): unit2= "adu" # dmdiff (CIAO 4.11): WARNING: phas comments are different. # dmdiff (CIAO 4.11): comment1= "" # dmdiff (CIAO 4.11): comment2= "array of pixel pulse heights"
dmkeypar 13858/primary/acisf13858N001_evt2.fits CALDBVER echo+
dmkeypar 13858/repro/acisf13858_repro_evt2.fits CALDBVER echo+
check_ciao_caldb
4.4.10 4.4.10 CALDB environment variable = /data/lenin2/Conf_and_Work/AAS2019/Workbook/CALDB CALDB version = 4.8.2 release date = 2018-12-13T17:00:00 UTC CALDB query completed successfully.
dmlist 13858/primary/acisf13858N001_evt2.fits counts
dmlist 13858/repro/acisf13858_repro_evt2.fits counts
134855 134868
Q: Compare the header keyword values in the _repro_evt2.fits file with the evt2 file obtained from the archive. Discuss the differences: We see newer calibration files are used (
GAINFILE
,CTIFILE
, andTGAINFIL
). We see small diff inONTIME
.
Q: What version of the CALDB is installed? What is the value of the CALDBVER keyword? It is unchanged.
CALDBVER
is not updated by the tools; it's set in SDP.
Q: Compare the number of events in the reprocessed Level 2 event file with the number of events in the archived Level 2 event file. Why are they same (or not the same)?
Slightly different. New calibrations mean some good events go bad, some bad events go good (grade migration)
In this section students will exercise some of the basic CIAO tools and scripts needed to perform basic imaging tasks.
One of the most common analysis tasks is to detect sources.
Please keep in mind: CIAO detect tools only detect candidate sources and they are not photometric tools. The output from the detect tools should be used to guide further analysis.
See also:
In this exercise students should complete the following steps
Create image and exposure map. Run the fluximage script on the dataset. Students should be sure to set the binsize=1 and set bands=default or bands=broad.
Create the psfmap. Run mkpsfmap using the fluximage output image as input. Students should use energy=1.4967 ecf=0.393
Detect Sources. Run wavdetect on the fluximage output counts image, using the exposure map and psfmap. Students should select a set of wavelet scales to use that is appropriate for the dataset being analyzed.
fluximage 13858/repro/acisf13858_repro_evt2.fits out=acisf13858 bin=1 bands=broad clob+ mode=h
Running fluximage Version: 28 November 2018 Using CSC ACIS broad science energy band. Aspect solution 13858/repro/pcadf456520092N001_asol1.fits found. Bad-pixel file 13858/repro/acisf13858_repro_bpix1.fits found. Mask file 13858/repro/acisf13858_000N001_msk1.fits found. The output images will have 2937 by 4168 pixels, pixel size of 0.492 arcsec, and cover x=2735.5:5672.5:1,y=1838.5:6006.5:1. Running tasks in parallel with 4 processors. Creating aspect histograms for obsid 13858 Creating 4 instrument maps for obsid 13858 Creating 4 exposure maps for obsid 13858 Combining 4 exposure maps for obsid 13858 Thresholding data for obsid 13858 Exposure-correcting image for obsid 13858 The following files were created: The clipped counts image is: acisf13858_broad_thresh.img The clipped exposure map is: acisf13858_broad_thresh.expmap The exposure-corrected image is: acisf13858_broad_flux.img
mkpsfmap acisf13858_broad_thresh.img acisf13858_broad.psfmap \
energy=1.4967 ecf=0.393 mode=h clob+
pset wavdetect \
infile=acisf13858_broad_thresh.img \
expfile=acisf13858_broad_thresh.expmap \
psffile=acisf13858_broad.psfmap \
scales='1.4 2 4 8 12 16 24 32' \
outfile=acisf13858_wav.src \
scellfile=acisf13858_wav.cell \
imagefile=acisf13858_wav.recon \
defnbkg=acisf13858_wav.nbkg \
clob+
wavdetect mode=h
ds9 acisf13858_broad.psfmap -scale linear -cmap standard -zoom to fit \
-saveimage png ds9_exercise10_a.png -quit
display < ds9_exercise10_a.png
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region acisf13858_wav.src \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_b.png -quit
display < ds9_exercise10_b.png
Q: Display the PSF map in ds9. Why does it look the way it does? Chandra PSF increases in size the further away from optical axis.
Q: Record choice of wavelet scales and why that set was selected: above. Pseduo sqrt(2) used to detect srcs across field
Q: Open the broad-band image in ds9 and load the source list as a region file. Comment on the detected sources and any missed detections: src detects look good ; regions are a little small; maybe some faint stuff missed
Q: Are the ellipses the position error or the apparent size of the source?
They are a measure of the observed source size. They are not the intrinsic (deconvolved) source size, nor are they the position error.
Try differenct wavelet scales
wavdetect scales='1 4 16 64' mode=h clobber=yes outfile=fewscales.src
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region fewscales.src \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_ec1.png -quit
display < ds9_exercise10_ec1.png
Try different significance thresholds, sigthresh.
wavdetect sigthresh=1e-7 mode=h clobber=yes outfile=lowersigthresh.src
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region lowersigthresh.src \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_ec2.png -quit
display < ds9_exercise10_ec2.png
Try different ecf values when making the PSF map.
mkpsfmap acisf13858_broad_thresh.img ecf90.psfmap \
energy=1.4967 ecf=0.90 mode=h clob+
wavdetect mode=h clobber=yes outfile=ecf90.src psffile=ecf90.psfmap
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region lowersigthresh.src \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_ec3.png -quit
display < ds9_exercise10_ec3.png
Try different energy bands.
mkpsfmap acisf13858_broad_thresh.img 5keV.psfmap \
energy=5.0 ecf=0.90 mode=h clob+
wavdetect mode=h clobber=yes outfile=5keV.src psffile=5keV.psfmap
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region 5keV.src \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_ec4.png -quit
display < ds9_exercise10_ec4.png
Try using the celldetect tool.
celldetect acisf13858_broad_thresh.img \
expstk=acisf13858_broad_thresh.expmap \
psffile=ecf90.psfmap \
out=acisf13858_cell.src \
clob+ mode=h
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region acisf13858_cell.src \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_ec5.png -quit
display < ds9_exercise10_ec5.png
Try using the vtpdetect tool.
vtpdetect acisf13858_broad_thresh.img \
exp=acisf13858_broad_thresh.expmap \
out=acisf13858_vtp.src \
clob+ mode=h
ds9 acisf13858_broad_thresh.img -block 2 -scale log -region acisf13858_vtp.src[src_region] \
-scale limits 0 20 -smooth -saveimage png ds9_exercise10_ec6.png -quit
display < ds9_exercise10_ec6.png
The detect tools are one way to create regions automatically. However, often users analyzing a single source in an observation will simply create their own region in ds9 and then use those regions with the CIAO tools.
ds9 acisf13858_broad_thresh.img -scale log -pan to 4096.5 4096.5 physical &
[1] 14006
echo "physical;circle(4104.5,4115.5,10)" | xpaset ds9 region
xpaset -p ds9 saveimage png ds9_exercise11_a.png
xpaget ds9 regions -format ds9 -system wcs -skyformat sexagesimal > ds9_src.reg
xpaset -p ds9 regions delete all
display < ds9_exercise11_a.png
cat ds9_src.reg
# Region file format: DS9 version 4.1 global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1 fk5 circle(9:14:49.0898,+8:53:20.988,4.920")
echo "physical;annulus(4105.5,4113.5,45,125) # background" | xpaset ds9 region
xpaset -p ds9 saveimage png ds9_exercise11_b.png
xpaget ds9 regions -format ciao -system physical > ds9_bkg.reg
xpaset -p ds9 regions delete all
display < ds9_exercise11_b.png
cat ds9_bkg.reg
annulus(4105.5,4113.5,45,125)
xpaset -p ds9 quit
[1]+ Done ds9 acisf13858_broad_thresh.img -scale log -pan to 4096.5 4096.5 physical
Q: Record the source location used: see above
Q: Describe the differences between the CIAO format and the ds9 format regions:
ds9 format includes meta-data: color, linestyle, etc.
Compute source centroid. In this exercise students will use the dmstat tool to compute the source centroid in their region.
dmcopy "acisf13858_broad_thresh.img[sky=region(ds9_src.reg)]" dmcopy_e12_src.fits clob+
dmlist dmcopy_e12_src.fits blocks,cols
-------------------------------------------------------------------------------- Dataset: dmcopy_e12_src.fits -------------------------------------------------------------------------------- Block Name Type Dimensions -------------------------------------------------------------------------------- Block 1: EVENTS_IMAGE Image Int4(21x21) -------------------------------------------------------------------------------- Columns for Image Block EVENTS_IMAGE -------------------------------------------------------------------------------- ColNo Name Unit Type Range 1 EVENTS_IMAGE[21,21] Int4(21x21) - -------------------------------------------------------------------------------- Physical Axis Transforms for Image Block EVENTS_IMAGE -------------------------------------------------------------------------------- Group# Axis# 1 1,2 sky(x) = (+4093.50) +(+1.0)* ((#1)-(+0.50)) (y) (+4104.50) (+1.0) ((#2) (+0.50)) -------------------------------------------------------------------------------- World Coordinate Axis Transforms for Image Block EVENTS_IMAGE -------------------------------------------------------------------------------- Group# Axis# 1 1,2 EQPOS(RA ) = (+138.7056)[deg] +TAN[(-0.000136667)* (sky(x)-(+4096.50))] (DEC) (+8.8866 ) (+0.000136667) ( (y) (+4096.50))
dmstat dmcopy_e12_src.fits cen+ sig- med+
EVENTS_IMAGE(x, y) min: 0 @: ( 4102 4106 ) max: 399 @: ( 4104 4116 ) cntrd[log] : ( 11.475524476 11.817482517 ) cntrd[phys]: ( 4104.4755245 4115.8174825 ) good: 316 null: 125
dmcopy 13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_src.reg)][bin sky=1]" \
dmcopy_e12_evtsrc.fits clob+
dmlist dmcopy_e12_evtsrc.fits blocks,cols
-------------------------------------------------------------------------------- Dataset: dmcopy_e12_evtsrc.fits -------------------------------------------------------------------------------- Block Name Type Dimensions -------------------------------------------------------------------------------- Block 1: EVENTS_IMAGE Image Int2(20x20) Block 2: GTI7 Table 2 cols x 1 rows Block 3: GTI5 Table 2 cols x 1 rows Block 4: GTI6 Table 2 cols x 1 rows Block 5: GTI8 Table 2 cols x 1 rows -------------------------------------------------------------------------------- Columns for Image Block EVENTS_IMAGE -------------------------------------------------------------------------------- ColNo Name Unit Type Range 1 EVENTS_IMAGE[20,20] Int2(20x20) - -------------------------------------------------------------------------------- Physical Axis Transforms for Image Block EVENTS_IMAGE -------------------------------------------------------------------------------- Group# Axis# 1 1,2 sky(x) = (+4094.4409) +(+1.0)* ((#1)-(+0.50)) (y) (+4105.4658) (+1.0) ((#2) (+0.50)) -------------------------------------------------------------------------------- World Coordinate Axis Transforms for Image Block EVENTS_IMAGE -------------------------------------------------------------------------------- Group# Axis# 1 1,2 EQPOS(RA ) = (+138.7056)[deg] +TAN[(-0.000136667)* (sky(x)-(+4096.50))] (DEC) (+8.8866 ) (+0.000136667) ( (y) (+4096.50))
dmstat dmcopy_e12_evtsrc.fits cen+ sig- med+
EVENTS_IMAGE(x, y) min: 0 @: ( 4101.9408797 4105.9658198 ) max: 436 @: ( 4103.9408797 4115.9658198 ) cntrd[log] : ( 10.511035654 10.842671194 ) cntrd[phys]: ( 4104.4519153 4115.808491 ) good: 316 null: 84
Q: Is the filtered image the same size as the fluximage output image size? Why?
The CXCDM shrinks the image to the size of the region (by default)
Q: Record the centroid of fluximage output filtered image:
4104.4755245, 4115.8174825
Q: What are the good and null values that dmstat reports?
The number of pixels outside the circle
Q: Is the image created by filtering and binning the event file the same size as the other images? Why?
No. (20x20 vs 21x21). Filter image vs. Filter table then bin into an image
Q: Record the centroid of the event file filter and binned image:
4104.4519153, 4115.808491
Q: Is the centroid the same for the two images? Why? (Hint: what energies are being used?)
Opps, no energy filter on the event file -- but image was made with broad band (500:7000eV).
Obtaining the counts (or count rate) is the first step in computing the source flux.
In this exercise students will use the CIAO analysis menu, aka dax, to get the net counts in their regions (from Exercise 11).
$ASCDS_INSTALL/bin/ds9 acisf13858_broad_thresh.img -scale log -pan to 4096.5 4096.5 physical &
[1] 14238
xpaset -p ds9 regions ds9_bkg.reg
xpaset -p ds9 regions select all
xpaset -p ds9 regions background
xpaset -p ds9 regions ds9_src.reg
xpaset -p ds9 saveimage png exercise_13_ds9a.png
display < exercise_13_ds9a.png
xpaset -p ds9 regions select all
xpaset -p ds9 analysis task "{Net Counts}"
import -window 'Net Counts' exercise_13_a.png
display < exercise_13_a.png
xpaset -p ds9 regions delete all
echo "physical; circle(4104.4434,4115.8478,17.145457)" | xpaset ds9 regions
echo "physical; annulus(4104.5,4115.5,26.305893,125) # background" | xpaset ds9 regions
xpaset -p ds9 saveimage png exercise_13_ds9b.png
display < exercise_13_ds9b.png
xpaset -p ds9 regions select all
xpaset -p ds9 analysis task "{Net Counts}"
import -window 'Net Counts' exercise_13_b.png
display < exercise_13_b.png
xpaset -p ds9 quit
[1]+ Done $ASCDS_INSTALL/bin/ds9 acisf13858_broad_thresh.img -scale log -pan to 4096.5 4096.5 physical
Q: From step 7, record the following information from the Net Counts task:
Q: From step 8, describe how the net counts and net rates vary with changes to the source and background regions: net rate doesn't change much as bkg gets bigger/smaller (ie background is flat)
In this exercise students will use the srcflux
script to get various estimates of the flux of the source.
punlearn dmcoords
dmcoords 13858/repro/acisf13858_repro_evt2.fits op=sky x=4104.4755245 y=4115.8174825 celfmt=hms verb=0
pget dmcoords ra dec
09:14:49.088 +08:53:21.16
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step2 clob+ mode=h
srcflux infile = 13858/repro/acisf13858_repro_evt2.fits pos = 09:14:49.088, +08:53:21.16 outroot = exercise14_step2 bands = broad srcreg = bkgreg = bkgresp = yes psfmethod = ideal psffile = conf = 0.9 binsize = 1 rmffile = arffile = model = xspowerlaw.pow1 paramvals = pow1.PhoIndex=2.0 absmodel = xsphabs.abs1 absparams = abs1.nH=%GAL% abund = angr fovfile = asolfile = mskfile = bpixfile = dtffile = ecffile = CALDB parallel = yes nproc = INDEF tmpdir = /tmp clobber = yes verbose = 1 mode = h Processing OBI 000 Extracting counts Setting Ideal PSF : alpha=1 , beta=0 Getting net rate and confidence limits Getting model independent fluxes Getting model fluxes Getting photon fluxes Running tasks in parallel with 4 processors. Making response files for exercise14_step2_0001 Running eff2evt for exercise14_step2_broad_0001_bkg.dat Running eff2evt for exercise14_step2_broad_0001_src.dat Running aprates for exercise14_step2_0001_broad_rates.par Running modeflux for region 1 Using GAL=0.0426 for source 1 Adding net rates to output Appending flux results onto output Appending photflux results onto output Computing Net fluxes Adding model fluxes to output Scaling model flux confidence limits Summary of source fluxes Position 0.5 - 7.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0827 c/s (0.0788,0.0866) Flux 5.73E-13 erg/cm2/s (5.47E-13,6.01E-13) Mod.Flux 5.92E-13 erg/cm2/s (5.64E-13,6.2E-13) Unabs Mod.Flux 6.37E-13 erg/cm2/s (6.07E-13,6.67E-13)
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step3 \
psfmethod=arfcorr \
clob+ mode=h verbose=0
cat exercise14_step3_summary.txt
Summary of source fluxes Position 0.5 - 7.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0962 c/s (0.0917,0.101) Flux 7.49E-13 erg/cm2/s (7.14E-13,7.85E-13) Mod.Flux 6.89E-13 erg/cm2/s (6.56E-13,7.21E-13) Unabs Mod.Flux 7.41E-13 erg/cm2/s (7.06E-13,7.76E-13)
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step4 \
psfmethod=arfcorr \
model="xsbbody.black_body" paramvals="black_body.kT=1" \
clob+ mode=h verbose=0
cat exercise14_step4_summary.txt
Summary of source fluxes Position 0.5 - 7.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0962 c/s (0.0917,0.101) Flux 7.49E-13 erg/cm2/s (7.14E-13,7.85E-13) Mod.Flux 1.02E-12 erg/cm2/s (9.7E-13,1.07E-12) Unabs Mod.Flux 1.03E-12 erg/cm2/s (9.86E-13,1.08E-12)
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step5 \
psfmethod=arfcorr \
model="xsbbody.black_body" paramvals="black_body.kT=1" \
band="hard" \
clob+ mode=h verbose=0
cat exercise14_step5_summary.txt
Summary of source fluxes Position 2.0 - 7.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0185 c/s (0.0164,0.0205) Flux 3.12E-13 erg/cm2/s (2.78E-13,3.47E-13) Mod.Flux 2.91E-13 erg/cm2/s (2.59E-13,3.23E-13) Unabs Mod.Flux 2.92E-13 erg/cm2/s (2.6E-13,3.25E-13)
Q: Record the net count rate, model independent flux, model flux from steps 2 through 5
.
Estimate | Step 2 | Step 3 | Step 4 | Step 5 |
---|---|---|---|---|
Count Rate | 0.827 | 0.962 | 0.962 | 0.0185 |
Flux | 5.6E-13 | 7.3E-13 | 7.3E-13 | 3.12E-13 |
Model Flux | 5.8E-13 | 6.74E-13 | 1.0E-12 | 2.91E-13 |
.
Q: Discuss the differences in the estimated fluxes obtained in steps 2 through 5.
Try using psfmethod=quick and psfmethod=marx
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step_ec1 \
psfmethod=quick \
clob+ mode=h verbose=0
cat exercise14_step_ec1_summary.txt
Summary of source fluxes Position 0.5 - 7.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0955 c/s (0.091,0.1) Flux 6.62E-13 erg/cm2/s (6.31E-13,6.93E-13) Mod.Flux 6.84E-13 erg/cm2/s (6.52E-13,7.16E-13) Unabs Mod.Flux 7.36E-13 erg/cm2/s (7.01E-13,7.7E-13)
source $ASCDS_INSTALL/marx-5.4.0/setup_marx.sh
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step_ec2 \
psfmethod=marx \
clob+ mode=h verbose=0
cat exercise14_step_ec2_summary.txt
Summary of source fluxes Position 0.5 - 7.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0983 c/s (0.0937,0.103) Flux 8.02E-13 erg/cm2/s (7.64E-13,8.4E-13) Mod.Flux 7.04E-13 erg/cm2/s (6.71E-13,7.37E-13) Unabs Mod.Flux 7.57E-13 erg/cm2/s (7.22E-13,7.93E-13)
Estimate | ideal | quick | arfcorr | marx |
---|---|---|---|---|
Count Rate | 0.827 | 0.962 | 0.955 | 0.0985 |
Flux | 5.6E-13 | 7.3E-13 | 6.5E-13 | 7.84E-13 |
Model Flux | 5.8E-13 | 6.74E-13 | 6.7E-12 | 6.90E-13 |
Try other spectral model and other model parameters.
Try other energy bands (2-10 keV is a common band in the literature).
punlearn srcflux
srcflux 13858/repro/acisf13858_repro_evt2.fits "09:14:49.088, +08:53:21.16" exercise14_step_ec4 \
psfmethod=quick band="2.0:10.0:3.0" \
clob+ mode=h verbose=0
cat exercise14_step_ec4_summary.txt
Summary of source fluxes Position 2.0 - 10.0 keV Value 90% Conf Interval #0001|9 14 49.08 +8 53 21.1 Rate 0.0181 c/s (0.0162,0.0201) Flux 3.17E-13 erg/cm2/s (2.82E-13,3.51E-13) Mod.Flux 3.64E-13 erg/cm2/s (3.24E-13,4.03E-13) Unabs Mod.Flux 3.65E-13 erg/cm2/s (3.25E-13,4.05E-13)
The Chandra Point Spread Function (PSF) varies spatially across the field of view as well with energy. There is no analytic model of the PSF. The only way to obtain an estimate of the Chandra PSF for detailed spatial analysis is by simulation.
The psfmethod used by srcflux are only appropriate when integrating over a region. The pixel-to-pixel variations used in those methods is insufficient for any type of analysis that requires detailed spatial information.
There are two different simulators users can use.
In this exercise Students will simulate the PSF using ChaRT and with MARX. The simulate_psf script is used to create PSF images that are appropriate for further data analysis.
source $ASCDS_INSTALL/marx-5.4.0/setup_marx.sh
dmkeypar exercise14_step2_broad.flux net_photflux_aper echo+
0.000221279856225308
curl \
-F email=${USER}@head.cfa.harvard.edu \
-F coords=cel \
-F ra=09:14:49.088 \
-F dec=+08:53:21.16 \
-F asol=obi \
-F obsid=13858 \
-F obinum=0\
-F niter=10\
-F randseed=32767 \
-F energy=mono \
-F mono=2.3 \
-F flux=0.000221 \
http://saotrace.cfa.harvard.edu/cgi-bin/runwrapper
<html> <head><title>ChaRT Job Submitted</title></head> <body> <h1>ChaRT v2</h1> Job submitted. You will recieve an email from cxc_rays@head.cfa.harvard.edu when the job is complete or if there are any errors. </body> </html>
curl -o rays.tar.gz ftp://saotrace.cfa.harvard.edu/pub/ChaRT/HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered.tar.gz
tar xvfz rays.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1868k 100 1868k 0 0 15.1M 0 --:--:-- --:--:-- --:--:-- 48.0M HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0004_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0002_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0009_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0008_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0001_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0003_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0000_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0005_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0007_rays.fits HRMA_ra138.70453_dec8.88921_en2.3_flux0.000221_dithered_i0006_rays.fits
simulate_psf 13858/repro/acisf13858_repro_evt2.fits \
chart_sim ra=138.70453 dec=8.88921 \
simulator=file rayfile="HRMA*rays.fits" \
minsize=128 mode=h
simulate_psf infile = 13858/repro/acisf13858_repro_evt2.fits outroot = chart_sim ra = 138.70453 dec = 8.88921 spectrumfile = monoenergy = INDEF flux = INDEF simulator = file rayfile = HRMA*rays.fits projector = marx random_seed = -1 blur = 0.07000000000000001 readout_streak = no pileup = no ideal = yes extended = yes binsize = 1 numsig = 7 minsize = 128 numiter = 1 keepiter = no asolfile = marx_root = /export/ciao-4.11/marx-5.4.0 verbose = 1 mode = h Started check_setup Finished check_setup 10 rayfiles provided; ignoring numiter=1 parameter Performing iteration 1 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 2 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 3 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 4 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 5 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 6 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 7 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 8 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 9 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 10 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Started create_average_image Finished create_average_image Final output PSF image is : chart_sim.psf[PSF]
ds9 acisf13858_broad_thresh.img -scale log -pan to 4096.5 4096.5 physical \
-zoom to 4 \
chart_sim.psf -pan to 4096.5 4096.5 physical \
-view colorbar no \
-saveimage png ds9_exercise15_a.png -quit
display < ds9_exercise15_a.png
simulate_psf 13858/repro/acisf13858_repro_evt2.fits \
marx_sim ra=138.70453 dec=8.88921 \
simulator=marx \
minsize=128 mode=h \
mono=2.3 flux=0.000221 numiter=10
simulate_psf infile = 13858/repro/acisf13858_repro_evt2.fits outroot = marx_sim ra = 138.70453 dec = 8.88921 spectrumfile = monoenergy = 2.3 flux = 0.000221 simulator = marx rayfile = projector = marx random_seed = -1 blur = 0.07000000000000001 readout_streak = no pileup = no ideal = yes extended = yes binsize = 1 numsig = 7 minsize = 128 numiter = 10 keepiter = no asolfile = marx_root = /export/ciao-4.11/marx-5.4.0 verbose = 1 mode = h Started check_setup Finished check_setup Performing iteration 1 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 2 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 3 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 4 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 5 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 6 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 7 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 8 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 9 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Performing iteration 10 of 10 Started run_marx Finished run_marx Started create_psf_image Finished create_psf_image Started create_average_image Finished create_average_image Final output PSF image is : marx_sim.psf[PSF]
ds9 acisf13858_broad_thresh.img -scale log -pan to 4096.5 4096.5 physical \
-zoom to 4 \
marx_sim.psf -pan to 4096.5 4096.5 physical \
-view colorbar no \
-saveimage png ds9_exercise15_b.png -quit
display < ds9_exercise15_b.png
Q: Comment on a visual comparison of the ChaRT/SAOTrace PSF to the observation:
Q: Comment on a visual comparison of the MARX PSF to the observation:
Q: Describe any differences between the MARX and ChaRT PSFs:
Q: Is this a point source?
Try setting simulate_psf readout_streak=yes. Try pileup=yes. Try blur=0.20
simulate_psf 13858/repro/acisf13858_repro_evt2.fits \
marxA_sim ra=138.70453 dec=8.88921 \
simulator=marx \
minsize=128 mode=h \
mono=2.3 flux=0.000221 numiter=10 verb=0 readout+
simulate_psf 13858/repro/acisf13858_repro_evt2.fits \
marxB_sim ra=138.70453 dec=8.88921 \
simulator=marx \
minsize=128 mode=h \
mono=2.3 flux=0.000221 numiter=10 verb=0 pileup+ ext-
simulate_psf 13858/repro/acisf13858_repro_evt2.fits \
marxC_sim ra=138.70453 dec=8.88921 \
simulator=marx \
minsize=128 mode=h \
mono=2.3 flux=0.000221 numiter=10 verb=0 blur=0.2
ds9 marx_sim.psf -scale log -pan to 4105.5 4113.5 physical \
-zoom to 4 \
marxA_sim.psf -pan to 4105.5 4113.5 physical \
marxB_sim.psf -pan to 4105.5 4113.5 physical \
marxC_sim.psf -pan to 4105.5 4113.5 physical \
-view colorbar no \
-saveimage png ds9_exercise15_ec1.png -quit
display < ds9_exercise15_ec1.png
Run the Lucy-Richardson deconvolution tool arestore using the broad band flux image and the PSFs simulated here. Try with different numbers of iterations.
arestore "acisf13858_broad_thresh.img[sky=bounds(region(ds9_bkg.reg))]" \
chart_sim.psf arestore.out num=150 clob+
ds9 acisf13858_broad_thresh.img -scale log -pan to 4105.5 4113.5 physical \
-zoom to 4 \
chart_sim.psf -pan to 4105.5 4113.5 physical \
arestore.out -pan to 4105.5 4113.5 physical \
-view colorbar no \
-tile mode column \
-saveimage png ds9_exercise15_ec2.png -quit
display < ds9_exercise15_ec2.png
Three color (aka "true color" or "tri-color") images can be useful to help guide analysis by providing visual clues about changes in spectra.
ds9 -rgb -red root_soft_flux.img \
-green root_medium_flux.img \
-blue root_hard_flux.img
/bin/rm -rf 13736
download_chandra_obsid 13736 evt1,bpix,flt,mtl,msk,dtf,bias,pbk,asol,stat
Downloading files for ObsId 13736, total size is 322 Mb. Type Format Size 0........H.........1 Download Time Average Rate --------------------------------------------------------------------------- bpix fits 78 Kb #################### < 1 s 1711.6 kb/s asol fits 27 Mb #################### < 1 s 49943.5 kb/s evt1 fits 286 Mb #################### 5 s 59688.9 kb/s flt fits 7 Kb #################### < 1 s 344.0 kb/s msk fits 5 Kb #################### < 1 s 588.6 kb/s mtl fits 4 Mb #################### < 1 s 41608.7 kb/s stat fits 3 Mb #################### < 1 s 47463.1 kb/s bias fits 487 Kb #################### < 1 s 2601.9 kb/s bias fits 429 Kb #################### < 1 s 11311.8 kb/s bias fits 425 Kb #################### < 1 s 9213.2 kb/s bias fits 436 Kb #################### < 1 s 17224.4 kb/s bias fits 424 Kb #################### < 1 s 10273.7 kb/s pbk fits 4 Kb #################### < 1 s 532.9 kb/s Total download size for ObsId 13736 = 322 Mb Total download time for ObsId 13736 = 6 s
download_obsid_caldb 13736 ./CALDB
download_obsid_caldb infile = 13736 outdir = ./CALDB background = no missing = no clobber = no verbose = 1 mode = ql Retrieving files for CALDB_VER = 4.8.2 Retrieving CALDB index files Processing infile=13736/secondary/acisf13736_000N001_evt1.fits.gz Retrieving CALDB data files Filename: 0------------------1 telD1999-07-23sgeomN0001.fits .................... (skipped) telD1999-07-23tdetN0001.fits .................... (skipped) telD1999-07-23skyN0002.fits .................... (skipped) telD1999-07-23aimptsN0002.fits .................... (skipped) telD1999-07-23geomN0006.fits .................... (skipped) acisD2000-11-28badpixN0003.fits .................... (skipped) acisD1999-08-13contamN0012.fits .................... (skipped) hrmaD1996-12-20axeffaN0008.fits .................... (skipped) acisD2010-02-01qeuN0007.fits .................... (skipped) acisD1997-04-17qeN0006.fits .................... (skipped) hrmaD1996-12-20vignetN0003.fits .................... (skipped) acisD2012-02-01t_gainN0006.fits #################### acisD1996-11-01gradeN0004.fits .................... (skipped) acisD2010-01-01ctiN0008.fits .................... (skipped) acisD1999-07-22subpixN0001.fits .................... (skipped) acisD2000-01-29grdimgN0001.fits .................... (skipped) acisD2000-01-29gain_ctiN0007.fits .................... (skipped) acisD2005-07-01evtspltN0002.fits .................... (skipped) acisD2000-01-29fef_pha_ctiN0004.fits .................... (skipped) acisD1999-09-16dead_areaN0001.fits .................... (skipped) hrmaD1996-12-20reefN0001.fits .................... (skipped) acisD2000-01-29p2_respN0007.fits .................... (skipped) hrmaD1996-11-01wpsfN0001.fits .................... (skipped) acisD2000-01-29osip_ctiN0006.fits .................... (skipped) acisD2002-11-15gtilimN0003.fits .................... (skipped)
chandra_repro 13736 out=
Processing input directory '/data/lenin2/Conf_and_Work/AAS2019/Workbook/13736' Resetting afterglow status bits in evt1.fits file... Running the destreak tool on the evt1.fits file... Running acis_build_badpix and acis_find_afterglow to create a new bad pixel file... Running acis_process_events to reprocess the evt1.fits file... Filtering the evt1.fits file by grade and status and time... Applying the good time intervals from the flt1.fits file... The new evt2.fits file is: /data/lenin2/Conf_and_Work/AAS2019/Workbook/13736/repro/acisf13736_repro_evt2.fits Updating the event file header with chandra_repro HISTORY record Creating FOV file... Setting observation-specific bad pixel file in local ardlib.par. Cleaning up intermediate files WARNING: Observation-specific bad pixel file set for session use: /data/lenin2/Conf_and_Work/AAS2019/Workbook/13736/repro/acisf13736_repro_bpix1.fits Run 'punlearn ardlib' when analysis of this dataset completed. The data have been reprocessed. Start your analysis with the new products in /data/lenin2/Conf_and_Work/AAS2019/Workbook/13736/repro
fluximage 13736 out=tricolor band=csc bin=8 clob+
Running fluximage Version: 28 November 2018 Found 13736/repro/acisf13736_repro_evt2.fits Using event file 13736/repro/acisf13736_repro_evt2.fits Using CSC ACIS soft science energy band. Using CSC ACIS medium science energy band. Using CSC ACIS hard science energy band. Aspect solution 13736/repro/pcadf444947551N001_asol1.fits found. Bad-pixel file 13736/repro/acisf13736_repro_bpix1.fits found. Mask file 13736/repro/acisf13736_000N001_msk1.fits found. The output images will have 304 by 394 pixels, pixel size of 3.936 arcsec, and cover x=3568.5:6000.5:8,y=2840.5:5992.5:8. Running tasks in parallel with 4 processors. Creating aspect histograms for obsid 13736 Creating 15 instrument maps for obsid 13736 Creating 15 exposure maps for obsid 13736 Combining 5 exposure maps for 3 bands (obsid 13736) Thresholding data for obsid 13736 Exposure-correcting 3 images for obsid 13736 The following files were created: The clipped counts images are: tricolor_soft_thresh.img tricolor_medium_thresh.img tricolor_hard_thresh.img The clipped exposure maps are: tricolor_soft_thresh.expmap tricolor_medium_thresh.expmap tricolor_hard_thresh.expmap The exposure-corrected images are: tricolor_soft_flux.img tricolor_medium_flux.img tricolor_hard_flux.img
ds9 -rgb -view colorbar no \
-red tricolor_soft_flux.img -scale log -smooth yes -smooth radius 1 \
-green tricolor_medium_flux.img -scale log -smooth yes -smooth radius 1 \
-blue tricolor_hard_flux.img -scale log -smooth yes -smooth radius 1 \
-saveimage png ds9_exercise_16.png -quit
display < ds9_exercise_16.png
dmimg2jpg \
infile=tricolor_soft_flux.img \
greenfile=tricolor_medium_flux.img \
bluefile=tricolor_hard_flux.img \
outfile=dmimg2jpg_exercise13.jpg \
clob+
display < dmimg2jpg_exercise13.jpg
Q: Discuss the differences in the output from ds9 and dmimg2jpg. ds9 interactive
Smooth the images with aconvolve before displaying
# Should convolve image and exposure map separately!
aconvolve tricolor_soft_flux.img tricolor_soft_flux_gaus.img "lib:gaus(2,5,1,1,1)" meth=slide clob+
aconvolve tricolor_medium_flux.img tricolor_medium_flux_gaus.img "lib:gaus(2,5,1,1,1)" meth=slide clob+
aconvolve tricolor_hard_flux.img tricolor_hard_flux_gaus.img "lib:gaus(2,5,1,1,1)" meth=slide clob+
dmimg2jpg \
infile=tricolor_soft_flux_gaus.img \
greenfile=tricolor_medium_flux_gaus.img \
bluefile=tricolor_hard_flux_gaus.img \
outfile=dmimg2jpg_exercise13_aconvolve.jpg \
clob+
display < dmimg2jpg_exercise13_aconvolve.jpg
Smooth the images with csmooth before displaying
# Csmooth really, really wants integer counts, so we smooth the counts image not the flux'ed image.
csmooth tricolor_soft_thresh.img none tricolor_soft_flux_csm.img sigmin=3 sclmax=20 mode=h clob+
csmooth tricolor_medium_thresh.img none tricolor_medium_flux_csm.img sigmin=3 sclmax=20 mode=h clob+
csmooth tricolor_hard_thresh.img none tricolor_hard_flux_csm.img sigmin=3 sclmax=20 mode=h clob+
# WARNING: Remainder will be smoothed on scale of 20.000000 # WARNING: Remainder will be smoothed on scale of 20.000000 # WARNING: Remainder will be smoothed on scale of 20.000000
dmimg2jpg \
infile=tricolor_soft_flux_csm.img \
greenfile=tricolor_medium_flux_csm.img \
bluefile=tricolor_hard_flux_csm.img \
outfile=dmimg2jpg_exercise13_csm.jpg \
clob+
display < dmimg2jpg_exercise13_csm.jpg
Smooth the images with dmimgadapt before displaying
dmimgadapt tricolor_soft_thresh.img tricolor_soft_flux_cone.img cone min=1 max=20 num=100 radscale=linear counts=25 clob+ mode=h
dmimgadapt tricolor_medium_thresh.img tricolor_medium_flux_cone.img min=1 max=20 num=100 radscale=linear counts=25 clob+ mode=h
dmimgadapt tricolor_hard_thresh.img tricolor_hard_flux_cone.img min=1 max=20 num=100 radscale=linear counts=25 clob+ mode=h
dmimg2jpg \
infile=tricolor_soft_flux_cone.img \
greenfile=tricolor_medium_flux_cone.img \
bluefile=tricolor_hard_flux_cone.img \
outfile=dmimg2jpg_exercise13_cone.jpg \
clob+
display < dmimg2jpg_exercise13_cone.jpg
Obtain overlapping multi-spectral images of this region from other archives. Use reproject_image to project the other datasets to the same tangent plane as the Chandra dataset. Create tri-color image using red for the lowest energy, and blue for the highest energy datasets.
Obtain the data for OBS_ID 635 and reprocess it with chandra_repro. Split the event file into 3 equal time intervals by filtering on the TIME column. Run fluximage on each time interval using the broad energy band. Use the 3 time-slices to create a 3 color image.
/bin/rm -rf 635
download_chandra_obsid 635 evt1,bpix,flt,mtl,msk,dtf,bias,pbk,asol,stat
Downloading files for ObsId 635, total size is 208 Mb. Type Format Size 0........H.........1 Download Time Average Rate --------------------------------------------------------------------------- bpix fits 81 Kb #################### < 1 s 1977.2 kb/s asol fits 26 Mb #################### < 1 s 60870.8 kb/s evt1 fits 173 Mb #################### 4 s 45237.1 kb/s flt fits 7 Kb #################### < 1 s 762.4 kb/s msk fits 5 Kb #################### < 1 s 595.4 kb/s mtl fits 4 Mb #################### < 1 s 45420.6 kb/s stat fits 3 Mb #################### < 1 s 9671.3 kb/s bias fits 423 Kb #################### < 1 s 7277.3 kb/s bias fits 435 Kb #################### < 1 s 5337.8 kb/s bias fits 433 Kb #################### < 1 s 12175.6 kb/s bias fits 426 Kb #################### < 1 s 13779.4 kb/s bias fits 432 Kb #################### < 1 s 14306.3 kb/s pbk fits 4 Kb #################### < 1 s 521.5 kb/s Total download size for ObsId 635 = 208 Mb Total download time for ObsId 635 = 5 s
download_obsid_caldb 635 ./CALDB
download_obsid_caldb infile = 635 outdir = ./CALDB background = no missing = no clobber = no verbose = 1 mode = ql Retrieving files for CALDB_VER = 4.8.2 Retrieving CALDB index files Processing infile=635/secondary/acisf00635_000N004_evt1.fits.gz Retrieving CALDB data files Filename: 0------------------1 telD1999-07-23tdetN0001.fits .................... (skipped) telD1999-07-23sgeomN0001.fits .................... (skipped) telD1999-07-23geomN0006.fits .................... (skipped) telD1999-07-23aimptsN0002.fits .................... (skipped) telD1999-07-23skyN0002.fits .................... (skipped) hrmaD1996-12-20axeffaN0008.fits .................... (skipped) acisD2000-01-29qeuN0007.fits #################### acisD2000-01-29badpixN0003.fits #################### acisD1999-08-13contamN0012.fits .................... (skipped) hrmaD1996-12-20vignetN0003.fits .................... (skipped) acisD1997-04-17qeN0006.fits .................... (skipped) acisD2000-01-29gain_ctiN0007.fits .................... (skipped) acisD1996-11-01evtspltN0002.fits #################### acisD1996-11-01gradeN0004.fits .................... (skipped) acisD2000-01-29t_gainN0006.fits #################### acisD1999-07-22subpixN0001.fits .................... (skipped) acisD2000-01-29ctiN0008.fits #################### acisD2000-01-29grdimgN0001.fits .................... (skipped) acisD2000-01-29fef_pha_ctiN0004.fits .................... (skipped) acisD1999-09-16dead_areaN0001.fits .................... (skipped) hrmaD1996-12-20reefN0001.fits .................... (skipped) acisD2000-01-29p2_respN0007.fits .................... (skipped) hrmaD1996-11-01wpsfN0001.fits .................... (skipped) acisD2000-01-29osip_ctiN0006.fits .................... (skipped) acisD1999-07-22gtilimN0006.fits ####################
chandra_repro 635 out=
Processing input directory '/data/lenin2/Conf_and_Work/AAS2019/Workbook/635' Resetting afterglow status bits in evt1.fits file... Running acis_build_badpix and acis_find_afterglow to create a new bad pixel file... Running acis_process_events to reprocess the evt1.fits file... Filtering the evt1.fits file by grade and status and time... Applying the good time intervals from the flt1.fits file... The new evt2.fits file is: /data/lenin2/Conf_and_Work/AAS2019/Workbook/635/repro/acisf00635_repro_evt2.fits Updating the event file header with chandra_repro HISTORY record Creating FOV file... Setting observation-specific bad pixel file in local ardlib.par. Cleaning up intermediate files WARNING: Observation-specific bad pixel file set for session use: /data/lenin2/Conf_and_Work/AAS2019/Workbook/635/repro/acisf00635_repro_bpix1.fits Run 'punlearn ardlib' when analysis of this dataset completed. The data have been reprocessed. Start your analysis with the new products in /data/lenin2/Conf_and_Work/AAS2019/Workbook/635/repro
dmstat "635/repro/acisf00635_repro_evt2.fits[cols time]" cen- sig- med-
time[s] min: 72039166.717 @: 1 max: 72141141.711 @: 454807 mean: 72091533.863 sum: 3.2787806333e+13 good: 454808 null: 0
python -c 'a=72039166;b=72141142;dt3=(b-a)/3.0;print(a+0.0*dt3,a+1.0*dt3,a+2.0*dt3,a+3.0*dt3)'
72039166.0 72073158.0 72107150.0 72141142.0
dmcopy "635/repro/acisf00635_repro_evt2.fits[time=72039166.0:72073158.0]" 635/repro/begin_evt.fits clob+
dmcopy "635/repro/acisf00635_repro_evt2.fits[time=72073158.0:72107150.0]" 635/repro/middle_evt.fits clob+
dmcopy "635/repro/acisf00635_repro_evt2.fits[time=72107150.0:72141142.0]" 635/repro/end_evt.fits clob+
fluximage 635/repro/begin_evt.fits rhooph_begin bin=6 band=broad clob+ verb=0
fluximage 635/repro/middle_evt.fits rhooph_middle bin=6 band=broad clob+ verb=0
fluximage 635/repro/end_evt.fits rhooph_end bin=6 band=broad clob+ verb=0
dmimg2jpg \
infile=rhooph_begin_broad_thresh.img \
greenfile=rhooph_middle_broad_thresh.img \
bluefile=rhooph_end_broad_thresh.img \
outfile=rhooph_time_slice.jpg \
clob+
display < rhooph_time_slice.jpg
e=635/repro/acisf00635_repro_evt2.fits
f=635/repro/acisf00635_repro_fov1.fits
dmcopy "${e}[sky=region($f),energy=500:7000][bin sky=6,time=::#3]" 635_time_cube.fits clob+
ds9 -frame delete -scale log -rgbcube 635_time_cube.fits -saveimage ds9_ex16_timecube.png -quit
display < ds9_ex16_timecube.png
References:
In X-ray astronomy the term "light curve" is used to describe the flux of a source vs time.
chips
.chips> make_figure("out_bin100.lc[cols dt,count_rate]")
chips> print_window("out_bin100.png")
dmextract 13858/repro/acisf13858_repro_evt2.fits"[sky=circle(4104.5,4115.5,10),energy=500:7000][bin time=::100]" \
out=dme_100s.lc op=ltc1 \
bkg=13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_bkg.reg),energy=500:7000]" \
mode=h clob+
cat << EOM > chips_ex17a.py
from pychips import *
from pychips.hlui import *
load_preferences()
make_figure("dme_100s.lc[cols dt,net_rate]")
print_window("out_bin100.png","export.clobber=True")
quit()
EOM
python chips_ex17a.py
display < out_bin100.png
for tt in 200 500 1000 1
do
dmextract 13858/repro/acisf13858_repro_evt2.fits"[sky=circle(4104.5,4115.5,10),energy=500:7000][bin time=::${tt}]" \
out=dme_${tt}s.lc op=ltc1 \
bkg=13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_bkg.reg),energy=500:7000]" \
mode=h clob+
done
# dmextract (CIAO 4.11): WARNING: Binning size=1 smaller than TIMEDEL=3.14104 # dmextract (CIAO 4.11): WARNING: Binning size=1 smaller than TIMEDEL=3.14104
cat << EOM > chips_ex17b.py
from pychips import *
from pychips.hlui import *
load_preferences()
strip_chart(4)
set_current_plot("plot1")
add_curve("dme_200s.lc[cols dt,net_rate]")
set_current_plot("plot2")
add_curve("dme_500s.lc[cols dt,net_rate]")
set_current_plot("plot3")
add_curve("dme_1000s.lc[cols dt,net_rate]")
set_current_plot("plot4")
add_curve("dme_1s.lc[cols dt,net_rate]")
print_window("out_bin_strip.png","export.clobber=True")
quit()
EOM
python chips_ex17b.py
display < out_bin_strip.png
dmlist dme_100s.lc cols
-------------------------------------------------------------------------------- Columns for Table Block LIGHTCURVE -------------------------------------------------------------------------------- ColNo Name Unit Type Range 1 TIME_BIN channel Int4 1:179 S/C TT corresponding to mid-exposure 2 TIME_MIN s Real8 456518974.4871399999:456536836.1380900145 Minimum Value in Bin 3 TIME s Real8 456518974.4871399999:456536836.1380900145 S/C TT corresponding to mid-exposure 4 TIME_MAX s Real8 456518974.4871399999:456536836.1380900145 Maximum Value in Bin 5 COUNTS count Int4 - Counts 6 STAT_ERR count Real8 0:+Inf Statistical error 7 AREA pixel**2 Real8 -Inf:+Inf Area of extraction 8 EXPOSURE s Real8 -Inf:+Inf Time per interval 9 COUNT_RATE count/s Real8 0:+Inf Rate 10 COUNT_RATE_ERR count/s Real8 0:+Inf Rate Error 11 BG_COUNTS count Real8 -Inf:+Inf Background Counts 12 BG_ERR count Real8 -Inf:+Inf Error on Background counts 13 BG_AREA pixel**2 Real8 -Inf:+Inf Background Area of Extraction 14 BG_EXPOSURE s Real8 -Inf:+Inf Exposure time of background file 15 BG_RATE count/s Real8 -Inf:+Inf Background Rate 16 NORM_BG_COUNTS count Real8 -Inf:+Inf Background Counts 17 NORM_BG_ERR count Real8 -Inf:+Inf Error on Background counts 18 NET_COUNTS count Real8 -Inf:+Inf Net Counts 19 NET_ERR count Real8 -Inf:+Inf Error on Net Counts 20 NET_RATE count/s Real8 -Inf:+Inf Net Count Rate 21 ERR_RATE count/s Real8 -Inf:+Inf Error Rate -------------------------------------------------------------------------------- World Coord Transforms for Columns in Table Block LIGHTCURVE -------------------------------------------------------------------------------- ColNo Name 2: DT_MIN = +0 [s] +1.0 * (TIME_MIN -456519024.487140) 3: DT = +0 [s] +1.0 * (TIME -456519024.487140) 4: DT_MAX = +0 [s] +1.0 * (TIME_MAX -456519024.487140)
dmlist 13858/repro/acisf13858_repro_evt2.fits blocks,subspace
-------------------------------------------------------------------------------- Dataset: 13858/repro/acisf13858_repro_evt2.fits -------------------------------------------------------------------------------- Block Name Type Dimensions -------------------------------------------------------------------------------- Block 1: PRIMARY Null Block 2: EVENTS Table 16 cols x 134868 rows Block 3: GTI7 Table 2 cols x 1 rows Block 4: GTI5 Table 2 cols x 1 rows Block 5: GTI6 Table 2 cols x 1 rows Block 6: GTI8 Table 2 cols x 1 rows -------------------------------------------------------------------------------- Data subspace for block EVENTS: Components: 4 Descriptors: 16 -------------------------------------------------------------------------------- --- Component 1 --- 1 time Real8 TABLE GTI7 456520729.9422901273:456535800.4991979599 2 expno Int4 3:4801 3 ccd_id Int2 7:7 4 node_id Int2 0:3 5 chip [ 1] chipx 1:1024 5 chip [ 2] chipy 1:1024 6 tdet [ 1] tdetx 1:8192 6 tdet [ 2] tdety 1:8192 7 det [ 1] detx 0.50: 8192.50 7 det [ 2] dety 0.50: 8192.50 8 sky [ 1] x 0.50: 8192.50 8 sky [ 2] y 0.50: 8192.50 9 phas Int2 -4096:4095 10 pha Int4 0:36855 11 pha_ro Int4 0:36855 12 energy Real4 0: 1000000.0 13 pi Int4 1:1024 14 fltgrade Int2 0:255 15 grade Int2 0:0,2:2,3:3,4:4,6:6 16 status Bit --- Component 2 --- 1 time Real8 TABLE GTI5 456520729.9833301306:456535800.5402380228 2 expno Int4 3:4801 3 ccd_id Int2 5:5 4 node_id Int2 0:3 5 chip [ 1] chipx 1:1024 5 chip [ 2] chipy 1:1024 6 tdet [ 1] tdetx 1:8192 6 tdet [ 2] tdety 1:8192 7 det [ 1] detx 0.50: 8192.50 7 det [ 2] dety 0.50: 8192.50 8 sky [ 1] x 0.50: 8192.50 8 sky [ 2] y 0.50: 8192.50 9 phas Int2 -4096:4095 10 pha Int4 0:36855 11 pha_ro Int4 0:36855 12 energy Real4 0: 1000000.0 13 pi Int4 1:1024 14 fltgrade Int2 0:255 15 grade Int2 0:0,2:2,3:3,4:4,6:6 16 status Bit --- Component 3 --- 1 time Real8 TABLE GTI6 456520730.0243701339:456535800.5812779665 2 expno Int4 3:4801 3 ccd_id Int2 6:6 4 node_id Int2 0:3 5 chip [ 1] chipx 1:1024 5 chip [ 2] chipy 1:1024 6 tdet [ 1] tdetx 1:8192 6 tdet [ 2] tdety 1:8192 7 det [ 1] detx 0.50: 8192.50 7 det [ 2] dety 0.50: 8192.50 8 sky [ 1] x 0.50: 8192.50 8 sky [ 2] y 0.50: 8192.50 9 phas Int2 -4096:4095 10 pha Int4 0:36855 11 pha_ro Int4 0:36855 12 energy Real4 0: 1000000.0 13 pi Int4 1:1024 14 fltgrade Int2 0:255 15 grade Int2 0:0,2:2,3:3,4:4,6:6 16 status Bit --- Component 4 --- 1 time Real8 TABLE GTI8 456520730.0654101372:456535800.6223180294 2 expno Int4 3:4801 3 ccd_id Int2 8:8 4 node_id Int2 0:3 5 chip [ 1] chipx 1:1024 5 chip [ 2] chipy 1:1024 6 tdet [ 1] tdetx 1:8192 6 tdet [ 2] tdety 1:8192 7 det [ 1] detx 0.50: 8192.50 7 det [ 2] dety 0.50: 8192.50 8 sky [ 1] x 0.50: 8192.50 8 sky [ 2] y 0.50: 8192.50 9 phas Int2 -4096:4095 10 pha Int4 0:36855 11 pha_ro Int4 0:36855 12 energy Real4 0: 1000000.0 13 pi Int4 1:1024 14 fltgrade Int2 0:255 15 grade Int2 0:0,2:2,3:3,4:4,6:6 16 status Bit
Q: Why is there a gap at the beginning and at the end of the light curves with count_rate=0? outside of GTI but inside of TSTART-TSTOP
Q: Is the delta-time, dt, column actually a column in the dmextract output file? No, it's a coord on time column
Q: What can be learned from the light curve with 1 second time resolution? nothing
Q: What energy events were used to make these light curves? Does using an energy filter change things and if so how?
used energy=500:7000, if not then would have used all energies
Q: ACIS event files contain multiple good time intervals (one for each chip). Which GTI was use? The first one, which in this case is for CCD=7 which is correct
glvary 13858/repro/acisf13858_repro_evt2.fits"[sky=circle(4104.5,4115.5,10),energy=500:7000]" \
out=glvary_src.prob lc=glvary_src.lc clob+ mode=h
cat << EOM > chips_ex18a.py
from pychips import *
from pychips.hlui import *
load_preferences()
make_figure("glvary_src.lc[cols time,count_rate]")
print_window("glvary_src.png","export.clobber=True")
quit()
EOM
python chips_ex18a.py
display < glvary_src.png
glvary 13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_bkg.reg),energy=500:7000]" \
out=glvary_bkg.prob lc=glvary_bkg.lc clob+ mode=h
cat << EOM > chips_ex18b.py
from pychips import *
from pychips.hlui import *
load_preferences()
make_figure("glvary_bkg.lc[cols time,count_rate]")
print_window("glvary_bkg.png","export.clobber=True")
quit()
EOM
python chips_ex18b.py
display < glvary_bkg.png
Q: Describe how the glvary lightcurves differ from the dmextract light curves.
it picked binning, no dt
column. No net-rate
Q: Could any variability in the source region be due to variability in the background? No variability, background is not variable either
Use the dither_region tool to compute the time resolved area fraction of the source and separately the background regions. Try using those as input to dmextract and glvary as exposure corrections. Compare to the results without those corrections.
punlearn ardlib
acis_set_ardlib 13858/repro/acisf13858_repro_bpix1.fits abs-
Updated ardlib parameter file: /home/kjg/cxcds_param4/ardlib.par AXAF_ACIS0_BADPIX_FILE -> CALDB AXAF_ACIS1_BADPIX_FILE -> CALDB AXAF_ACIS2_BADPIX_FILE -> CALDB AXAF_ACIS3_BADPIX_FILE -> CALDB AXAF_ACIS4_BADPIX_FILE -> CALDB AXAF_ACIS5_BADPIX_FILE -> 13858/repro/acisf13858_repro_bpix1.fits[BADPIX5] AXAF_ACIS6_BADPIX_FILE -> 13858/repro/acisf13858_repro_bpix1.fits[BADPIX6] AXAF_ACIS7_BADPIX_FILE -> 13858/repro/acisf13858_repro_bpix1.fits[BADPIX7] AXAF_ACIS8_BADPIX_FILE -> 13858/repro/acisf13858_repro_bpix1.fits[BADPIX8] AXAF_ACIS9_BADPIX_FILE -> CALDB
dither_region \
13858/repro/pcadf456520092N001_asol1.fits \
"circle(4104.5,4115.5,10)" \
dr_src.out \
wcs= 13858/repro/acisf13858_repro_evt2.fits \
mask= 13858/repro/acisf13858_000N001_msk1.fits \
mode=h clob+
dmlist dr_src.out cols
-------------------------------------------------------------------------------- Columns for Table Block AREAFRACTION -------------------------------------------------------------------------------- ColNo Name Unit Type Range 1 TIME s Real8 456520092.2497000098:456535804.9880300164 Time 2 EQPOS(RA,DEC) deg Real8 -360.0: 360.0 Sky Position 3 ROLL deg Real8 -Inf:+Inf Roll angle 4 FRACAREA Real8 -Inf:+Inf Fraction area 5 AREA_CHIP_FRAC[10] Real8(10) -Inf:+Inf Region Area Fraction per chip 6 DELTA_T s Real8 -Inf:+Inf Time 7 CHIP_FRAC_TIME[10] Real8(10) -Inf:+Inf Fraction of ontime per chip 8 STATUS Bit[8] Why fraction < 1
cat << EOM > chips_ex18_drout.py
from pychips import *
from pychips.hlui import *
load_preferences()
make_figure("dr_src.out[cols time,fracarea]")
print_window("dr_src.png","export.clobber=True")
quit()
EOM
python chips_ex18_drout.py
display < dr_src.png
dither_region \
13858/repro/pcadf456520092N001_asol1.fits \
"region(ds9_bkg.reg)" \
dr_bkg.out \
wcs= 13858/repro/acisf13858_repro_evt2.fits \
mask= 13858/repro/acisf13858_000N001_msk1.fits \
mode=h clob+ maxpix=10000
# dither_region (CIAO 4.11): WARNING: Too many pixels, resetting resolution from 1.000000e+00 to 2.000000e+00 # dither_region (CIAO 4.11): WARNING: Too many pixels, resetting resolution from 2.000000e+00 to 3.000000e+00
cat << EOM > chips_ex18_droutb.py
from pychips import *
from pychips.hlui import *
load_preferences()
make_figure("dr_bkg.out[cols time,fracarea]")
print_window("dr_bkg.png","export.clobber=True")
quit()
EOM
python chips_ex18_droutb.py
display < dr_bkg.png
The background is dither across bad columns/pixels, but only a tiny fraction of the area is lost.
Reference:
Background flares may influence results especially when working with large source regions such as supernovae remnants or clusters.
For an on-axis point source, users should carefully consider whether excluding time due to a background flare would be better than accepting the time in order to obtain higher signal to noise.
In this exercise, students will extract a light curve for a background, source-free region and use it to search for any evidence of a background flare.
the reprocessed Level 2 event file. 3. Use dmextract to create a light curve using the source free event file, use a CCD_ID filter to select events from chip you found in step 1. Use a bin-width of 259.28 seconds. 4. Use the deflare tool to search for background flares on the source chip using method=clean. 5. Use dmcopy to apply the deflare output good-time interval, GTI, file to the reprocessed level 2 event file.
punlearn dmcoords
dmcoords 13858/repro/acisf13858_repro_evt2.fits op=sky x=4104.5 y=4115.5 verb=0
pget dmcoords x y ra dec chip_id chipx chipy
4104.5 4115.5 09:14:49.087 +08:53:21.00 7 207.3356406343804 517.7142405898469
python -c 'from region import *;wav=CXCRegion("acisf13858_wav.src");out=field()-wav;out.write("exclude.reg",fits=True, clobber=True)'
dmcopy 13858/repro/acisf13858_repro_evt2.fits"[sky=region(exclude.reg)]" 13858_evt.holes clob+
ds9 13858_evt.holes -scale log -bin factor 8 -saveimage png ds9_ex19.png -quit
display < ds9_ex19.png
dmextract 13858_evt.holes'[ccd_id=7][bin time=::259.28]' bkg_lc op=ltc1 clob+
cat << EOM > chips_ex19.py
from pychips import *
from pychips.hlui import *
load_preferences()
make_figure("bkg_lc[cols dt,count_rate]")
print_window("chips_ex19.png","export.clobber=True")
quit()
EOM
python chips_ex19.py
display < chips_ex19.png
deflare bkg_lc bkg_lc_flare method=clean save="bkg_lc_flare"
convert bkg_lc_flare.ps -trim bkg_lc_flare.png
display < bkg_lc_flare.png
Parameters used to clean the lightcurve are: script version = May 2017 mean = None clip = 3 scale = 1.2 minfrac = 0.1 outfile = bkg_lc_flare plot = True rateaxis = y color = green pattern = solid pattern color = red Total number of bins in lightcurve = 69 Max length of one bin = 255.892 s Num. bins with a smaller exp. time = 2 Num. bins with exp. time = 0 = 10 Number of bins with a rate of 0 ct/s = 10 Calculated an initial mean (sigma-clipped) rate of 3.25061 ct/s Lightcurve limits use a scale factor of 1.2 about this mean Filtering lightcurve between rates of 2.70884 and 3.90073 ct/s Number of good time bins = 58 Rate filter: 2.7088414284775522 <= count_rate < 3.9007316570076744 Mean level of filtered lightcurve = 3.2506097141730623 ct/s GTI limits calculated using a count-rate filter: (count_rate>2.7088414284775522 && count_rate<3.9007316570076744) The corresponding times are: ((time >= 456520530.16714001) && (time < 456531160.64713997)) ; 10.29 ksec, bin 1 ((time >= 456531419.92714) && (time < 456535827.68713999)) ; 4.32 ksec, bin 2 Exposure time of lightcurve = 14.87 ks Filtered exposure time = 14.62 ks DTCOR value = 0.986934 Creating GTI file Created: bkg_lc_flare Light curve cleaned using the lc_clean routine. Created: bkg_lc_flare.ps
dmcopy 13858/repro/acisf13858_repro_evt2.fits"[@bkg_lc_flare]" 13858_deflare.evt clob+
dmlist 13858/repro/acisf13858_repro_evt2.fits counts
dmlist 13858_deflare.evt counts
134868 132340
Q: What CCD_ID was found in step 1? Which tool(s) were used? chip 7,
dmcoords
Q: Was there any evidence of a background flare in this observation, on this chip? If so, describe the flare (when did it occur within the observation, duration, etc.): **Yes, a very short 1-time-bin duration fare in the 2nd half of the
observation **
Try different bin-widths when creating the light curve. Does it affect the results?
dmextract 13858_evt.holes'[ccd_id=7][bin time=::50]' bkg_lc_50s op=ltc1 clob+
deflare bkg_lc_50s bkg_lc_flare_50s method=clean save="bkg_lc_flare_50s" plot- verb=0
convert bkg_lc_flare_50s.ps -trim bkg_lc_flare50s.png
display < bkg_lc_flare50s.png
Try different deflare method options.
deflare bkg_lc_50s bkg_lc_sigmaclip_50s method=sigma save="bkg_lc_sigmaclip_50s" plot- verb=0 < /dev/null
convert bkg_lc_sigmaclip_50s.ps -trim bkg_lc_sigmaclip50s.png
display < bkg_lc_sigmaclip50s.png
Try looking for flares on the other CCD's used in this observation.
dmextract 13858_evt.holes'[ccd_id=6][bin time=::259]' bkg_6lc op=ltc1 clob+
deflare bkg_6lc bkg_6lc_flare method=clean save="bkg_6lc_flare" plot- verb=0
convert bkg_6lc_flare.ps -trim bkg_6lc_flare.png
display < bkg_6lc_flare.png
The energy resolution and sensitivity of the ACIS detector allows for spectral analysis roughly in the 0.3 to 7.0 keV range.
In this exercise Students will use the specextract tool to extract the spectrum, ARF, and RMF files for the source and background regions.
punlearn specextract
specextract 13858/repro/acisf13858_repro_evt2.fits"[sky=circle(4104.5,4115.5,10)]" \
out=specextract_01 \
bkgfile=13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_bkg.reg)]" \
mode=h clob+
Running specextract Version: 11 May 2018 Checking for blank sky background files... Using event file 13858/repro/acisf13858_repro_evt2.fits[sky=circle(4104.5,4115.5,10)] Aspect solution file 13858/repro/pcadf456520092N001_asol1.fits found. Bad-pixel file 13858/repro/acisf13858_repro_bpix1.fits found. Mask file 13858/repro/acisf13858_000N001_msk1.fits found. Setting bad pixel file Extracting src spectra Creating src ARF Creating src RMF Using mkacisrmf... Grouping src spectrum Updating header of specextract_01.pi with RESPFILE and ANCRFILE keywords. Updating header of specextract_01_grp.pi with RESPFILE and ANCRFILE keywords. Setting bad pixel file Extracting bkg spectra Creating bkg ARF Creating bkg RMF Using mkacisrmf... Updating header of specextract_01_bkg.pi with RESPFILE and ANCRFILE keywords. Updating header of specextract_01.pi with BACKFILE keyword. Updating header of specextract_01_grp.pi with BACKFILE keyword.
punlearn specextract
specextract 13858/repro/acisf13858_repro_evt2.fits"[sky=circle(4104.5,4115.5,10)]" \
out=specextract_02 \
bkgfile=13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_bkg.reg)]" \
weight=no \
mode=h clob+
Running specextract Version: 11 May 2018 Checking for blank sky background files... Using event file 13858/repro/acisf13858_repro_evt2.fits[sky=circle(4104.5,4115.5,10)] Aspect solution file 13858/repro/pcadf456520092N001_asol1.fits found. Bad-pixel file 13858/repro/acisf13858_repro_bpix1.fits found. Mask file 13858/repro/acisf13858_000N001_msk1.fits found. Setting bad pixel file Extracting src spectra Creating src ARF Creating src RMF Using mkacisrmf... Grouping src spectrum Updating header of specextract_02.pi with RESPFILE and ANCRFILE keywords. Updating header of specextract_02_grp.pi with RESPFILE and ANCRFILE keywords. Setting bad pixel file Extracting bkg spectra Creating bkg ARF Creating bkg RMF Using mkacisrmf... Updating header of specextract_02_bkg.pi with RESPFILE and ANCRFILE keywords. Updating header of specextract_02.pi with BACKFILE keyword. Updating header of specextract_02_grp.pi with BACKFILE keyword.
punlearn specextract
specextract 13858/repro/acisf13858_repro_evt2.fits"[sky=circle(4104.5,4115.5,10)]" \
out=specextract_03 \
bkgfile=13858/repro/acisf13858_repro_evt2.fits"[sky=region(ds9_bkg.reg)]" \
correctpsf=yes \
mode=h clob+
Running specextract Version: 11 May 2018 WARNING: The 'correct' parameter is ignored when 'weight=yes'. Checking for blank sky background files... Using event file 13858/repro/acisf13858_repro_evt2.fits[sky=circle(4104.5,4115.5,10)] Aspect solution file 13858/repro/pcadf456520092N001_asol1.fits found. Bad-pixel file 13858/repro/acisf13858_repro_bpix1.fits found. Mask file 13858/repro/acisf13858_000N001_msk1.fits found. Setting bad pixel file Extracting src spectra Creating src ARF Creating src RMF Using mkacisrmf... Grouping src spectrum Updating header of specextract_03.pi with RESPFILE and ANCRFILE keywords. Updating header of specextract_03_grp.pi with RESPFILE and ANCRFILE keywords. Setting bad pixel file Extracting bkg spectra Creating bkg ARF Creating bkg RMF Using mkacisrmf... Updating header of specextract_03_bkg.pi with RESPFILE and ANCRFILE keywords. Updating header of specextract_03.pi with BACKFILE keyword. Updating header of specextract_03_grp.pi with BACKFILE keyword.
/bin/ls specextra*pi
specextract_01.pi specextract_02.pi specextract_03.pi specextract_01_bkg.pi specextract_02_bkg.pi specextract_03_bkg.pi specextract_01_grp.pi specextract_02_grp.pi specextract_03_grp.pi
dmdiff specextract_01.pi specextract_02.pi || echo
Infile 1: specextract_01.pi Infile 2: specextract_02.pi ----------------------- HEADER VALUE DIFFERENCES ----------------------- Message: Keyword: Value(s): Diff: -------- ------- --------- ----- Values are not equal CHECKSUM SfIaVZGYSfGaSZGY ShafVZUZSfZfSZZZ # dmdiff (CIAO 4.11): WARNING: CHECKSUM comments are different. # dmdiff (CIAO 4.11): comment1= "HDU checksum updated 2018-12-18T17:37:49" # dmdiff (CIAO 4.11): comment2= "HDU checksum updated 2018-12-18T17:38:23" # dmdiff (CIAO 4.11): WARNING: DATASUM comments are different. # dmdiff (CIAO 4.11): comment1= "data unit checksum updated 2018-12-18T17:37:17" # dmdiff (CIAO 4.11): comment2= "data unit checksum updated 2018-12-18T17:37:51" Values are not equal DATE 2018-12-18T17:37:17 2018-12-18T17:37:51 Values are not equal BACKFILE specextract_01_bkg.pi specextract_02_bkg.pi Values are not equal RESPFILE specextract_01.rmf specextract_02.rmf Values are not equal ANCRFILE specextract_01.arf specextract_02.arf -------------------------- SUBSPACE VALUE DIFFERENCES -------------------------- Message: Column: Row Value(s): Diff: -------- ------- --- --------- ----- TABLE NAME: SPECTRUM ----------------------- TABLE VALUE DIFFERENCES ----------------------- Message: Row: Column: Value(s): Diff: -------- ---- ------- --------- -----
Few keyword diffs, data are the same
dmdiff specextract_01.pi specextract_03.pi || echo
Infile 1: specextract_01.pi Infile 2: specextract_03.pi ----------------------- HEADER VALUE DIFFERENCES ----------------------- Message: Keyword: Value(s): Diff: -------- ------- --------- ----- Values are not equal CHECKSUM SfIaVZGYSfGaSZGY Mc0cNb0ZMb0aMb0Y # dmdiff (CIAO 4.11): WARNING: CHECKSUM comments are different. # dmdiff (CIAO 4.11): comment1= "HDU checksum updated 2018-12-18T17:37:49" # dmdiff (CIAO 4.11): comment2= "HDU checksum updated 2018-12-18T17:38:57" # dmdiff (CIAO 4.11): WARNING: DATASUM comments are different. # dmdiff (CIAO 4.11): comment1= "data unit checksum updated 2018-12-18T17:37:17" # dmdiff (CIAO 4.11): comment2= "data unit checksum updated 2018-12-18T17:38:25" Values are not equal DATE 2018-12-18T17:37:17 2018-12-18T17:38:25 Values are not equal BACKFILE specextract_01_bkg.pi specextract_03_bkg.pi Values are not equal RESPFILE specextract_01.rmf specextract_03.rmf Values are not equal ANCRFILE specextract_01.arf specextract_03.arf -------------------------- SUBSPACE VALUE DIFFERENCES -------------------------- Message: Column: Row Value(s): Diff: -------- ------- --- --------- ----- TABLE NAME: SPECTRUM ----------------------- TABLE VALUE DIFFERENCES ----------------------- Message: Row: Column: Value(s): Diff: -------- ---- ------- --------- -----
Same, few keys, no data diffs.
dmdiff specextract_01.arf"[#row=1:10]" specextract_02.arf"[#row=1:10]" comment- || echo
Infile 1: specextract_01.arf[#row=1:10] Infile 2: specextract_02.arf[#row=1:10] ----------------------- HEADER VALUE DIFFERENCES ----------------------- # dmdiff (CIAO 4.11): WARNING: header key "CHANTYPE" not present in infile2. # dmdiff (CIAO 4.11): WARNING: header key "DETCHANS" not present in infile2. # dmdiff (CIAO 4.11): WARNING: header key "THRSHLD" not present in infile2. # dmdiff (CIAO 4.11): WARNING: header key "FEFFILE" not present in infile2. # dmdiff (CIAO 4.11): WARNING: header key "FILTER" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "RESPFILE" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "ASPFILE" not present in infile1. # dmdiff (CIAO 4.11): WARNING: header key "FRACEXPO" not present in infile1. Message: Keyword: Value(s): Diff: -------- ------- --------- ----- Values are not equal CREATOR mkwarf - Version CIAO 4.11 mkarf v0.6.2-0 Values are not equal CHECKSUM 5Amp84kn59kn59kn 4KZL6IYK4IYK4IYK Values are not equal DATASUM 3326779830 3268880584 Values are not equal DATE 2018-12-18T17:37:22 2018-12-18T17:37:56 Values are not equal DETNAM ACIS-5678 ACIS-7 Values are not equal EXPOSURE 14873.648987049 14873.649553508 +0.000566459 # dmdiff (CIAO 4.11): WARNING: EXPOSURE units are different. # dmdiff (CIAO 4.11): unit1= "s" # dmdiff (CIAO 4.11): unit2= "secs" Values are not equal HISTNUM 106 49 -57 -------------------------- SUBSPACE VALUE DIFFERENCES -------------------------- Message: Column: Row Value(s): Diff: -------- ------- --- --------- ----- # dmdiff (CIAO 4.11): WARNING: Subspace column "ENERG_LO" ranges are different sizes. infile1 column has 0 value(s). infile2 column has 1 value(s). Skipping... # dmdiff (CIAO 4.11): WARNING: Subspace column "ENERG_HI" ranges are different sizes. infile1 column has 0 value(s). infile2 column has 1 value(s). Skipping... TABLE NAME: SPECRESP ----------------------- TABLE VALUE DIFFERENCES ----------------------- Message: Row: Column: Value(s): Diff: -------- ---- ------- --------- ----- Values are not equal 1 SPECRESP 1.53434360027313 1.53254926204681 -0.00179434 (-0.117 %) Values are not equal 2 SPECRESP 5.09871673583984 5.09271001815796 -0.00600672 (-0.118 %) Values are not equal 3 SPECRESP 7.69795370101929 7.68882703781128 -0.00912666 (-0.119 %) Values are not equal 4 SPECRESP 10.5274295806885 10.5148735046387 -0.0125561 (-0.119 %) Values are not equal 5 SPECRESP 13.1267709732056 13.111008644104 -0.0157623 (-0.12 %) Values are not equal 6 SPECRESP 15.4005174636841 15.3819284439087 -0.018589 (-0.121 %) Values are not equal 7 SPECRESP 17.3858909606934 17.3647861480713 -0.0211048 (-0.121 %) Values are not equal 8 SPECRESP 19.7637691497803 19.7396354675293 -0.0241337 (-0.122 %) Values are not equal 9 SPECRESP 23.1559047698975 23.1274528503418 -0.0284519 (-0.123 %) Values are not equal 10 SPECRESP 26.8301391601562 26.7969760894775 -0.0331631 (-0.124 %)
dmstat specextract_01.arf"[cols specresp]" | egrep 'min|max'
min: 0.56831908226 @: 1070 max: 631.94830322 @: 125
dmstat specextract_02.arf"[cols specresp]" | egrep 'min|max'
min: 0.56637614965 @: 1070 max: 630.57055664 @: 125
dmstat specextract_03.arf"[cols specresp]" | egrep 'min|max'
min: 0.56831908226 @: 1070 max: 631.94830322 @: 125
dmlist specextract_01.pi,specextract_01_bkg.pi header,clean | egrep 'BACKSCAL|EXPOSURE'
BACKSCAL 4.681337854E-06 [pixel] Fractional area EXPOSURE 14873.6489870490 [s] Exposure time BACKSCAL 0.0006366619481 [pixel] Fractional area EXPOSURE 14873.6489870490 [s] Exposure time
Q: Record the BACKSCAL and EXPOSURE keywords. Why are these keywords important? Used to scale background to source
Q: Describe and discuss the differences, if any, from step 4. Smaller max by a little bit
Q: Describe and discuss the differences, if any, from step 5: None, warning 'corect=yes is not used when making weighted
Use the rmfimg tool to convert the RMF into an image and display in ds9.
rmfimg specextract_01.rmf specextract_01.rmf.img clob+
ds9 specextract_01.rmf.img -scale log -zoom to fit -view colorbar no -cmap heat \
-saveimage png ds9_exercise20.png -quit
display < ds9_exercise20.png
References
sherpa is the fitting and modeling package developed for CIAO. It allows users to obtain best fit model parameters based on a number of models, fitting methods, and statistics used for uncertainty.
The exercise shown here is an extremely simple sherpa use case. More advanced usage includes user supplied models, linked model parameters, simultaneously fitting multiple datasets, fitting images, etc.
In this exercise Students will begin to use sherpa to model and fit the spectrum of the source.
sherpa> load_data("source.pha")
sherpa> set_source(xswabs.abs1*xspowerlaw.p1)
Q: Which fit method works best?
Q: Which spectrum fits best?
Q: Which model/param is best?
Q: How does grouping affect the results?
Q: What are the advantages/disadvantages of one method over another?