Polarimetric Analysis Walkthrough#

contact: menglei.zhou@astro.uni-tuebingen.de, honghui.liu@uni-tuebingen.de

0. Prerequisites#

  1. Installation of the IXPE calibration database.

$ cd $CALDB   
$ wget https://heasarc.gsfc.nasa.gov/FTP/caldb/data/ixpe/gpd/goodfiles_ixpe_gpd_20250225.tar.gz   
$ wget https://heasarc.gsfc.nasa.gov/FTP/caldb/data/ixpe/xrt/goodfiles_ixpe_xrt_20241028.tar.gz
  1. Installation of ixpeobssim package using pip: pip install ixpeobssim. Note: Since ixpeobssim includes instrumental response files updated only until 2024-07-01, we recommend using the IXPE tools provided in HEASoft when processing observations taken after 2025-01-01.

2. Some theoretic backgrounds:#

2.1. How do we detect X-ray polarization?#

The distribution of emitting angle of the photoelectrons follows:

\[ f(\psi) = \frac{1}{2 \pi} (1 + p_0 \mu \cos (2 (\psi - \psi_0))) \, , \]

where \(p_0\) is the true polarization fraction, \(\psi_0\) is the true polarization angle, and \(\mu\) is the (energy-dependent) modulation factor.

2.2. Stokes Parameters#

\[\begin{split} \begin{align} S_0 = I &= \langle E_x^2 + E_y^2 \rangle \, , \\ S_1 = Q &= \langle E_x^2 - E_y^2 \rangle \, , \\ S_2 = U &= \langle 2 E_x E_y \cos \delta \rangle \, , \\ S_3 = V &= \langle 2 E_x E_y \sin \delta \rangle \, . \end{align} \end{split}\]

\(\delta\) is the lag of \(E_y\) behind \(E_x\).

For a linearly polarized light, \(\delta = 0\), \(U = 2 E_x E_y\), \(V = 0\). (See Kislat et al. 2015)

For a single event, \(E_x = |\overrightarrow{E}| \cdot \cos \chi\), \(E_y = |\overrightarrow{E}| \cdot \sin \chi\), where \(|\overrightarrow{E}|\) is the strength of the electrical field.

With some simple arithmetics, we find:

\[\begin{split} \begin{align} I &= |E|^2 \cdot (\cos^2 \chi + \sin^2 \chi) = |E|^2 \cdot 1 = |E|^2 \, , \\ Q &= |E|^2 \cdot (\cos^2 \chi - \sin^2 \chi) = |E|^2 \cdot \cos (2 \chi) \, , \\ U &= |E|^2 \cdot (2 \sin \chi \cos \chi) = |E|^2 \cdot \sin (2 \chi) \, . \end{align} \end{split}\]

For an observation with multiple photon events, the Stokes parameters are additive and will follow normal distributions.

Here we introduce the normalized Stokes parameters:

\[\begin{split} \begin{align} i &= \frac{I}{|E|^2} = 1 \\ q &= \frac{Q}{I} = \cos (2 \chi) \\ u &= \frac{U}{I} = \sin (2 \chi) \end{align} \end{split}\]
\[\begin{split} \begin{align} I &= \sum_{k = 1}^{N} i_k = N \\ Q &= \sum_{k = 1}^{N} q_k \\ U &= \sum_{k = 1}^{N} u_k \end{align} \end{split}\]

\(\text{PD} = \sqrt{Q^2 + U^2}/{I} \, , \quad \text{PA} = 0.5 \times \arctan (U/Q) \, .\)

Instead of collecting the PAs of each photon, it is more accurate and convenient to record the Stokes parameters of each photon.

2.3. The event list file of IXPE#

3. Dealing with image and background#

3.1. Defining the source region and the background region using DS9#

Source region: a circular region with a radius of 80 arcsec.

Background region: an annular region with an inner radius of 120 arcsec and an outer radius of 240 arcsec.

3.2. Background rejection and subtraction#

Please refer to Di Marco et al. (2023) for further details.

Background rejection := applying selection criteria to determine whether a photon event in the event list is of background origin. See aledimarco/IXPE-background.

Background subtraction := incorporating background spectra in XSPEC, or subtracting the background Stokes parameters when using pcube or ixpepolarization.

$ python filter_background.py ixpe02004001_det1_evt2_v01.fits ../event_l1/ixpe02004001_det1_evt1_v01.fits.gz --output rej
$ python filter_background.py ixpe02004001_det1_evt2_v01.fits ../event_l1/ixpe02004001_det1_evt1_v01.fits.gz --output bkg

From this example, we see that even after background rejection, background subtraction can still be applied…

4. The model-independent method: pcube and ixpepolarization#

4.1. The pcube method provided by the ixpeobssim package#

  1. First step: region filtering

$ xpselect --suffix src --regfile src.reg ixpe02004001_det1_evt2_v01.fits
$ xpselect --suffix src --regfile src.reg ixpe02004001_det2_evt2_v01.fits
$ xpselect --suffix src --regfile src.reg ixpe02004001_det3_evt2_v01.fits

$ xpselect --suffix bkg --regfile bkg.reg ixpe02004001_det1_evt2_v01.fits
$ xpselect --suffix bkg --regfile bkg.reg ixpe02004001_det2_evt2_v01.fits
$ xpselect --suffix bkg --regfile bkg.reg ixpe02004001_det3_evt2_v01.fits

and we now have region-filtered event list files for 3 DUs.

Please use ds9 to check the shape of the filtered event files!

  1. run xpbin to calculate the polarization degree (PD) and polarization angle (PA)

$ xpbin --algorithm PCUBE --irfname ixpe:obssim20230101_alpha075:v13 --acceptcorr True --ebins 1 --weights True --weightcol W_MOM ixpe02004001_det1_evt2_v01_src.fits
$ xpbin --algorithm PCUBE --irfname ixpe:obssim20230101_alpha075:v13 --acceptcorr True --ebins 1 --weights True --weightcol W_MOM ixpe02004001_det2_evt2_v01_src.fits
$ xpbin --algorithm PCUBE --irfname ixpe:obssim20230101_alpha075:v13 --acceptcorr True --ebins 1 --weights True --weightcol W_MOM ixpe02004001_det3_evt2_v01_src.fits

The argument of irfname:

if weights=False and greyfilter=False, irfname=ixpe:obssim20230101:v13;

if weights=True and greyfilter=False, irfname=ixpe:obssim20230101_alpha075:v13;

if weights=False and greyfilter=True, irfname=ixpe:obssim20230101_grey:v13;

if weights=True and greyfilter=True, irfname=ixpe:obssim20230101_alpha075_grey:v13;

Possible dates: 20211209, 20220702, 20230101, 20230702, 20240101, 20240701.

For example, if your observation was conducted between 2 February 2023 and 8 February 2023, the appropriate date for the instrumental response file is 20230101.

4.2. The ixpepolarization tool#

Please see https://heasarc.gsfc.nasa.gov/docs/software/lheasoft/help/ixpepolarization.py.html for further details.

$ ixpepolarization infile1=ixpe02004001_det1_evt2_v01.fits infile2=ixpe02004001_det2_evt2_v01.fits infile3=ixpe02004001_det3_evt2_v01.fits regfile=src.reg weight_scheme=neff outfile=- clobber=yes

$ ixpeplot_polarization infile=ixpepolarization_out.fits

5. The model-dependent method: extracting IXPE spectra and fitting in Xspec#

5.3. Fitting the IXPE spectra in Xspec#

XSPEC12>

data 1:1 ixpe_det1_src_I_grp.pha
data 1:2 ixpe_det1_src_Q_grp.pha
data 1:3 ixpe_det1_src_U_grp.pha
data 2:4 ixpe_det2_src_I_grp.pha
data 2:5 ixpe_det2_src_Q_grp.pha
data 2:6 ixpe_det2_src_U_grp.pha
data 3:7 ixpe_det3_src_I_grp.pha
data 3:8 ixpe_det3_src_Q_grp.pha
data 3:9 ixpe_det3_src_U_grp.pha

(background subtraction is optional, depending on the brightness of the source)

backgrnd 1 ixpe_det1_bkg_I.pha
backgrnd 2 ixpe_det1_bkg_Q.pha
backgrnd 3 ixpe_det1_bkg_U.pha
backgrnd 4 ixpe_det2_bkg_I.pha
backgrnd 5 ixpe_det2_bkg_Q.pha
backgrnd 6 ixpe_det2_bkg_U.pha
backgrnd 7 ixpe_det3_bkg_I.pha
backgrnd 8 ixpe_det3_bkg_Q.pha
backgrnd 9 ixpe_det3_bkg_U.pha

ignore 1-9: **-2.0 8.0-**
model constant*TBabs*(powerlaw*polconst + gaussian*polconst)