Magnitude Models

The following is a collection of models to get the magnitude in the ACA catalog from the Gaia magnitudes.

Model for ACA Magnitudes as a function of Gaia magnitudes.

The model is implemented as a two classes: - MissingValueFiller with methods fit and fill_missing_values methods. - GaiaModel with fit, predict and uncertainty methods.

The reason for separating the missing-value-filling and the magnitude model is that they can be used on different datasets. To estimate the missing Gaia values, one does not need the star to be observed by ACA.

We first fit the missing value filler, using the training sample from the Gaia dataset. Then we fit the magnitude model using the observed stars training set.

class agasc_gaia.gaia_model.Broken(axis=0)[source]

Methods

get_params([deep])

Get parameters for this estimator.

score(X, y[, sample_weight])

Return the coefficient of determination of the prediction.

set_params(**params)

Set the parameters of this estimator.

fit

predict

class agasc_gaia.gaia_model.GaiaModel(missing_value_filler, mean_mag_threshold=8, n_components=2, degree=1, alpha=0.0, with_instrument_bias=True, fit_uncertainty=True, use_weights=True, model='PCA', exclude_outliers=True)[source]

Model for ACA Magnitudes as a function of Gaia magnitudes.

The model is fit in the space of the N largest principal components. It is linear below a magnitude threshold, and a broken line above that magnitude. The broken line is a cubic spline.

Parameters:
missing_value_fillerMissingValueFiller

A model that fills missing values in the data.

mean_mag_thresholdfloat

The magnitude threshold above which the model is not linear.

n_componentsint

The number of principal components to use.

Attributes:
symbols

Methods

fit(data, gaia_data[, column])

Fit the model to the data.

get_weights(train)

Get the weights for the training data.

predict(data[, with_instrument_bias])

Predict the ACA magnitude for the given data.

uncertainty([data, mag_aca, has_mag, ...])

Predict the uncertainty of the model.

fit(data, gaia_data, column='mag_aca_obs')[source]

Fit the model to the data.

Parameters:
datapandas.DataFrame

The data to fit the model to.

gaia_datapandas.DataFrame

A table of gaia magnitudes (does not require an observed ACA magnitude). This is used to estimate the impact of missing magnitudes in the final estimated ACA magnitude.

static get_weights(train)[source]

Get the weights for the training data.

The weights have two factors:

  1. A statistical weight that is inversely proportional to the number of stars in a magnitude bin.

  2. An uncertainty weight that is inversely proportional to the uncertainty of the ACA magnitude.

The statistical weight is largest at small and large magnitudes, and smallest in the middle. The value of the statistical weight is clipped from above at value corresponding to 9.0 mag, and it is clipped from below at 1/200. This restricts the range of weights.

The uncertainty weight is usually largest at small magnitudes.

Parameters:
trainpandas.DataFrame

The training data.

Returns:
weightsarray-like

The weights for the training data.

predict(data, with_instrument_bias=True)[source]

Predict the ACA magnitude for the given data.

Parameters:
datapandas.DataFrame

The data to predict the magnitude.

uncertainty(data=None, mag_aca=None, has_mag=None, with_base=True, with_missing_mag=True, with_instrument=True, with_variable_stars=True)[source]

Predict the uncertainty of the model.

This function can be called in two ways:

  1. With the data as a parameter (pc1 and has_mag will be determined).

  2. With mag_aca and the has_mag column as parameters (data must be None).

Parameters:
datapandas.DataFrame

The data to predict the uncertainty.

mag_acaarray-like

The estimated mag_aca of the data.

has_magarray-like

A column where each entry is a bit mask: 1*has_g_mag + 2*has_rp_mag + 4*has_bp_mag. If it is not given, the assumption is that all magnitudes are known.

with_basebool

Include the base uncertainty of the model.

with_missing_magbool

Include the uncertainty due to missing magnitudes.

with_instrumentbool

Include the uncertainty due to the instrument.

with_variable_starsbool

Include the uncertainty due to variable stars.

class agasc_gaia.gaia_model.MissingValueFiller(mag_bins=None, uncertainty_nmin=100, columns=('g_mag', 'rp_mag', 'bp_mag'))[source]

Class to fill missing values in Gaia magnitude data.

Gaia provides magnitudes in three bands: g, bp, and rp. The vast majority of stars have all three, but some have only one or two. This class fits linear models to all possibilities, so a missing value can be filled in by predicting it from the other values.

Methods

fill_missing_values

fit

uncertainty

class agasc_gaia.gaia_model.SimpleColorModel(degree=1, alpha=0.0)[source]

Model for ACA Magnitudes as a function of Gaia magnitudes.

The model is fit in the space of the N largest principal components. It is linear below a magnitude threshold, and a broken line above that magnitude. The broken line is a cubic spline.

Parameters:
missing_value_fillerMissingValueFiller

A model that fills missing values in the data.

mean_mag_thresholdfloat

The magnitude threshold above which the model is not linear.

n_componentsint

The number of principal components to use.

Methods

fit(data[, column])

Fit the model to the data.

predict(data)

Predict the ACA magnitude for the given data.

fit(data, column='mag_aca_obs')[source]

Fit the model to the data.

Parameters:
datapandas.DataFrame

The data to fit the model to.

predict(data)[source]

Predict the ACA magnitude for the given data.

Parameters:
datapandas.DataFrame

The data to predict the magnitude.