Previous topic

How to compute upper limits?

Next topic

How to generate a phase curve of a pulsar or a gamma-ray binary?

How to generate a light curve?ΒΆ

You can generate a light curve using the cslightcrv script which takes on input an event list or an observation definition file. Light curves cannot be generated from counts cubes since the time information is dropped in the generation of the counts cube.

cslightcrv divides the event list into a number of intervals and performs a maximum likelihood analyse for each of the intervals. The analysis results are writted into a light curve FITS file.

The following example illustrates how you can generate a light curve for Src001 for the time interval from 59236.810 to 59245.742 (MJD), corresponding to the dates from 2021-01-22 (19:26:51) to 2021-01-31 (17:48:51) (to convert dates to MJD and vice versa we suggest to use the xTime Date and Time Conversion Utility). The time interval is linearly divided into 100 time bins.

$ cslightcrv
Input event list or observation definition XML file [events.fits] obs_selected.xml
Input model definition XML file [$CTOOLS/share/models/crab.xml] models.xml
Source name [Crab] Src001
Algorithm for defining time bins (FILE|LIN|GTI) [GTI] LIN
Lightcurve start time (MJD) [51544.5] 59236.810
Lightcurve stop time (MJD) [51544.6] 59245.742
Number of time bins (1-10000) [5] 100
Number of energy bins for binned (0=unbinned) (0-100) [0]
Lower energy limit of events (TeV) [0.1]
Upper energy limit of events (TeV) [100.0]
Output light curve file [lightcurve.fits]

The resulting light curve is shown in the figure below. The gaps in the light curve correspond to time periods during which Src001 has not been observed.

../../../_images/howto_lightcurve.png

Light curve from 59236.810 to 59245.742 (MJD) for Src001

Note

The plot was created using the show_lightcurve.py script that is located in the ctools example folder. The example script requires the matplotlib Python module for display. You may reproduce the plot by typing

$ $CTOOLS/share/examples/python/show_lightcurve.py lightcurve.fits