<p>PI files, or more commonly PHA files, are higher level data products derived by binning the (cleaned) event list by the registered PI/PHA channel of each event, which should correspond to their energy. Therefore, PHA/PI files contain the spectra of a given source.</p>
<p>This binning, however, removes the information when each event was detected, which makes it impossible to generate a light-curve from a PI/PHA file.</p>
<p>If you want the light-curve you have to go back to the event-list and perform a binning not by PI/PHA channel but by time (while accounting for GTI intervals).</p>
<p>Usually the different X-ray missions provide the necessary tools that perform these different binnings for you. In case of Chandra this would be e.g. <em>dmextract</em>.</p>
<p>Chandra provides a bunch <a href="https://cxc.harvard.edu/ciao/guides/" rel="noreferrer">guides</a> how to do all that. And for anyone new to X-ray astronomy their <a href="https://cxc.harvard.edu/cdo/xray_primer.pdf" rel="noreferrer">primer</a> is also highly recommended.</p>
<p>Alternatively, you can only avoid this if you already have, say, a PI-file for every time bin your are interested in. Say, a PI file for each 100s period of your observation. In that case you can get the count-rate for each PI file by first summing up all the counts in the individual spectral bins and dividing them by the total exposure time (which should be a FITS keyword in the header, or can be derived from the GTI file). Alternatively you could fit the spectrum of each PI-file and derive the flux over time, which might be physically more interesting, but also more work.</p>

CC BY-SA 4.0
2024-05-06T19:13:40.457Z
What ***are*** PI, PHA, and GTI? [Pulse invariant](https://heasarc.gsfc.nasa.gov/docs/nicer/analysis_threads/gain-cal/) (whatever that is), [pulse height analyzer](https://heasarc.gsfc.nasa.gov/docs/nicer/analysis_threads/gain-cal/) (whatever that is), and [good time interval](https://cxc.cfa.harvard.edu/ciao/dictionary/gti.html) (whatever that is)?
Peter Mortensen
CC BY-SA 4.0
2024-05-06T19:29:28.150Z
PI & PHA is explained the the X-ray Data Primer that is linked above and Good Time Intervals (GTIs) just tell you when your detector was switched on and actually receptive to incoming photons.
SpaceCore
CC BY-SA 4.0
2024-05-06T14:19:06.230Z
2024-05-06T14:19:06.230Z
SpaceCore
<p>I am working with <a href="https://en.wikipedia.org/wiki/Chandra_X-ray_Observatory" rel="nofollow noreferrer">Chandra</a> data. I only have the corrected PI files for the sources. Is there a way to plot the light curve from this PI file. I wanted to extract the color magnitude ultimately.</p>

<light-curve><x-ray><chandra>
Light curves for Chandra
Walker
# Light curves for Chandra

(Asked by: username_0 on 2024-05-06)

I am working with [Chandra](https://en.wikipedia.org/wiki/Chandra_X-ray_Observatory) data. I only have the corrected PI files for the sources. Is there a way to plot the light curve from this PI file. I wanted to extract the color magnitude ultimately.

**Tags:** light-curve, x-ray, chandra

---

## 1 answers

### Answer by username_1 on 2024-05-06. Score: 8

PI files, or more commonly PHA files, are higher level data products derived by binning the (cleaned) event list by the registered PI/PHA channel of each event, which should correspond to their energy. Therefore, PHA/PI files contain the spectra of a given source.

This binning, however, removes the information when each event was detected, which makes it impossible to generate a light-curve from a PI/PHA file.

If you want the light-curve you have to go back to the event-list and perform a binning not by PI/PHA channel but by time (while accounting for GTI intervals).

Usually the different X-ray missions provide the necessary tools that perform these different binnings for you. In case of Chandra this would be e.g. *dmextract*.

Chandra provides a bunch [guides](https://cxc.harvard.edu/ciao/guides/) how to do all that. And for anyone new to X-ray astronomy their [primer](https://cxc.harvard.edu/cdo/xray_primer.pdf) is also highly recommended.

Alternatively, you can only avoid this if you already have, say, a PI-file for every time bin your are interested in. Say, a PI file for each 100s period of your observation. In that case you can get the count-rate for each PI file by first summing up all the counts in the individual spectral bins and dividing them by the total exposure time (which should be a FITS keyword in the header, or can be derived from the GTI file). Alternatively you could fit the spectrum of each PI-file and derive the flux over time, which might be physically more interesting, but also more work.

> **Comments:**
> **username_2**: What ***are*** PI, PHA, and GTI? [Pulse invariant](https://heasarc.gsfc.nasa.gov/docs/nicer/analysis_threads/gain-cal/) (whatever that is), [pulse height analyzer](https://heasarc.gsfc.nasa.gov/docs/nicer/analysis_threads/gain-cal/) (whatever that is), and [good time interval](https://cxc.cfa.harvard.edu/ciao/dictionary/gti.html) (whatever that is)?  
> **username_1**: PI & PHA is explained the the X-ray Data Primer that is linked above and Good Time Intervals (GTIs) just tell you when your detector was switched on and actually receptive to incoming photons.  

---

