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-regand--bkg-regare 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.
- If one or more
- The selected center is converted to physical/SKY
X,Yusing dmcoords.
- The selected center is converted to physical/SKY
A circular source region is written with radius
--src-radius.- A background annulus is written with inner radius
--bkg-innerand outer radius
--bkg-outer.
- A background annulus is written with inner radius
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.
- If a
- If
- 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-regand--bkg-regare supplied: --raand--decare not required.Existing physical regions are used directly.
- Simple celestial
fk5oricrscircleandannulusregions are converted to physical/SKY regions before running
specextract.
- Simple celestial
- 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)
- If
- Positional arguments:
COND_ENV: Name of the Conda environment to check against$CONDA_DEFAULT_ENV.EVT_FILE: Path to the Chandraevt2event file.
- Options:
--src-reg SRC_REG: Existing source region file.--bkg-reg BKG_REG: Existing background region file.--outdir OUTDIR: Output directory. Defaults to the event file directory.--ra RA: Source RA in degrees. Required only when auto-generating regions.--dec DEC: Source Dec in degrees. Required only when auto-generating regions.--src-radius SRC_RADIUS: Auto source radius in arcsec. Default:2.--bkg-inner BKG_INNER: Auto background annulus inner radius in arcsec. Defaults to--src-radius.--bkg-outer BKG_OUTER: Auto background annulus outer radius in arcsec. Default:45.--bkg-circle-radius BKG_CIRCLE_RADIUS: Circular background radius in arcsec, used when a detection falls inside the proposed background annulus. Defaults to ---bkg-outer.--detect-match-radius DETECT_MATCH_RADIUS:
Match radius in arcsec for choosing a
wavdetectsource as the region center. Default:5.--wav-scales WAV_SCALES:
wavdetectwavelet scales in image pixels. Default:"1 2 4 8".--wav-sigthresh WAV_SIGTHRESH:
wavdetectsignificance threshold. Default:1e-6.--cutout-size CUTOUT_SIZE:
Image cutout size in SKY pixels when RA/Dec are supplied. Default:
512.--bin-size BIN_SIZE:
Image bin size in SKY pixels. Default:
1.--emin EMIN
Minimum ACIS energy in eV. Default:
500.--emax EMAX
Maximum ACIS energy in eV. Default:
8000.--ccd-id CCD_ID:
CCD ID filter. If omitted for ACIS energy-filtered data, defaults to
7.--no-energy-filter:
Disable energy filtering. This should be used for HRC event files.
--psf-energy PSF_ENERGY:
Energy for
mkpsfmapin keV. Default:1.4967.--ecf ECF:
Encircled counts fraction for
mkpsfmap. Default:0.90.- Output files
- Inside
OUTDIR: evt_img.fitsevt_psfmap.fitswavdetect_src.fitswhen auto-generating regionssource.regbkg.regspec{obsid}.arfspec{obsid}.rmfspec{obsid}.pispec{obsid}.corr.arfspec{obsid}_bkg.arfspec{obsid}_bkg.rmfspec{obsid}_bkg.pispec{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.- Inside
- 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.