avocado.AstronomicalObject

class avocado.AstronomicalObject(metadata, observations)

An astronomical object, with metadata and a lightcurve.

An astronomical object has both metadata describing its global properties, and observations of its light curve.

Parameters:
  • metadata (dict-like) –

    Metadata for this object. This is represented using a dict internally, and must be able to be cast to a dict. Any keys and information are allowed. Various functions assume that the following keys exist in the metadata:

    • object_id: A unique ID for the object. This will be stored as a string internally.
    • galactic: Whether or not the object is in the Milky Way galaxy or not.
    • host_photoz: The photometric redshift of the object’s host galaxy.
    • host_photoz_error: The error on the photometric redshift of the object’s host galaxy.
    • host_specz: The spectroscopic redshift of the object’s host galaxy.

    For training data objects, the following keys are assumed to exist in the metadata: - redshift: The true redshift of the object. - class: The true class label of the object.

  • observations (pandas.DataFrame) –

    Observations of the object’s light curve. This should be a pandas DataFrame with at least the following columns:

    • time: The time of each observation.
    • band: The band used for the observation.
    • flux: The measured flux value of the observation.
    • flux_error: The flux measurement uncertainty of the observation.
__init__(metadata, observations)

Create a new AstronomicalObject

Methods

__init__(metadata, observations) Create a new AstronomicalObject
fit_gaussian_process([fix_scale, verbose, …]) Fit a Gaussian Process model to the light curve.
get_default_gaussian_process() Get the default Gaussian Process.
plot_light_curve([show_gp, verbose, axis]) Plot the object’s light curve
predict_gaussian_process(bands, times[, …]) Predict the Gaussian process in a given set of bands and at a given set of times.
preprocess_observations([subtract_background]) Apply preprocessing to the observations.
print_metadata() Print out the object’s metadata in a nice format.
subtract_background() Subtract the background levels from each band.

Attributes

bands Return a list of bands that this object has observations in