cosmo_utils.mock_catalogues.mags_calculations.apparent_to_absolute_magnitude(app_mag, lum_dist, unit='mpc')[source] [edit on github]

Calculates the absolute magnitude based on luminosity and apparent magnitude.


app_mag : array_like

Array of apparent magnitude(s)

lum_dist : array_like

Array of luminosity distnace to object. In units of Mpc.

unit : {‘pc’, ‘kpc’, ‘mpc’} str, optional

Unit to use for lum_dist. This variable is set to mpc by default. When pc, the units are in parsecs, while mpc is for distances in mega-parsecs, etc.


abs_mag : np.ndarray

Array of absolute magnitudes. abs_mag is a float if app_mag is a float or int.