Lightcurve Project¶
Hello, and welcome to the lightcurve documentation. So far it’s pretty useless, but hopefully it makes you feel better that it at least exists.

Contents:¶
Installation instructions¶
Install via Anaconda¶
Note
If you do not have Anaconda, please follow the instructions here to install it, or scroll down for manual installation of lightcurve.
After you have anaconda setup, then you can install lightcurve by specifying the channel in your install command:
$ conda install --channel justincely lightcurve
Install from source¶
Refstis can also be installed manually using the source code:
$ git clone https://github.com/spacetelescope/lightcurve.git
$ cd lightcurve
$ python setup.py install
Simple extraction¶
Performing a basic lightcurve extraction from either COS or STIS individual
datasets is achieved by a simple call to read()
as shown below.
>>> import lightcurve
>>> table = lightcurve.read('lbova4b2q_corrtag_a.fits')
This returns the extracted data as an Astropy Table, which can be used for further analysis and plotting.
>>> type(lc)
astropy.table.table.Table
>>> lc
<Table length=750>
dataset background mjd error bins ... flux signal_to_noise counts gross net
float64 float32 float64 float32 float64 ... float64 float32 float32 float32 float64
------- ---------- ------------- ------- ------- ... -------------- --------------- ------- ------- -------------
1.0 12.7314 55899.6041542 46.6337 1.0 ... 0.154727564001 46.3607 2149.24 2161.97 2149.23583984
1.0 15.3585 55899.6041658 45.9691 1.0 ... 0.149929073704 45.635 2082.44 2097.8 2082.44238281
1.0 11.119 55899.6041774 45.537 1.0 ... 0.147685074003 45.2928 2051.38 2062.5 2051.3815918
1.0 16.2978 55899.6041889 45.5294 1.0 ... 0.146895813966 45.1715 2040.33 2056.63 2040.33349609
...
Instrument-specific extraction¶
More specific tailored extractions for each instrument can be seen on their respective pages below. These detail specific options for extracion, as well as how to setup parameters and reference files.
Extracting COS data¶

Reference API¶
Utility functions for extracting COS spectral data into lightcurves
Functions¶
extract (filename, **kwargs) |
Extract lightcurve from COS dataset |
collect_inputs (filename) |
Populate HDU dictionary from available corrtag files |
get_both_filenames (filename) |
Get a list of both filenames for FUV data |
get_extraction_region (hdu, segment[, mode]) |
Get y_start,y_end for given extraction |
Extracting STIS data¶

Reference API¶
Utility functions for extracting STIS spectral data into lightcurves
Functions¶
extract (filename, **kwargs) |
Extract lightcurve from STIS dataset |
stis_corrtag (tagfile[, clean]) |
Create a COS-like corrtag file for STIS data |
map_image |
|
epsilon (tagfile) |
Compute the total epsilon factor for each event |
dqinit (tagfile) |
Compute the data quality information for each pixel from the BPIXTAB. |
Complete API¶
lightcurve.io¶
Library of I/O routines to get data into a LightCurve object.
Functions¶
check_filetype (filename) |
Determine the type of data being input. |
read ([source]) |
|
composite (filelist, output[, trim]) |
Creates a composite lightcurve from files in filelist and saves it to the save_loc. |
prepare_header (filename, filelist[, override]) |
Prepare headers with MAST requirements |
lightcurve.cos¶
Utility functions for extracting COS spectral data into lightcurves
Functions¶
extract (filename, **kwargs) |
Extract lightcurve from COS dataset |
collect_inputs (filename) |
Populate HDU dictionary from available corrtag files |
get_both_filenames (filename) |
Get a list of both filenames for FUV data |
get_extraction_region (hdu, segment[, mode]) |
Get y_start,y_end for given extraction |
lightcurve.stis¶
Utility functions for extracting STIS spectral data into lightcurves
Functions¶
extract (filename, **kwargs) |
Extract lightcurve from STIS dataset |
stis_corrtag (tagfile[, clean]) |
Create a COS-like corrtag file for STIS data |
map_image |
|
epsilon (tagfile) |
Compute the total epsilon factor for each event |
dqinit (tagfile) |
Compute the data quality information for each pixel from the BPIXTAB. |
lightcurve.utils¶
General purpose utility functions
Functions¶
expand_refname (refname) |
Expand header reference file name to full path if $ is present. |
enlarge (a[, x, y]) |
Enlarges 2D image array a using simple pixel repetition in both dimensions. |
is_uniq (values) |
Check if input items are unique |
Coding API¶
Issue Reporting¶
If you find bugs, problems, or even new features that you’d like to see, please report it on the github issue tracker.
Citing¶
TODO