src.superphot_plus.import_utils

This script provides functions for importing and manipulating ZTF data from the Alerce API.

Module Contents

Functions

import_lc(filename[, tpe, survey, clip_lightcurve, ...])

Imports a single file, but only the points from a single

clip_lightcurve_end(times, fluxes, fluxerrs, bands)

Clips end of lightcurve with approximately 0 slope. Checks from

add_to_new_csv(name, label, redshift, output_csv)

Add row to CSV of included files for training.

Attributes

LOW_SNR_FILE

LOW_VAR_FILE

LOW_SNR_FILE = 'low_snr_classes.dat'[source]
LOW_VAR_FILE = 'low_var_classes.dat'[source]
import_lc(filename, tpe=None, survey=Survey.ZTF(), clip_lightcurve=True, low_snr_file=LOW_SNR_FILE, low_var_file=LOW_VAR_FILE)[source]

Imports a single file, but only the points from a single survey.

Parameters:
  • filename (str) – Path to the input CSV file.

  • survey (Survey, optional) – Assumes light curve data was taken by this survey. Defaults to ZTF.

Returns:

Tuple containing the imported light curve data.

Return type:

tuple

clip_lightcurve_end(times, fluxes, fluxerrs, bands)[source]

Clips end of lightcurve with approximately 0 slope. Checks from back to max of lightcurve.

Parameters:
  • times (np.ndarray) – Time values of the light curve.

  • fluxes (np.ndarray) – Flux values of the light curve.

  • fluxerrs (np.ndarray) – Flux error values of the light curve.

  • bands (np.ndarray) – Band information of the light curve.

Returns:

Tuple containing the clipped light curve data.

Return type:

tuple

add_to_new_csv(name, label, redshift, output_csv)[source]

Add row to CSV of included files for training.

Parameters:
  • name (str) – Name in the new row.

  • label (str) – Label in the new row.

  • redshift (float) – Redshift value in the new row.

  • output_csv (str) – The output CSV file path.