lc API

The lc subpackage gives tools to create light curves from proto-Lightspeed data.

class lightspeedpy.lc.Lightcurve(edges, flux, exposures, eph, data_set)

Bases: object

Class to store light curves and save them

Parameters:
  • edges (array-like) – Edges of the phase bins of the light curve

  • fluxes (array-like) – Flux in each light curve bin. If edges has length N+1, fluxes should have length N

  • exposures (array-like) – Time in seconds spent in each bin

  • duration (array-like) – Duration of each frame, in seconds

  • eph (Ephemeris) – Target ephemeris

save(filename, clobber=False, save_kwargs=None)

Save the light curve to a file

Parameters:
  • filename (str) – The file name to which the light curve should be saved

  • clobber (bool, optional) – Set to True to allow overwriting

  • save_kwargs (dict, optional) – Dictionary of keywords to write to the light curve header

lightspeedpy.lc.get_clipped_lc(data_set, n_bins, reg_file, ephemeris)

Get the light curve of a source by summing all the detected photons per frame, clipped to zero or 1

Parameters:
  • data_set (DataSet) – The data set of the observation

  • n_bins (int) – Number of light curve bins to use

  • reg_file (str) – The ciao-format, physical coordinate region file containing the source

  • ephemeris (Ephemeris) – The source ephemeris

Returns:

The light curve object, corrected for quantum efficiency TODO

Return type:

Lightcurve

lightspeedpy.lc.get_summed_lc(data_set, n_bins, reg_file, ephemeris)

Get the light curve of a source by summing all the detected photons per frame

Parameters:
  • data_set (DataSet) – The data set of the observation

  • n_bins (int) – Number of light curve bins to use

  • reg_file (str) – The ciao-format, physical coordinate region file containing the source

  • ephemeris (Ephemeris) – The source ephemeris

Returns:

The light curve object, corrected for quantum efficiency TODO

Return type:

Lightcurve

lightspeedpy.lc.get_weighted_lc_linearized(data_set, image, n_bins, reg_file, ephemeris)

Get the light curve of a source by summing all the detected photons per frame after weighting by the probability of each being real. This function assumes that the true number of photons expected per pixel is << 1. This function can also do PSF-weighted photometry.

Parameters:
  • data_set (DataSet) – The data set of the observation

  • image (array-like or None) – image of PSF weights to use. Set to None to not use PSF weights.

  • n_bins (int) – Number of light curve bins to use

  • reg_file (str) – The ciao-format, physical coordinate region file containing the source

  • ephemeris (Ephemeris) – The source ephemeris

Returns:

The light curve object, corrected for quantum efficiency TODO

Return type:

Lightcurve