calculate_transform_coefficients#
- stellarphot.utils.calculate_transform_coefficients(input_mag, catalog_mag, color, input_mag_error=None, catalog_mag_error=None, faintest_mag=None, order=1, sigma=2.0, gain=None)[source]#
Calculate linear transform coefficients from input magnitudes to catalog magnitudes.
- Parameters:
- input_mag
numpy.ndarrayorastropy.table.Column Input magnitudes; for example, instrumental magnitudes.
- catalog_mag
numpy.ndarrayorastropy.table.Column Catalog (or reference) magnitudes; the magnitudes to which the input_mag will eventually be transformed.
- color
numpy.ndarrayorastropy.table.Column Colors to use in determining transform coefficients.
- input_mag_error
numpy.ndarrayorastropy.table.Column, optional Error in input magnitudes. Default is zero.
- catalog_mag_error
numpy.ndarrayorastropy.table.Column, optional Error in catalog magnitudes. Default is zero.
- faintest_mag_for_transformfloat, optional
If this is not
None, the magnitude of the faintest catalog stars to use in computing transform coefficients.- orderint, optional
Order of the polynomial fit to use in correcting for color.
- sigmafloat, optional
Value of sigma to use to reject outliers while fitting using sigma clipping.
- gainfloat, optional
If not
None, adjust the instrumental magnitude by -2.5 * log10(gain), i.e. gain correct the magnitude.- verbosebool, optional
If
True, print some diagnostic information.- extended_outputbool, optional
If
True, return additional information.
- input_mag
- Returns:
- filtered_data
numpy.ma.core.MaskedArray The data, with the mask set
Truefor the data that was omitted from the fit.- model
astropy.modeling.FittableModel Entries in the model are the coefficients in the fit made to the data. Since the model is always a polynomial, these are terms in a polynomial in the order of ascending power. In other words, the coefficient
ciis the coefficient of the termx**i.- If
extended_output=True, then also return: - fit_inputtuple
A tuple of color, magnitude for only the stars brighter than
faintest_mag_for_transform. These are input to the sigma-clipping fitter.- used_in_fittuple
A tuple of color, magnitude for only the stars brighter than
faintest_mag_for_transformthat were not sigma-cliped out.
- filtered_data
Notes
This function has some pretty serious limitations right now:
Errors in the independent variable are ignored.
Outliers are rejected using a modified loss function (Huber loss) that cannot be modified.
No errors are estimated in the calculated transformation coefficients.
And there is all the stuff that is not listed here…