Extract CXO Data (extract-chandra)#
Pipeline module to generate Chandra images, PSF maps, source/background
regions, and extracted spectra from a Chandra X-ray Observatory (CXO)
evt2 event file.
Automates the standard CIAO workflow:
Locate the user’s Conda environment.
Locate the appropriate aspect solution (
.asol1.fits) and mask (.msk1.fits) files.Convert the requested RA/Dec to SKY coordinates with
dmcoordswhen auto-generating regions.Run
dmcopyto make a filtered image.Create a PSF map with
mkpsfmap.If source/background regions are not supplied, run
wavdetectand auto-create physical/SKY regions.If source/background regions are supplied but are not physical regions, convert simple
fk5/icrscircle or annulus regions to physical/SKY coordinates.Run
specextractto build source and background spectra.
Auto-region behavior#
If --src-reg and --bkg-reg are not supplied:
--raand--decare required.
wavdetectis run on the image cutout.If one or more
wavdetectdetections fall within--detect-match-radiusof the input RA/Dec, the closest detection is used as the source center.The selected center is converted to physical/SKY
X,Yusingdmcoords.A circular source region is written with radius
--src-radius.A background annulus is written with inner radius
--bkg-innerand outer radius--bkg-outer.By default,
--bkg-inneris set to--src-radius.If a
wavdetectdetection falls inside the background annulus, the annulus is replaced by a circular background region with radius--bkg-circle-radius.
Default auto-region values:
--detect-match-radius 5arcsec
--src-radius 2arcsec
--bkg-innerdefaults to--src-radius
--bkg-outer 45arcsec
--bkg-circle-radiusdefaults to--bkg-outer
Existing-region behavior#
If --src-reg and --bkg-reg are supplied:
--raand--decare not required.Existing physical regions are used directly.
Simple celestial
fk5oricrscircleandannulusregions are converted to physical/SKY regions before runningspecextract.If no RA/Dec is supplied, the script makes a full-field image instead of a centered cutout.
Supported region shapes for automatic conversion:
circle(ra,dec,radius)
annulus(ra,dec,r_in,r_out)
Positional arguments#
COND_ENVName of the Conda environment to check against
$CONDA_DEFAULT_ENV.EVT_FILEPath to the Chandra
evt2event file.
Options#
--src-reg SRC_REGExisting source region file.
--bkg-reg BKG_REGExisting background region file.
--outdir OUTDIROutput directory. Defaults to the event file directory.
--ra RASource RA in degrees. Required only when auto-generating regions.
--dec DECSource Dec in degrees. Required only when auto-generating regions.
--src-radius SRC_RADIUSAuto source radius in arcsec. Default:
2.--bkg-inner BKG_INNERAuto background annulus inner radius in arcsec. Defaults to
--src-radius.--bkg-outer BKG_OUTERAuto background annulus outer radius in arcsec. Default:
45.--bkg-circle-radius BKG_CIRCLE_RADIUSCircular background radius in arcsec, used when a detection falls inside the proposed background annulus. Defaults to
--bkg-outer.--detect-match-radius DETECT_MATCH_RADIUSMatch radius in arcsec for choosing a
wavdetectsource as the region center. Default:5.--wav-scales WAV_SCALESwavdetectwavelet scales in image pixels. Default:"1 2 4 8".--wav-sigthresh WAV_SIGTHRESHwavdetectsignificance threshold. Default:1e-6.--cutout-size CUTOUT_SIZEImage cutout size in SKY pixels when RA/Dec are supplied. Default:
512.--bin-size BIN_SIZEImage bin size in SKY pixels. Default:
1.--emin EMINMinimum ACIS energy in eV. Default:
500.--emax EMAXMaximum ACIS energy in eV. Default:
8000.--ccd-id CCD_IDCCD ID filter. If omitted for ACIS energy-filtered data, defaults to
7.--no-energy-filterDisable energy filtering. This should be used for HRC event files.
--psf-energy PSF_ENERGYEnergy for
mkpsfmapin keV. Default:1.4967.--ecf ECFEncircled counts fraction for
mkpsfmap. Default:0.90.
Output files#
Inside OUTDIR:
evt_img.fits
evt_psfmap.fits
wavdetect_src.fitswhen auto-generating regions
source.reg
bkg.reg
spec{obsid}.arf
spec{obsid}.rmf
spec{obsid}.pi
spec{obsid}.corr.arf
spec{obsid}_bkg.arf
spec{obsid}_bkg.rmf
spec{obsid}_bkg.pi
spec{obsid}_grp.pi
Note
Assuming that the event file is inside obsid/primary/event.fits, the
obsid is taken from the parent of the parent directory of the event file.
Usage formula#
Auto regions:
extract-chandra <COND_ENV> <EVT_FILE> --ra <RA> --dec <DEC> [OPTIONS]
Existing regions:
extract-chandra <COND_ENV> <EVT_FILE> --src-reg <SRC_REG> --bkg-reg <BKG_REG> [OPTIONS]
Usage examples#
HRC, auto regions:
extract-chandra ciao-4.18 hrc_evt2.fits \
--ra 10.83625 \
--dec 41.30911 \
--outdir . \
--no-energy-filter \
--cutout-size 512 \
--bin-size 1
HRC, existing regions:
extract-chandra ciao-4.18 hrc_evt2.fits \
--src-reg source.reg \
--bkg-reg bkg.reg \
--outdir . \
--no-energy-filter \
--bin-size 1
ACIS, auto regions:
extract-chandra ciao-4.18 acis_evt2.fits \
--ra 10.83625 \
--dec 41.30911 \
--outdir . \
--emin 500 \
--emax 8000 \
--cutout-size 512 \
--bin-size 1
ACIS, existing regions:
extract-chandra ciao-4.18 acis_evt2.fits \
--src-reg source.reg \
--bkg-reg bkg.reg \
--outdir . \
--emin 500 \
--emax 8000 \
--bin-size 1
- Requirements:
CIAO (including
dmcopy,mkpsfmap,specextract,wavdetect,dmcoords) installed.CONDA_DEFAULT_ENVset to the requested environment name.XSNAPmust also be installed inCONDA_ENV.