eleanor Documentation


  • Created: 18 March, 2019
  • Update: 4 July, 2022

If you have any questions that are beyond the scope of this help file, Please feel free to open a GitHub Issue.

The purpose of eleanor is to go from TESS Full Frame Images (FFIs) to extracted and systematics-corrected light curves for any given star observed by TESS. In its simplest form, eleanor takes a TIC ID, a Gaia source ID, or (RA, Dec) coordinates of a star observed by TESS and returns, as a single object, a light curve and accompanying target pixel data. There's plenty of customizability along the way, though: you can examine intermediate data products, change the aperture used for light curve extraction, and much more. The quickstart tutorial goes through these procedures in more detail.


Installation

We have two primary ways to install eleanor

  1. Install through the Python Package Index (PyPI)
    pip install eleanor
  2. Install the developer's version on GitHub:
    git clone https://github.com/afeinstein20/eleanor
    cd eleanor
    python setup.py install

Data Products

NASA GSFC-eleanor-lite FITS Files

NASA GSFC-eleanor-lite are precomputed eleanor light curves for all stars in the TESS FFIs brighter than 16th magnitude, yielding a total of 150 million light curves from the TESS primary mission. The "lite" naming indicates that these files are saved in the eleanor-lite format, which has the following differences:

  1. Only the median target pixel file and error images are saved.
  2. Only saves the optimal aperture and associated light curve.
  3. Discards the raw, corrected, and flux errors of every aperture eleanor tests behind-the-scenes.
These data products are hosted as High Level Science Products (HLSPs) on MAST. The creation of these light curves was lead by Brian Powell. If you use these data products, please cite Powell et al. (2022).

Postcards

The TESS Full Frame Images are delivered to MAST as .FITS files for a given camera/CCD chip combination, one for every cadence. For each cadence there are then 16 FFIs, and data for a given target for a sector is spread across approximately 1300 FFIs. To reduce the burden of downloading and interacting with 1300 separate files to understand the light curve of one object, eleanor provides "postcards" which contain a smaller region of the detector, stacked for all cadences in a sector. These postcards then have the potential to contain many postage stamps, in order to analyze data from multiple targets simultaneously to better understand systematic effects in the data. When a request is submitted to eleanor to get data for a target, it downloads a postcard rather than every FFI, cuts the requested pixels that a target falls on, and produces a postage stamp and light curve from these data.

TargetData objects

The primary data product, that the typical user analyzing a single point source will likely interact with the most, is a TargetData object. This is the equivalent of a Kepler Target Pixel File and Light Curve all rolled into one. Saving this object records a FITS file. In the 0th extension, the pixel-level data is stored. Users might find this extension similar to a Kepler "target pixel" file. In the 1st extension is the light curve for eleanor's estimate of the optimal aperture for the target, both with and without accounting for instrumental systematics. Users might find this extension similar to a Kepler "light curve" file. The results found with other apertures are stored in additional extensions. If a target is observed for multiple sectors, eleanor will produce a target pixel file and light curve for the star for every sector that it is observed. Alternatively, the user can request data for only a specific sector.


Tutorial Video

Here is a short-ish 20 minute video walking through eleanor (created for online.tess.science).


Citing eleanor & dependencies

If you find eleanor useful for your work, please cite the following works:


Demo Notebooks

Here are some Jupyter Notebook tutorials to get you started with using eleanor! Each notebook comes with a table of contents. Click the link to see that section of code in the notebook.

Quickstart Tutorial


Tips, Tricks, & Hacks


Visualizing & Crossmatching Your Light Curves

We have introduced two new classes into the eleanor package! This first is eleanor.Visualize(), which provides diagnostic tools for you to use to understand your light curves. The second is eleanor.Crossmatch(), which checks if your target was observed at 2-minute cadence, if the light curve is available from the TASOC pipeline, and if the light curve is available from Oelkers & Stassun (difference imaging). We'll run through an example for both of these classes.


FAQ

Here are some frequently asked questions (FAQs) and their answers!

When you query an object, eleanor performs the following steps:
  1. Determines in which sectors this target was observed.
  2. Locates the object on TESS's many cameras/chips.
  3. Downloads a time series of "postcards" containing TESS data for the object and its immediate surroundings.
  4. Creates and stores a target pixel file (TPF) of the object.
  5. Traces centroid shifts for the object across the time series.
  6. Chooses an optimal pixel aperture for photometry.
  7. Creates a light curve using the chosen aperture and centroid trace.
  8. Performs basic systematics corrections on the light curve and stores it.
By default, eleanor delivers the systematics-corrected light curve of your source and the source's TPF. If you are happy with what you see there, you're done and ready to science!
If you want to dig a little bit deeper, eleanor delivers several other data products to help you do that. The TPF carries with it a trace of the source's centroid through time and a record of the aperture used, as well as light curves developed using other apertures, which may be more optimal for your specific science application. This makes it easier for you to check for possible issues and reproduce the analysis. eleanor also has tools to define your own aperture, visualize the light curve, and more. See the Quickstart Tutorial for examples.
Target pixel files are essentially a stack of images of the source, containing one image per observed FFI. They differ from postcards because they're only a few pixels on a side. For more information, see lightkurve. TPF objects in eleanor carry additional attributes: the centroid trace and the aperture used to create the light curve. Taken together, these provide all the information you need to reproduce the light curve.
eleanor is designed to save you, the user, from having to download the entire TESS FFIs to get at a small region of sky. To do this, eleanor produces "postcard" files which are more manageable subsets of each detector chip. These postcards can be downloaded and accessed through the eleanor :ref:`API `. Postcards also carry with them an associated pointing model.
The pointing model consists of a few simple parameters that describe how to go from TESS pixels to an accurate world coordinate system. eleanor optimizes this pointing model using bright stars across the detector. Most users will never need to touch the pointing model, though - its information gets encoded in the centroid trace for any given source.
By default, eleanor corrects the light curve by regressing out jitter correlated with the position of the telescope in time. Future versions of eleanor will include more advanced detrending that makes use of all sources on a given postcard or chip.
Here are a few things you can easily check on:
  • Are there changes in the object centroid coincident with the features?
  • Does the aperture choice make sense?
  • Are there blended background sources?
  • Do you see the same features in all apertures, or in other nearby stars at the same time?
If these checks don't turn up anything and you suspect a problem with the code, feel free to open a Git Issue.

API

eleanor.multi_sectors(sectors, tic=None, gaia=None, coords=None, name=None, tc=False, local=False, post_dir=None, pm_dir=None, metadata_path=None, tesscut_size=31)

Obtain a list of Source objects for a single target, for each of multiple sectors for which the target was observed.

Parameters
  • sectors (list or str) – The list of sectors for which data should be returned, or ‘all’ to return all sectors for which there are data.

  • tic (int, optional) – The TIC ID of the source.

  • gaia (int, optional) – The Gaia DR3 source_id.

  • coords (tuple, optional) – The (RA, Dec) coords of the object in degrees.

  • tc (bool, optional) – If True, use a TessCut cutout to produce postcards rather than downloading the eleanor postcard data products.

  • tesscut_size (int, array-like, astropy.units.Quantity) – The size of the cutout array, when tc is True. Details can be seen in astroquery.mast.TesscutClass.download_cutouts

class eleanor.Source(tic=None, gaia=None, coords=None, name=None, fn=None, sector=None, fn_dir=None, tc=False, local=False, post_dir=None, pm_dir=None, metadata_path=None, tesscut_size=31)

A single source observed by TESS.

Parameters
  • tic (int, optional) – The TIC ID of the source.

  • gaia (int, optional) – The Gaia DR3 source_id.

  • coords (tuple or astropy.coordinates.SkyCoord, optional) – The (RA, Dec) coords of the object in degrees or an astropy SkyCoord object.

  • name (str, optional) – The name of your target (e.g. “HD#####” or “M31”).

  • fn (str, optional) – Filename of a TPF corresponding to the desired source.

  • sector (int or str) – The sector for which data should be returned, or recent to obtain data for the most recent sector which contains this target.

  • tc (bool, optional) – If True, use a TessCut cutout to produce postcards rather than downloading the eleanor postcard data products.

  • tesscut_size (int, array-like, astropy.units.Quantity) – The size of the cutout array, when tc is True. Details can be checked in astroquery.mast.TesscutClass.download_cutouts

tess_mag

The TESS magnitude from the TIC.

Type

float

sector

Sector in which source was observed by TESS.

Type

int

camera

TESS camera on which source falls.

Type

int

chip

TESS chip on which source falls.

Type

int

position_on_chip

Predicted (x,y) coords of object center on chip.

Type

(int, int)

postcard

Name of the best postcard (postcard where source should be located closest to the center).

Type

str

position_on_postcard

Predicted (x, y) coords of object center on the above-named postcard. Does NOT take into account additional pointing corrections; these will be applied when making the TPF.

Type

(int, int)

all_postcards

Names of all postcards where the source appears.

Type

list of strs

locate_on_tess()

Finds the TESS sector, camera, chip, and position on chip for the source.

sector
Type

int

camera
Type

int

chip
Type

int

position_on_chip
Type

np.array

locate_postcard(local)

Finds the eleanor postcard, if available, this star falls on.

postcard
Type

str

postcard_bkg
Type

str

postcard_path
Type

str

position_on_postcard
Type

list

all_postcards
Type

list

mast_list
Type

astropy.table.Table

locate_with_tesscut()

Finds the best TESS postcard(s) and the position of the source on postcard.

postcard
Type

list

postcard_path
Type

str

position_on_postcard
Type

list

all_postcards
Type

list

sector
Type

int

camera
Type

int

chip
Type

int

position_on_chip
Type

np.array

search_tesscut(download_dir, coords)

Searches to see if the TESSCut cutout has already been downloaded.

tesscut_dir()

Creates a TESSCut directory in the hidden eleanor directory.

class eleanor.TargetData(source, height=13, width=13, save_postcard=True, do_pca=False, do_psf=False, bkg_size=None, aperture_mode='normal', cal_cadences=None, try_load=True, regressors=None, language='English')

Object containing the light curve, target pixel file, and related information for any given source.

Parameters
  • source (eleanor.Source) – The source object to use.

  • height (int, optional) – Height in pixels of TPF to retrieve. Default value is 13 pixels. Must be an odd number, or else will return an aperture one pixel taller than requested so target falls on central pixel.

  • width (int, optional) – Width in pixels of TPF to retrieve. Default value is 13 pixels. Must be an odd number, or else will return an aperture one pixel wider than requested so target falls on central pixel.

  • aperture_mode (str, optional) – If small, will only consider apertures 8 pixels in size or smaller. If large, will only consider apertures larger than 8 pixels in size. If all all apertures will be considered. If normal will test many different apertures, following rules based on the magnitude of the target star and the contamination ratio recorded in the TIC. small and large can often be useful for faint stars/stars in crowded fields or bright stars, respectively.

  • bkg_size (int, optional) – Size of box to use for background estimation. If not set, will default to the width of the target pixel file.

  • do_pca (bool, optional) – If true, will return a PCA-corrected light curve.

  • do_psf (bool, optional) – If true, will return a light curve made with a simple PSF model.

  • cal_cadences (tuple, optional) – Start and end cadence numbers to use for optimal aperture selection.

  • try_load (bool, optional) – If true, will search hidden ~/.eleanor directory to see if TPF has already been created.

  • regressors (numpy.ndarray or str) – Extra data to regress against in the correction. Should be shape (len(data.time), N) or ‘corner’. If ‘corner’ will use the four corner pixels of the TPF as extra information in the regression.

header

FITS header for saving/loading data.

Type

dict

source_info

Pointer to input source.

Type

eleanor.Source

aperture

Aperture to use if overriding default. To use default, set to None.

tpf

Target pixel file of fluxes; array with shape dimensions.

Type

np.ndarray

time

Time series.

Type

np.ndarray

post_obj

Pointer to Postcard objects containing this TPF.

Type

eleanor.Postcard

pointing_model

Table of matrices describing the transformation matrix from FFI default WCS and eleanor’s corrected pointing.

Type

astropy.table.Table

tpf_err

Errors on fluxes in tpf.

Type

np.ndarray

aperture_mode

Integer corresponding to the used aperture mode as input by the user.

Type

int

centroid_xs

Position of the source in x inferred from pointing model; has same length as time. Position is relative to the pixel coordinate system of the postcard.

Type

np.ndarray

centroid_ys

Position of the source in y inferred from pointing model; has same length as time. Position is relative to the pixel coordinate system of the postcard.

Type

np.ndarray

cen_x

Median x position of the source. Position is relative to the pixel coordinate system of the postcard.

Type

int

cen_y

Median y position of the source. Position is relative to the pixel coordinate system of the postcard.

Type

int

tpf_star_x

x position of the star on the TPF. Position is relative to the size of the TPF.

Type

int

tpf_star_y

y position of the star on the TPF. Position is relative to the size of the TPF.

Type

int

dimensions

Shape of tpf. Should be (time, height, width).

Type

tuple

all_apertures

List of aperture objects.

Type

list

aperture

Chosen aperture for producing raw_flux lightcurve. Format is array with shape (height, width). All entries are floats in range [0,1].

Type

array-like

all_flux_err

Estimated uncertainties on all_raw_flux.

Type

np.ndarray

all_raw_flux

All lightcurves extracted using all_apertures. Has shape (N_apertures, N_time).

Type

np.ndarray

all_corr_flux

All systematics-corrected lightcurves. See all_raw_flux.

Type

np.ndarray

best_ind

Index into all_apertures producing the best (least noisy) lightcurve.

Type

int

corr_flux

Systematics-corrected version of raw_flux.

Type

np.ndarray

flux_err

Estimated uncertainty on raw_flux.

Type

np.ndarray

raw_flux

Un-systematics-corrected lightcurve derived using aperture and tpf.

Type

np.ndarray

x_com

Position of the source in x inferred from TPF; has same length as time. Position is relative to the pixel coordinate system of the TPF.

Type

np.ndarray

y_com

Position of the source in y inferred from TPF; has same length as time. Position is relative to the pixel coordinate system of the TPF.

Type

np.ndarray

quality

Quality flag.

Type

int

Notes

save() and load() methods write/read these data to a FITS file with format:

Extension[0] = header

Extension[1] = (N_time, height, width) TPF, where n is the number of cadences in an observing run

Extension[2] = (3, N_time) time, raw flux, systematics corrected flux

bkg_subtraction(scope='tpf', sigma=2.5)

Subtracts background flux from target pixel file.

Parameters
  • scope (string, "tpf" or "postcard") – If tpf, will use data from the target pixel file only to estimate and remove the background. If postcard, will use data from the entire postcard region to estimate and remove the background.

  • sigma (float) – The standard deviation cut used to determine which pixels are representative of the background in each cadence.

center_of_mass()

Calculates the position of the source across all cadences using muchbettermoments and self.best_aperture.

Finds the brightest pixel in a (height, width) region summed up over all cadence. Searches a smaller (3x3) region around this pixel at each cadence and uses muchbettermoments to find the maximum.

corrected_flux(flux=None, skip=0.25, modes=3, pca=False, bkg=None, regressors=None)

Corrects for jitter in the light curve by quadratically regressing with centroid position. :param skip: The length of time in days at the start of each orbit to skip in determining optimal model weights.

Default is 0.62 days.

Parameters
  • modes (int, optional) – If doing a PCA-based correction, the number of cotrending basis vectors to regress against. Default is 3.

  • pca (bool, optional) – Allows users to decide whether or not to use PCA analysis. Default is False.

  • regressors (numpy.ndarray or str) – Extra data to regress against in the correction. Should be shape (len(data.time), N) or ‘corner’. If ‘corner’ will use the four corner pixels of the TPF as extra information in the regression.

create_apertures(height, width)

Creates a range of sizes and shapes of apertures to test.

custom_aperture(shape=None, r=0.0, h=0.0, w=0.0, theta=0.0, pos=None, method='exact')

Creates a custom circular or rectangular aperture of arbitrary size.

Parameters
  • shape (str, optional) – The shape of the aperture to be used. Must be either circle or rectangle.

  • r (float, optional) – If shape is circle the radius of the circular aperture to be used.

  • h (float, optional) – If shape is rectangle the length of the rectangular aperture to be used.

  • w (float, optional) – If shape is rectangle the width of the rectangular aperture to be used.

  • theta (float, optional) – If shape is rectangle the rotation of the rectangle relative to detector coordinate. Uses units of radians.

  • pos (tuple, optional) – The center of the aperture, in TPF coordinates. If not set, defaults to the center of the TPF.

  • method (str, optional) – The method of producing a light curve to be used, either exact, center, or subpixel. Passed through to photutils and used as intended by that package.

fetch_dir()

Returns the default path to the directory where files will be saved or loaded.

By default, this method will return “~/.eleanor” and create this directory if it does not exist. If the directory cannot be access or created, then it returns the local directory (“.”).

Returns

download_dir – Path to location of ffi_dir where FFIs will be downloaded

Return type

str

get_cbvs()

Obtains the cotrending basis vectors (CBVs) as convolved down from the short-cadence targets.

get_lightcurve(aperture=None)

Extracts a light curve using the given aperture and TPF. Can pass a user-defined aperture mask, otherwise determines which of a set of pre-determined apertures provides the lowest scatter in the light curve. Produces a mask, a numpy.ndarray object of the same shape as the target pixel file, which every pixel assigned a weight in the range [0, 1].

Parameters

aperture (numpy.ndarray) – (height, width) array of floats in the range [0,1] with desired weights for each pixel to create a light curve. If not set, ideal aperture is inferred automatically. If set, uses this aperture at the expense of all other set apertures.

get_time(coords)

Gets time, including light travel time correction to solar system barycenter for object given location

get_tpf_from_postcard(pos, postcard, height, width, bkg_size, save_postcard, source)

Gets TPF from postcard.

k2_correction(flux)

Remove any systematics that are correlated with spacecraft pointing, as inferred through telescope pointing model.

Parameters

flux (numpy.ndarray) – Flux array to which detrending applied.

load(directory=None, fn=None)

Loads in and sets all the attributes for a pre-created TPF file.

Parameters

directory (str, optional) – Directory to load file from.

psf_lightcurve(data_arr=None, err_arr=None, bkg_arr=None, nstars=1, model='gaussian', likelihood='gaussian', xc=None, yc=None, verbose=True, err_method=True, ignore_pixels=None)

Performs PSF photometry for a selection of stars on a TPF.

Parameters
  • data_arr (numpy.ndarray, optional) – Data array to fit with the PSF model. If None, will default to TargetData.tpf.

  • err_arr (numpy.ndarray, optional) – Uncertainty array to fit with the PSF model. If None, will default to TargetData.tpf_flux_err.

  • bkg_arr (numpy.ndarray, optional) – List of background values to include as initial guesses for the background model. If None, will default to TargetData.flux_bkg.

  • nstars (int, optional) – Number of stars to be modeled on the TPF.

  • model (string, optional) – PSF model to be applied. Presently must be gaussian, which models a single Gaussian. Will be extended in the future once TESS PRF models are made publicly available.

  • likelihood (string, optinal) – The data statistics given the parameters. Options are: ‘gaussian’ and ‘poisson’.

  • xc (list, optional) – The x-coordinates of stars in the zeroth cadence. Must have length nstars. While the positions of stars will be fit in all cadences, the relative positions of stars will be fixed following the delta values from this list.

  • yc (list, optional) – The y-coordinates of stars in the zeroth cadence. Must have length nstars. While the positions of stars will be fit in all cadences, the relative positions of stars will be fixed following the delta values from this list.

  • verbose (bool, optional) – If True, return information about the shape of the PSF at every cadence as well as the PSF-inferred centroid shape.

  • err_method (bool, optional) – If True, use the photometric uncertainties for each pixel in the TPF as delivered by the TESS team. Otherwise, each pixel takes an equal uncertainty. If err_arr is passed through instead, this setting is ignored.

  • ignore_pixels (int, optional) – If not None, ignore a certain percentage of the brightest pixels away from the source target, effectively masking other nearby, bright stars. This strategy appears to do a reasonable job estimating the background more accurately in relatively crowded regions.

save(output_fn=None, directory=None, lite=False)

Saves a created TPF object to a FITS file.

Parameters
  • output_fn (str, optional) – Filename to save output as. Overrides default naming.

  • directory (str, optional) – Directory to save file into.

  • lite (bool, optional) – Whether to only save the light curve and not the target pixel data. Will reduce file size by a factor of ~19x by removing all pixel information and all light curves except the optimal one selected by eleanor.

set_header(lite=False)

Defines the header for the TPF.

set_quality()

Reads in quality flags set in the postcard

stitch(objects, flux='corrected')

Stitches together basic light curve information from different eleanor.TargetData objects.

Parameters
  • objects (np.ndarray) – An array of eleanor.TargetData objects.

  • flux (str, optional) – The keyword for which flux to stitch together and return. Sectors will be normalized by itself. Default is ‘corrected’.

Returns

  • time (np.ndarray) – An array of stitched times.

  • flux (np.ndarray) – An array of stitched normalized fluxes.

  • quality (np.ndarray) – An array of stitched quality flags.

  • flux_err (np.ndarray) – An array of stitched flux errors.

to_lightkurve(flux=None, quality_mask=None)

Creates a lightkurve.lightcurve.LightCurve() object with eleanor attributes. All inputs have been quality masked.

Parameters
  • flux (np.ndarray, optional) – An array of flux. Default is eleanor.TargetData.corr_flux.

  • quality_mask (np.ndarray, optional) – An array of quality flags. Default is eleanor.TargetData.quality.

Returns

Return type

lightkurve.lightcurve.TessLightCurve object

class eleanor.Visualize(object, obj_type='tpf')

The main class for creating figures, movies, and interactive plots. Allows the user to have a grand ole time playing with their data!

Parameters
  • obj – Object must have minimum attributes of 2D array of flux. Will allow for plotting of both postcards & tpfs.

  • obj_type – Object type can be set to “tpf” or “postcard”. Default is “tpf”.

aperture_contour(aperture=None, ap_color='w', ap_linewidth=4, ax=None, **kwargs)

Overplots the countour of an aperture on a target pixel file. Contribution from Gijs Mulders.

Parameters
  • aperture (np.2darray, optional) – A 2D mask the same size as the target pixel file. Default is the eleanor default aperture.

  • ap_color (str, optional) – The color of the aperture contour. Takes a matplotlib color. Default is red.

  • ap_linewidth (int, optional) – The linewidth of the aperture contour. Default is 4.

  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – Axes to plot on.

pixel_by_pixel(colrange=None, rowrange=None, cmap='viridis', data_type='corrected', mask=None, xlim=None, ylim=None, color_by_pixel=False, color_by_aperture=True, freq_range=[0.05, 10.0], aperture=None, ap_color='r', ap_linewidth=2)

Creates a pixel-by-pixel light curve using the corrected flux. Contribution from Oliver Hall.

Parameters
  • colrange (np.array, optional) – A list of start column and end column you’re interested in zooming in on.

  • rowrange (np.array, optional) – A list of start row and end row you’re interested in zooming in on.

  • cmap (str, optional) – Name of a matplotlib colormap. Default is ‘viridis’.

  • data_type (str, optional) – The type of flux used. Either: ‘raw’, ‘corrected’, ‘amplitude’, or ‘periodogram’. If not, default set to ‘corrected’.

  • mask (np.array, optional) – Specifies the cadences used in the light curve. If not, default set to good quality cadences.

  • xlim (np.array, optional) – Specifies the xlim on the subplots. If not, default is set to the entire light curve.

  • ylim (np.array, optional) – Specifies the ylim on the subplots, If not, default is set to the entire light curve flux range.

  • color_by_pixel (bool, optional) – Colors the light curve given the color of the pixel. If not, default is set to False.

  • freq_range (list, optional) – List of minimum and maximum frequency to search in Lomb Scargle periodogram. Only used if data_type = ‘periodogram’. If None, default = [1/20., 1/0.1].

plot_gaia_overlay(tic=None, tpf=None, magnitude_limit=18)

Check if the source is contaminated.

tess_the_movie()

Opens the link to Ethan Kruse’s TESS: The Movie YouTube videos for the sector your target is observed in.

movie_url
Type

str

class eleanor.Crossmatch(object)

This class can be used to find the same light curve from different pipelines. The current available light curves are from the TESS Asteroseismic Science Consortium (TASC) and Oelkers & Stassun (2019). Oelkers & Stassun light curves are only available through Sector 5.

Parameters

obj – Object must be an eleanor.TargetData object.

oelkers_lc()

Grabs the Oelkers & Stassun (2019) associated light curve.

time
Type

np.array

mag
Type

np.array

mag_err
Type

np.array

tasoc_lc()

Grabs the T’DA available light curves for your target. For more information, see the TASOC light curve documentation: https://tasoc.dk/code/.

tasoc_header
tasoc_tpf
Type

np.2darray

tasoc_aperture
Type

np.2darray

tasoc_time
Type

np.array

tasoc_quality
Type

np.array

tasoc_timecorr
Type

np.array

tasoc_cadenceno
Type

np.array

tasoc_flux_raw
Type

np.array

tasoc_flux_raw_err
Type

np.array

tasoc_flux_corr
Type

np.array

tasoc_flux_corr_err
Type

np.array

tasoc_flux_bkg
Type

np.array

tasoc_pixel_quality

Quality flags for the data; use these not tasoc_quality.

Type

np.array

tasoc_pos_corr1
Type

np.array

tasoc_pos_corr2
Type

np.array

tasoc_mom_centr1
Type

np.array

tasoc_mom_centr2
Type

np.array

two_minute(download=False, sectors=None)

Checks to see if short cadence data is available for your target.

Parameters
  • download (str, optional) – Allows the user to download the short cadence target pixel files. By default, downloads all sectors that are available.

  • sectors (np.ndarray, optional) – Allows the user to specify which sector to search for two-minute data. By default, downloads the sector assigned to the 30-minute data.

Returns

sc – If download == True : Returns a list of lightkurve.lightcurve.TessLightCurve object(s). If download == False : Returns a lightkurve.search.SearchResult object.

Return type

np.ndarray

class eleanor.Postcard(filename, background, filepath)

TESS FFI data for one postcard across one sector.

A postcard is an rectangular subsection cut out from the FFIs. It’s like a TPF, but bigger. The Postcard object contains a stack of these cutouts from all available FFIs during a given sector of TESS observations.

Parameters
  • filename (str) – Filename of the downloaded postcard.

  • location (str, optional) – Filepath to filename.

dimensions

(x, y, time) dimensions of postcard.

Type

tuple

flux, flux_err

Arrays of shape postcard.dimensions containing flux or error on flux for each pixel.

Type

numpy.ndarray

time

?

Type

float

header

Stored header information for postcard file.

Type

dict

center_radec

RA & Dec coordinates of the postcard’s central pixel.

Type

tuple

center_xy

(x, y) coordinates corresponding to the location of the postcard’s central pixel on the FFI.

Type

tuple

origin_xy

(x, y) coordinates corresponding to the location of the postcard’s (0,0) pixel on the FFI.

Type

tuple

background2d

The 2D modeled background array.

Type

np.ndarray

find_sources()

Finds the cataloged sources in the postcard and returns a table.

Returns

result – All the sources in a postcard with TIC IDs or Gaia IDs.

Return type

astropy.table.Table

plot(frame=0, ax=None, scale='linear', **kwargs)

Plots a single frame of a postcard.

Parameters
  • frame (int, optional) – Index of frame. Default 0.

  • ax (matplotlib.axes.Axes, optional) – Axes on which to plot. Creates a new object by default.

  • scale (str) – Scaling for colorbar; acceptable inputs are ‘linear’ or ‘log’. Default ‘linear’.

  • **kwargs (passed to matplotlib.pyplot.imshow) –

Returns

ax

Return type

matplotlib.axes.Axes

class eleanor.ffi(sector=None, camera=None, chip=None)
This class allows the user to download all full-frame images for a given sector,

camera, and chip. It also allows the user to create their own pointing model based on each cadence for a given combination of sector, camera, and chip.

No individual user should have to download all of the full-frame images because

stacked postcards will be available for the user to download from MAST.

Parameters
  • sector (int, optional) –

  • camera (int, optional) –

  • chip (int, optional) –

build_pointing_model(pos_predicted, pos_inferred, outlier_removal=False)
Builds an affine transformation to correct the positions of stars

from a possibly incorrect WCS.

Parameters
  • pos_predicted (tuple) – Positions taken straight from the WCS; [[x,y],[x,y],…] format.

  • pos_inferred (tuple) – Positions taken using any centroiding method; [[x,y],[x,y],…] format.

  • outlier_removal (bool, optional) – Whether to clip 1-sigma outlier frames. Default False.

Returns

xhat – (3, 3) affine transformation matrix between WCS positions and inferred positions.

Return type

np.ndarray

download_ffis(download_dir=None)

Downloads entire sector of data into FFI download directory.

Parameters

download_dir (str) – Location where the data files will be stored. Defaults to “~/.eleanor/sector_{}/ffis” if None is passed.

pointing_model_per_cadence(out_dir=None, n_sources=350)

Step through build_pointing_model for each cadence.

sort_by_date()

Sorts FITS files by start date of observation.

eleanor.use_pointing_model(coords, pointing_model)

Applies pointing model to correct the position of star(s) on postcard.

Parameters
  • coords (tuple) – (x, y) position of star(s).

  • pointing_model (astropy.table.Table) – pointing_model for ONE cadence.

Returns

coords – Corrected position of star(s).

Return type

tuple

eleanor.load_pointing_model(pm_dir, sector, camera, chip)

Loads in pointing model.

eleanor.pm_quality(time, sector, camera, chip, pm=None)

Fits a line to the centroid motions using the pointing model. A quality flag is set if the centroid is > 2*sigma away from

the majority of the centroids.

eleanor.set_quality_flags(ffi_start, ffi_stop, shortCad_fn, sector, camera, chip, pm=None)
Uses the quality flags in a 2-minute target to create quality flags

in the postcards.

We create our own quality flag as well, using our pointing model.


Changelog

See what's new added, changed, fixed, improved or updated in the latest versions.

Version 2.0.5 (4 July, 2022)

  • Updated Now takes Gaia DR3 IDs (no longer supporting Gaia DR2)
  • Updated Running tests through GitHub Actions instead of Travis CI
  • Updated Documentation page and favicon :3

Version 2.0.2 (5 February, 2021)

  • Fixed Bugs in setting download directory paths
  • Fixed Bugs for Windows users

Version 2.0.1 (18 December, 2020)

  • Fixed Minor bug fixes

Version 2.0.0rc1 (5 October, 2020)

  • Updated Changing skip parameter in correction to be in unit of time rather than cadences to handle 10-minute FFIs
  • Fixed Bug where very faint stars had suboptimal corrections
  • Updated Changed crowded_field to aperture_mode and added built-in mechanics for bright stars
  • Updated Updated docs to include citation to 2019 paper
  • Fixed Bug in eleanor.Visualize() layout of aperture
  • Updated Changes to handle format of 10-minute FFIs in eleanor.Update()
  • Updated Significant speedups, especially when local postcards already exist and run with local==True

Version 1.0.5 (21 May, 2020)

  • Fixed Bug where some apertures were made twice and others not at all
  • Fixed Bug where mass centroids were off by a constant offset at all cadences
  • Fixed Bug that happens when data are all zeros at the start of a sector

Version 1.0.4 (27 March, 2020)

  • Added Pass in an array of regressors to use in calculating the corrected flux
  • Updated Extreme short-term flux variability like eclipses ignored in corrections, which should improve detrending of these objects
  • Fixed Fixed bug where metadata could not be properly updated on linux clusters
  • Updated Improvements to Gaia overlay of fields
  • Added Ability to create light curves offline
  • Added Ability to pass through a SIMBAD-resolvable name rather than TIC/Gaia ID or coordinates

Version 1.0.1 (19 January, 2020)

  • Added Ability to use local postcards
  • Added Addition of eleanor.Update() for automatic sector updates
  • Updated Significant speedups when TIC, Coords, and a Gaia ID are all provided