astra.contrib.thecannon.tasks.test

Module Contents

Classes

TestTheCannon A mixin class all tasks related to The Cannon.
EstimateStellarLabelsGivenApStarFileBase A task to train The Cannon, given some file that contains high-quality labels,
class astra.contrib.thecannon.tasks.test.TestTheCannon

A mixin class all tasks related to The Cannon.

Parameters:
  • label_names – A list of label names.
  • order – (optional) The polynomial order to use for this model (default: 2).
N_initialisations
use_derivatives
task_namespace = TheCannon
label_names
order
requires(self)
output(self)
read_observation(self)

Read the input observation, and if continuum is a requirement, normalize it.

prepare_observation(self, dispersion, spectrum=None, continuum=None)
read_model(self)
run(self)
class astra.contrib.thecannon.tasks.test.EstimateStellarLabelsGivenApStarFileBase

A task to train The Cannon, given some file that contains high-quality labels, and pseudo-continuum-normalised fluxes and inverse variances.

Parameters:
  • training_set_path

    The path to a pickle file that contains a dictionary with the following keys:

    • wavelength: an array of shape (P, ) where P is the number of pixels
    • flux: an array of flux values with shape (N, P) where N is the number of observed spectra and P is the number of pixels
    • ivar: an array of inverse variance values with shape (N, P) where N is the number of observed spectra and P is the number of pixels
    • labels: an array of shape (L, N) where L is the number of labels and N is the number observed spectra
    • label_names: a tuple of length L that describes the names of the labels
  • regularization – (optional) The L1 regularization strength to use during training (default: 0.0).
  • threads – (optional) The number of threads to use during training (default: 1).
  • plot – (optional) Produce quality assurance figures after training (default: True).
training_set_path
regularization
threads
plot
task_namespace = TheCannon
label_names
order
N_initialisations
use_derivatives
requires(self)

Requirements of this task.

run(self)

Execute this task.

output(self)

The output of this task.

read_observation(self)

Read the input observation, and if continuum is a requirement, normalize it.

prepare_observation(self, dispersion, spectrum=None, continuum=None)
read_model(self)