SkillAgentSearch skills...

LATTE

Lightcurve Analysis Tool for Transiting Exoplanet

Install / Use

/learn @noraeisner/LATTE
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

LATTE

Lightcurve Analysis Tool for Transiting Exoplanet

Written by Nora L. Eisner

email: nora.eisner@new.ox.ac.uk

LATTE logo

THE CODE


The aim of this code is to provide a series of diagnostic tests which are used in order to determine the nature of events found in TESS lightcurves.

LATTE is an open source Python package that performs standard diagnostic tests to help identify, vet and characterise signals in the TESS lightcurves in order to weed out instrumental and astrophysical false positives. The program is designed to allow for a fast, in depth analysis of targets that have already been identified as promising candidates by the main TESS pipelines or via alternative methods such as citizen science. The code automatically downloads the data products for any chosen TIC ID (short or long cadence TESS data) and produces a number of diagnostic plots (outlined below) that are compiled in a concise report.

The implemented diagnostic tests are similar to the ‘Data Validation’ steps performed by the Science Processing Operations Center (SPOC)pipeline for the short-cadence data, and by the quick-look pipeline (QLP) for the long-cadence data. However, while the SPOC pipeline tests are performed on a selection of two-minute cadence TESS targets only, LATTE allows for the analysis of any TESS target with a valid TIC ID, including both the two-minute and thirty-minute cadence targets.

The code is designed to be fully interactive and does not require any prior knowledge of python coding.



Installation

LATTE requires python3 to be installed on your computer, which can be download from https://www.python.org/downloads/. Once you have python3, you can download the code directly from github. Alternatively, you can install LATTE using pip (https://pypi.org/project/tessLATTE/) via your command line with:

pip3 install tessLATTE      

In order for LATTE to work you will need to have the right versions of certain modules installed, so downloading it in a virtual environment. Note:** ensure that the matplotlib version that you are using is 3.2.0 (pip install matplotlib==3.2.0). You will also need a module called TKinter installed. If this is not already installed, please use: sudo apt-get install python3-tk.

The first time that the program is run you will be prompted to enter a path to a file on your computer where all the output data will be stored (this path can be changed later using --new-path). The first time that the code is run it will also have to download the text data files from MAST, which are around 325M. This download will only have to run in full once but may take a couple of minutes to complete. Please note that this step does not download any of the actual TESS data, but only text files that contain curl scripts that are needed to download individual light curves when LATTE is run. This one-time bulk download increases the speed of LATTE by ensuring that these curl scripts do not have be downloaded every time that the code is executed.

If the code doesn't run when you first install it, this could be due to an SSL issue. To check, please try executing the following command from your command line: python -m tess_stars2px -t 261136679.

If this command returns the error: "ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed", you will need to change your SSL settings, which can be done following these instructions.

How to run it?

LATTE is run through the command line with:

python3 -m LATTE      or     python3 -m LATTE --new-data     (if run for the first time or when new data is released)

This will open up a box for you that prompts you to enter a TIC ID and indicate whether you would like to extract the information from the 2-minute cadence ('Standard mode') or 30-minute cadence Full Frame Image (FFI) data ('FFI mode').

Once a TIC ID has been entered, the program will tell you in what sectors that target has been observed. If you want to look at all of the sectors, either enter them or simply press enter with nothing in the box. Alternatively, enter the sectors that you are interested in and enter them separated by commas. Remember that LATTE will have to download all the data for each sector so you might not always want to look at all of the sectors.

Normal Mode

The 'normal mode' looks at the short-cadence TESS data which has already been detrended and extracted by the SPOC pipeline. Optimal aperture lightcurve extraction aperture sizes have therefore already been identified and do not need to be selected manually.

FFI Mode

In FFI mode the data is downloaded using TESScut and the data detrended using PCA, a moving average filter and k-sigma clipping. Unlike the TESS 2-minute cadence targets, the FFIs do not come with a pre-chosen optimal aperture. By default, the user is given the option to manually select the pixels within each aperture for a 'large' and a 'small' aperture. This GUI opens automatically, and the two apertures are selected by clicking on the desired pixels in the interface (see image below). The two (large and small aperture) lightcurves are simultaneously displayed. When the FFI mode is run with the command '--auto', the aperture size is chosen manually using a threshold flux value centred at the midpoint of the postage stamp.

FFI Example

Input target list

In order to efficiently generate diagnostic plots for multiple targets without having to interactively enter the target TIC IDs, LATTE can be executed with an input file that lists the TIC IDs, the times of the transit-like events, and the observational sectors to consider (if known). See example. In the cases where the times of the transit events or the sectors have not been entered, the user is prompted to enter these manually via the GUI, as described above. For longer target lists the code can also be parallelized (see example). If you want to run it with this mode, enter:

python3 -m LATTE --targetlist=path/to/the/csv/input/file

The program will skip targets that have already been analysed by you, so if you want to overwrite data add '--o' to the command.

Transit time selection

Once you have identified the TIC ID, the observational sectors and the aperture sizes (FFI mode only), you will see a screen that has the full lightcurve as well as a zoom in of the lightcurve (see figure below). The solid red line across the full lightcurve lets you know where on the lightcurve you are zooming in on. Click on the top (full) or bottom (zoomed in) plots to change the location of the zoom in until the red vertical line is centred on the mid-point of a transit-event. When you are happy with the location press the 'Add Time' button below the plots in order to record this time (in TBJD). You can delete wrongly entered times with the 'Delete time'. The saved times will be shown on the screen. The position of the red line can also be changed by clicking on the top ot bottom lightcurve. The y-scale of the plots can be changed with the grey coloured slider.

Interface Example

Additional options are displayed to the left of the plots.

Sector Selection:

  • The sectors that you have chosen to look at are listed in the 'Sector' bar below the plot. You can change the sector to look at by clicking on the corresponding number in the bar, or on 'all' too look at all of them. Alternatively, you can use the arrows to the right of the bar to scroll through them. Only the top panel will change.

Binning Factor:

  • change the binning of the top plot (only available in the normal and not FFI mode)

Settings:

  • Simple: only run the most basic diagnostic tests (not using tpfs). This is for a very quick analysis.
  • Show Plots: Display the plots after they are made. This slows down the code but allows you to see and analyse them as they are being made.
  • North: Align all the images due North (this slows down the code).
  • BLS: Run a Box-Least-Squares algorithm that searches for periodic signals in the lightcurve.
  • Save: Save all the images (default this is already checked)
  • Report: Generate a pdf file at the end of the code to summarise the findings (default this is already checked).

Quick look:

  • Generate 'quick look' plots of the background flux and centroid positions around the time of any marked transit events. This function will not work if no transit events have been selected.
  • Quick look of the stellar tracks and the periodogram.

Finally, there is an optional box to enter a 'Memorable name' for the candidate. This name is used to store the data at the end in order to make identifying certain targets easier.

Once all the options have been chosen and the transit times stored (you have to enter at least one transit time), press the orange 'Done' button to continue.

The code will then generate download and process all of the data. Note that all the data is downloaded but not stored. The more sectors you analyse in one go the longer the code will take to run.

Output

For more information on how to interpret the results shown in the reports look at the 'How to make a LATTE' document in the 'example' folder.

Figures:

  • Full lightcurve with the times of the momentum dumps marked.

Full LC

The solid red lines at the bottom of the figure indicated the times of the reaction wheel momentum dumps and the dashed black line(s) show the times of the marked transit events. Momentum dumps occur around every 2 to 2.5 days and typically last around half an hour. This can affect the satell

View on GitHub
GitHub Stars42
CategoryDevelopment
Updated1mo ago
Forks10

Languages

Jupyter Notebook

Security Score

90/100

Audited on Feb 27, 2026

No findings