Other functions

Data Download

download_lc(target_name, flux_type='PDCSAP', mission='TESS', sigma_clip=4, iters=1, do_pca=False, do_psf=False)[source]

Downloads a light curve using the TESS mission. If the star has been observed in the SC mode, it will download the original light curve from MAST. You can also choose the flux type you want to use.

If it wasn’t observed in SC mode, it will try to extract a light curve from the FFIs if the target has been observed by TESS.

You can also download light curves of stars that are observed by the K2 or Kepler mission, by setting the mission parameter.

Parameters
  • target_name (str) – Name of the target. You can either provide the TIC ID (TIC …), Kepler ID (KIC …), K2 ID(EPIC …) or a name that is resolvable by Simbad.

  • flux_type – Type of flux in the SC mode. Can be either PDCSAP or SAP or PSF for long cadence data

  • mission (str) – Mission from which the light curves are extracted. By default TESS only is used. You can consider all missions by passing ‘all’ (TESS, Kepler, K2)

  • sigma_clip – Sigma clip parameter. Defines the number of standard deviations that are clipped.

  • iters – Iterations for the sigma clipping

Return type

Tuple[LightCurve, Optional[List[Figure]]]

Returns

lightkurve.LightCurve object and validation page if extracted from FFI

combine_light_curves(target_list, sigma_clip=4, iters=1)[source]
Return type

LightCurve

cut_ffi(tic_id, clip=4, iter=1, do_pca=False, do_psf=False, flux_type='PDCSAP')[source]

Extracts light curves from FFIs using TESScut and Eleanor. This function automatically combines all available sectors for a given target.

Parameters
  • tic_id (int) – TIC ID of the target

  • clip (float) – Sigma clip range of the target.

  • iter (int) – Iterations of the sigma clipping

  • do_pca (bool) – Perform pca analysis with eleanor

  • do_psf (bool) – Perform psf analysis with eleanor

  • flux_type – Flux type that is returned. Choose between ‘PDCSAP’,’SAP’,’PSF’

Return type

Tuple[LightCurve, List[Figure]]

Returns

Lightcurve

mag(lc)[source]

Converts and normalizes a LighCurve object to magnitudes.

Parameters

lc (LightCurve) – lightcurve object

Return type

LightCurve

Returns

reduced light curve object

load_file(file, clip=4, it=1, apply_file_correction=False)[source]

Loads and normalizes target content :type file: str :param file: Name of target including path :rtype: LightCurve :return: LightCurve object

Miscellaneous

m_od_uncertainty(lc, a)[source]

Computes uncertainty for a given light curve according to Montgomery & O’Donoghue (1999).

Parameters
  • lc (LightCurve) – smurfs.Lightcurve() object

  • a (float) – amplitude of the frequency

Return type

Tuple

Returns

A tuple of uncertainties in this order: Amplitude, frequency, phase

mprint(text, type)[source]
ctext(text, type)[source]
Return type

str

class cd(newPath)[source]

Directory changer. can change the directory using the ‘with’ keyword, and returns to the previous path after leaving intendation. Example:

with cd(“some/path/to/go”): # changing dir

foo() … bar()

#back to old dir