Light Curves

lightcurve() can be used to fit a source in a sequence of time bins.

Examples

# Generate a lightcurve with two bins
lc = gta.lightcurve('sourceA', nbins=2)

# Generate a lightcurve with 1-week binning
lc = gta.lightcurve('sourceA', binsz=86400.*7.0)

Reference/API

GTAnalysis.lightcurve(name, **kwargs)

Generate a lightcurve for the named source. The function will complete the basic analysis steps for each bin and perform a likelihood fit for each bin. Extracted values (along with errors) are Integral Flux, spectral model, Spectral index, TS value, pred. # of photons.

Parameters:
  • name (str) – source name
  • binsz (float) – Set the lightcurve bin size in seconds, default is 1 day.
  • nbins (int) – Set the number of lightcurve bins. The total time range will be evenly split into this number of time bins.
  • time_bins (list) – Set the lightcurve bin edge sequence in MET. When defined this option takes precedence over binsz and nbins.
  • free_radius (float) – Free normalizations of background sources within this angular distance in degrees from the source of interest.
  • free_sources (list) – List of sources to be freed. These sources will be added to the list of sources satisfying the free_radius selection
Returns:

LightCurve – Dictionary containing output of the LC analysis

Return type:

dict