CIAO WORKSHOP 1/29/2001 Antonella Fruscione GRATING ANALYSIS DEMO ===================== Refer to threads: Examining PHA2 Files http://asc.harvard.edu/ciao/threads/examinepha2.thread.html Compute HETG/ACIS-S Grating ARFs http://asc.harvard.edu/ciao/threads/mkgarf.hetgacis.html Fitting Grating Data http://asc.harvard.edu/ciao/threads/sherpa.grating.html Extract Coadded and Grouped Nth-Order Source & Background Spectra and ARFs http://asc.harvard.edu/ciao/threads/add_grating_orders.thread.html +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ cd /data/ciao/threads 0. show grating images for the 4 instrument+grating combinations ds9 -tile -scale log -cmap bb \ acishetg/acism00459N000_evt2.fits -bin factor 16 \ acisletg/acism01198N000_evt2.fits -bin factor 8 \ hrcsletg/from_archive/primary/hrcf00460N002_evt2.fits -bin factor 64 \ hrciletg/hrcm01800N000_evt2.fits -bin factor 64 & ===> Summary of new thread called "Examining PHA2 Files" 1. talk about pha2 files coming out of the pipeline in the case of acis+hetg acis+letg hrcs/i+letg prism acishetg/acism00459N000_pha2.fits & FILE -> OPEN -> acisletg/acism01198N000_pha2.fits FILE -> OPEN -> hrcsletg/from_archive/primary/hrcf00460N002_pha2.fits 2. show spectra a. quick look with Prism 4th row; bin_lo vs. counts only for quick look, not customizable from Prism yet b. through chips dmtype2split infile=acishetg/acism00459N000_pha2.fits outfile=/tmp/acism00459N000_heg_p1.pha rows=4 clobber=yes chips plot "/tmp/acism00459N000_heg_p1.pha[cols bin_lo,counts]" redraw off symbol none step xlabel "Wavelength (\AA)" ylabel "Counts" title "ACIS+HET row=4 order=+1" split 1 2 redraw d 2 Reading pha2 spectrum as a S-Lang variable pha2 = readbintab("acishetg/acism00459N000_pha2.fits") print(pha2) bin_lo_heg_p1 = pha2.bin_lo[3,*] counts_heg_p1 = pha2.counts[3,*] plot x bin_lo_heg_p1 y counts_heg_p1 symbol none step xlabel "Wavelength (\AA)" ylabel Counts redraw c. through sherpa sherpa data acishetg/acism00459N000_pha2.fits set plot noerrorbars lp 2 data 3 data 4 #(HEG -1, +1)# Note : read in channels because no response is given yet 3. making grating ARFs scripts/mkgarf_acis \ acishetg/acism00459N000_pha2.fits \ 3 \ $CALDB/data/chandra/tel/grating/hetg/cpf/rmf/acisheg1D1999-07-22rmfN0003.fits \ acishetg/acism00459_000N000_aoff1.fits \ acishetg/acism00459N000_evt2.fits \ acishetg/acism00459_000N000_bpix1.fits \ /tmp/acism00459N000 ==> mkgarf_hetgs automatically does the steps asp_apply_sim, asphist, mkgarf one per chips on the correct chips and runs dmarfadd ==> note about RMF used to get the ARF grid ONLY! could have used any other fits/ascii file or explicit expression to get the energy grid prism acishetg/ARF/acism00459N000HEG_-1_garf.fits click on energ_lo/bin_lo and specresp quicklook plot same thing for heg+1,meg-1,meg+1 4. fit in sherpa ===> fit is done on full resolution HEG and MEG +1 and -1 orders simultaneously for source and background. ===> background is read automatically from the data ===> for faster/better fit grouped data could be used too ===> only ARF is needed for Chandra grating data, but grating RMF could be used too. sherpa set plot noerrorbars paramprompt off #READING DATA data acishetg/acism00459N000_pha2.fits #READING RESPONSES rsp[hegm1] rsp[hegp1] rsp[megm1] rsp[megp1] hegm1.arf =acishetg/ARF/acism00459N000HEG_-1_garf.fits hegp1.arf =acishetg/ARF/acism00459N000HEG_1_garf.fits megm1.arf =acishetg/ARF/acism00459N000MEG_-1_garf.fits megp1.arf =acishetg/ARF/acism00459N000MEG_1_garf.fits #ASSIGNING RESPONSES instrument 3 = hegm1 instrument 4 = hegp1 instrument 9 = megm1 instrument 10= megp1 lp 4 data 3 data 4 data 9 data 10 analysis ignore allsets all #NOTICING WAVELENGTHS OF INTEREST notice 3 wave 1.2 : 15 notice 4 wave 1.2 : 15 notice 9 wave 2.5:31 notice 10 wave 2.5:31 #DEFINING MODEL (broken power law, interstellar absorption, power law) bpl[bplmh](0.4,-0.03,13.19,8,0.00211901) pow[powbkgmh](0.2,8,2.11438e-05) atten[abs](1.81e20,0.1,0.01) freeze abs #ASSIGNING MODEL TO SOURCE source 3,4,9,10 = abs*bplmh #ASSIGNING MODEL TO BACKGROUND background 3,4,9,10 = abs*powbkgmh statistic chi gehrels show #FITTING fit #takes about 20 minutes on an Ultra 5 CTRL-C use DEMO/sherpafit lp 4 fit 3 fit 4 fit 9 fit 10 split gap 0.04 d all xlabel "" d 4 xlabel "Wavelenght(\AA)" d 4 xlabel size 1.5 d all tickvals 1.01 d all ylabel "" d 3 label -2.2 0.1 "Counts/cm^2/\AA" l 1 angle 90 l 1 yellow l 1 size 1.5 title "3c273 HEG/MEG -1/+1 orders simultaneously" d 1 label 12 0.15 "HEG-1" l 1 red d 2 label 12 0.15 "HEG+1" l 1 red d 3 label 26 0.2 "MEG-1" l 2 red d 4 label 26 0.2 "MEG+1" l 1 red redraw quit 5. different approach: working on co-added and grouped spectra for each order separately scripts/add_grating_orders acishetg/acism00459N000_pha2.fits 1 HEG acishetg/ARF/acism00459N000HEG_-1_garf.fits acishetg/ARF/acism00459N000HEG_1_garf.fits BIN 10 /tmp/newspec ===> add_grating_orders is a script which uses a combination of ciao2.0 tools (dmtype2split, dmpaste, dmtcalc, dmgroup, dmcopy) to create two fits files: a coadded, grouped spectrum, a coadded Effective Area ===> spectrum and effective area can be read directly in sherpa sherpa paramprompt off data /tmp/newspec_HEG_1_BIN10.pha lp data rsp[heg1] heg1.arf=/tmp/newspec_HEG_1.arf instrument=heg1 lp data atten[abs](1.81e20,0.1,0.01) freeze abs bpl[bpl1](1,1,7,13.9,0.0017) source=abs*bpl1 fit #takes approximately 2 minutes on a Ultra 5 CTRL-C use DEMO/groupedfit lp fit ylabel "Flux (phot/cm^2/\AA)" xlabel "Wavelength (\AA)" lim x 1.5 5 redraw