FitResults

class mcalf.models.results.FitResults(shape, n_parameters, time=None)[source]

Bases: object

Class that holds multiple fit results in a way that can be easily processed

parameters

Array of fitted parameters.

Type

ndarray of shape (row, column, parameter)

classifications

Array of classifications.

Type

ndarray of int of shape (row, column)

profile

Array of profiles.

Type

ndarray of str of shape (row, column)

success

Array of success statuses.

Type

ndarray of bool of shape (row, column)

chi2

Array of chi-squared values.

Type

ndarray of shape (row, column)

time

Time index that the FitResult object refers to (if provided).

Type

int, default = None

n_parameters

Number of parameters in the last dimension of parameters.

Type

int

Methods Summary

append(result)

Append a FitResult object to the FitResults object

save(filename[, model])

Saves the FitResults object to a FITS file

velocities(model[, row, column, vtype])

Calculate the Doppler velocities of the fit results using model parameters

Methods Documentation

append(result)[source]

Append a FitResult object to the FitResults object

Parameters

result (FitResult object) – FitResult object to append.

save(filename, model=None)[source]

Saves the FitResults object to a FITS file

Parameters
  • filename (file path, file object or file-like object) – FITS file to write to. If a file object, must be opened in a writeable mode.

  • model (child class of mcalf.models.base.ModelBase, optional, default = None) – If provided, use this model to calculate and include both quiescent and active Doppler velocities.

Notes

Saves a FITS file to the location specified by filename. All the parameters are stored in a separate, named, HDU.

velocities(model, row=None, column=None, vtype='quiescent')[source]

Calculate the Doppler velocities of the fit results using model parameters

Parameters
  • model (child class of ModelBase) – The model object to take parameters from.

  • row (int, list, array_like, iterable, optional, default = None) – The row indices to find velocities for. All if omitted.

  • column (int, list, array_like, iterable, optional, default = None) – The column indices to find velocities for. All if omitted.

  • vtype ({'quiescent', 'active'}, default='quiescent') – The velocity type to find.

Returns

velocities – The calculated velocities for the specified row and column positions.

Return type

ndarray of shape (row, column)