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_mags
astropy.table.Table Table which contains a column with instrumental magnitudes, i.e. -2.5 * log10(net_counts / exposure_time).
- catalog
astropy.table.Table Table containing reference catalog of magnitudes and colors.
- transform_catalog
astropy.table.Table Table containing the reference catalog of magnitudes and colors to use in determining the transform coefficients. Can be the same table as
catalogif desired.- input_mag_columnstr, optional
Name of the column in
input_magswith the magnitudes to be transformed.- catalog_mag_columnstr, optional
Name of the column in
catalogwith the reference magnitude.- catalog_color_columnstr, optional
Name of the column in
catalogwith 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.
- input_mags
- Returns:
- our_cat_mags
astropy.table.Column The calculated catalog magnitudes for the stars in
input_mags.- good_match_all
numpy.ndarray Boolean array indicating which stars in
input_magshave a match in the catalog.- transforms
astropy.modeling.FittableModel The coefficients of the transform. The coefficients are in the order of ascending power, i.e. the coefficient
ciis the coefficient of the termx**i. Warning: This returns a namedtuple if the fit fails.
- our_cat_mags