API

class ellie.find_sources(tic=None, gaia=None, pos=None, multiFile=None, dir=None, camera=None, chip=None)

The main interface to the ELLIE image extraction package

Args:
tic : The TESS Input Catalog identifier for the target in question (default: None) gaia: The Gaia identifier for the target in question (default: None) pos : The (RA, Dec) coordinates for the location in question (default: None) multiFile: Filename with either a list of TIC IDs, Gaia IDs, or RA,Dec position pairs (default:None)

Completes a cone search in the Gaia DR2 or TIC catalog Parameters ———-

r: radius of cone search [deg] service: identifies which MAST service to use. Either ‘Mast.Catalogs.GaiaDR2.Cone’

or ‘Mast.Catalogs.Tic.Cone’ are acceptable inputs
table: table of sources found within cone of radius r See the Gaia & TIC field documantation for more information on returned columns
crossmatch_by_position(r, service, multiPos=None)

Crossmatches [RA,Dec] position to a source in the Gaia DR2 catalog and TIC catalog Parameters ———-

pos: [RA,Dec] list r: radius of search for crossmatch service: identifies which catalog to crossmatch to. Either: ‘Mast.GaiaDR2.Crossmatch’

or ‘Mast.Tic.Crossmatch’ are accepted

multiPos: used when user passes in list of IDs to crossmatch

gaiaTable: table of crossmatch results in Gaia DR2 ticTable : table of crossmatch results in TIC
crossmatch_distance(pos, match)

Finds distance between source and crossmatched source(s)

crossmatch_multi_to_gaia()

Crossmatches file of TIC IDs to Gaia Parameters ———- Returns ———-

table: table of gaia_id, tic_id, ra, dec, delta_pos, gmag, tmag, pmra, pmdec, parallax
crossmatch_multi_to_tic(list=[])

Crossmatches file of Gaia IDs to TIC Parameters ———- Returns ———-

table: table of gaia_id, tic_id, ra, dec, delta_pos, gmag, tmag, pmra, pmdec, parallax
download_tic_tpf(custom=False)

This function finds the sector, camera, and chip a target is located in Downloads the already created stacked cadence FITS file (TPF) and associated

light curve FITS file

Downloads the postcard a target is located in if the target is not in the TIC Parameters ———-

custom: Allows the user to ask to create TPF & light curve FITS files
for sources not in the TIC
Downloads TPF & light curve FITS files
find_by_position()

Allows the user to pass in a file of RA,Dec pairs to be matched in Gaia & TIC Parameters ———- Returns ———-

table: table of gaia_id, tic_id, ra, dec, delta_pos_gaia, delta_pos_tic, gmag, tmag, pmra, pmdec, parallax
gaia_pos_by_ID(multiSource=None)

Finds the RA,Dec for a given Gaia source_id Parameters ———- Returns ———-

source_id, pos [RA,Dec], gmag, pmra, pmdec, parallax
initialize_table()

Creates a table for crossmatching multiple sources between Gaia and TIC catalogs

jsonTable(jsonObj)

Convets json return type object into an astropy Table Parameters ———-

jsonObj: an object from mastQuery
table: astropy table for jsonObj
mastQuery(request)

Sends a request to the MAST server Parameters ———-

request: json string
head: headers for response content: data for response
tic_by_contamination(pos, r, contam)

Allows the user to perform a counts only query or get the usual grid of results. When unsure how many results is expcted, it is best to first perform a counts query to avoid memory overflow Parameters ———-

pos: [RA,Dec] pair to be the center of the search r: radius of cone search contam: [min,max] list of how much allowed contamination
json.loads(outString): a table of source(s) in radius
tic_pos_by_ID(multiSource=None)

Finds the RA,Dec for a given TIC source_id Parameters ———-

multiSource: used when user passes in a file of TIC IDs to crossmatch
source_id, pos [RA,Dec], tmag
class ellie.data_products(tic=None, gaia=None, pos=None, dir=None)
aperture_fitting(tpf=None)

Finds the “best” (i.e. the smallest std) light curve for a range of sizes and shapes Parameters ———-

sources: list of sources to find apertures for
custom_aperture(shape=None, r=0.0, l=0.0, w=0.0, t=0.0, pointing=True, jitter=True, roll=True, input_fn=None, pos=[])
Allows the user to input their own aperture of a given shape (either ‘circle’ or
‘rectangle’ are accepted) of a given size {radius of circle: r, length of rectangle: l, width of rectangle: w, rotation of rectangle: t}

The user can have the aperture not follow the pointing model by setting pointing=False The user can determine which kinds of corrections would like to be applied to their light curve

jitter & roll are automatically set to True

Pos is the position given in pixel space

download_ffis(sector=None, camera=None, chips=None)

Downloads entire sector of data into .ellie/ffis/sector directory

find_postcard()

Finds what postcard a source is located in Returns ———-

postcard filename, header of the postcard
get_header(postcard=None)

Gets postcard header from the website

get_pointing(header=None, postcard=None)

Gets the pointing model from the website

individual_tpf(output_fn=None)
Creates a FITS file for a given source that includes:
Extension[0] = header Extension[1] = (9x9xn) TPF, where n is the number of cadences in an observing run Extension[2] = (3 x n) time, raw flux, systematics corrected flux
make_postcard(camera=None, chip=None, sector=None)

Creates 300 x 300 x n postcards, where n is the number of cadences for a given observing run Creates a catalog of the associated header with each postcard for use later

make_postcard_catalog()
Whenever a postcard is created for a camera-chip pair, a new catalog is created
called: “postcard_{}-{}.txt”.format(camera, chip)
This function will take all of the postcard sub-catalogs and create a main one
for each sector
This file will be stored online and will be called from such, preventing the user
from having to download it onto their personal machine
postcard.txt: a catalog of header information for each postcard
plot()

Makes a simple plot of the light curve and image of TPF

pointing_model(camera=None, chip=None, sector=None)

Creates the pointing model for a given camera and chip across all cadences

sort_by_date(camera, chip)

Sorts FITS files by start date of observation

system_corr(lc, x_pos, y_pos, jitter=False, roll=False)

Allows for systematics correction of a given light curve Parameters ———-

lc: np.array() of light curve values x_pos: np.array() of x positions for the centroid y_posL np.array() of y positions for the centroid
class ellie.visualize(tic=None, gaia=None, input_fn=None, **kwargs)

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

Args:
tpf: A FITS file that contains stacked cadences for a single source
click_aperture(corrected=False)

Allows the user to click specific pixels they want to create a lightcurve for

mark_gaia()

Allows the user to mark other Gaia sources within a given TPF Click on the x’s to reveal the source’s ID and Gmag Also cross-matches with TIC and identifies sources in there as well

tpf_movie(output_fn=None, cbar=True, aperture=False, com=False, plot_lc=False, **kwargs)

This function allows the user to create a TPF movie Parameters ———-

cmap: Allows the user to choose the color map for their movie
(Defaults to the only acceptable colormap)
cbar: Allows the user to decide if they want a colorbar for scale
(Defaults to True)
aperture: Allows the user to decide if they want the aperture on
their movie (Defaults to False)
com: Allows the user to decide if they want to see the center of
mass of the target (Defaults to False)
lc: Allows the user to plot the light curve and movement along light curve
with TPF movie (Defaults to False)
Creates an MP4 file