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

Calculates the apparent magnitude using the luminosity and absolute magnitude.


abs_mag : float, int, or array_like

Array of absolute 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.


app_mag : array_like, or float

Array of apparent magnitude(s). app_mag is a float if abs_mag is a float or int.