autowisp.magnitude_fitting.linear module

Class Inheritance Diagram

Inheritance diagram of FitTermsInterface, LinearMagnitudeFit, MagnitudeFit

Implement magnitude fitting using linear regression.

class autowisp.magnitude_fitting.linear.LinearMagnitudeFit(*, config, **kwargs)[source]

Bases: MagnitudeFit

Inheritance diagram of autowisp.magnitude_fitting.linear.LinearMagnitudeFit

Differential photometry correction using linear regression.

__call__(*args, **kwargs)[source]

Delay creating of fit terms to avoid pickling.

__init__(*, config, **kwargs)[source]

Initialize a magnitude fitting object using linear least squares.

Parameters:

config

An object with attributes configuring how to perform magnitude fitting. It should provide at least the arguments required by the parent class and the following:

  • correction_parametrization: As string that expands to the terms to include in the magnitude fitting correction.

  • max_mag_err: The largest the formal magnitude error is allowed to be before the source is excluded.

  • noise_offset: Additional offset to format magnitude error estimates when they are used to determine the fitting weights.

  • error_avg: See same name argument to autowisp.fit_expression.iterative_fit().

  • rej_level: See same name argument to autowisp.fit_expression.iterative_fit().

  • max_rej_iter: See same name argument to autowisp.fit_expression.iterative_fit().

Returns:

None

_compute_mag_offset(phot_fit_results, fit_base, header)[source]

Evaluate the magfit correction at the image centre for a median star.

Builds a synthetic source whose per-field values are the median of fit_base, then overrides x and y with the image centre (NAXIS1/2, NAXIS2/2). The correction is evaluated by dotting the fit coefficients with the resulting predictors, and the median across fit groups is returned.