transform_magnitudes#

stellarphot.utils.transform_magnitudes(input_mags, catalog, transform_catalog, input_mag_colum='mag_inst_r', catalog_mag_column='r_mag', catalog_color_column='B-V', faintest_mag_for_transform=14, sigma=2, order=1, gain=None)[source]#

Calculate catalog magnitudes and transform coefficients from instrumental magnitudes.

Parameters:
input_magsastropy.table.Table

Table which contains a column with instrumental magnitudes, i.e. -2.5 * log10(net_counts / exposure_time).

catalogastropy.table.Table

Table containing reference catalog of magnitudes and colors.

transform_catalogastropy.table.Table

Table containing the reference catalog of magnitudes and colors to use in determining the transform coefficients. Can be the same table as catalog if desired.

input_mag_columnstr, optional

Name of the column in input_mags with the magnitudes to be transformed.

catalog_mag_columnstr, optional

Name of the column in catalog with the reference magnitude.

catalog_color_columnstr, optional

Name of the column in catalog with color for each star in the catalog.

faintest_mag_for_transformfloat, optional

If this is not None, the magnitude of the faintest catalog stars to use in computing transform coefficients.

sigmafloat, optional

Number of standard deviations to use in rejecting outliers when fitting using sigma clipping.

orderint, optional

Order of the polynomial to use in fitting magnitude difference/color relationship.

gainfloat, optional

If not None, adjust the instrumental magnitude by -2.5 * log10(gain), i.e. gain correct the magnitude.

Returns:
our_cat_magsastropy.table.Column

The calculated catalog magnitudes for the stars in input_mags.

good_match_allnumpy.ndarray

Boolean array indicating which stars in input_mags have a match in the catalog.

transformsastropy.modeling.FittableModel

The coefficients of the transform. The coefficients are in the order of ascending power, i.e. the coefficient ci is the coefficient of the term x**i. Warning: This returns a namedtuple if the fit fails.