add_mags#

cogsworth.obs.observables.add_mags(*mags, remove_nans=True)[source]#

Add any number of magnitudes

Parameters:
*magslist or np.array or float or int

A series of magnitudes. If arrays are given then all must have the same length. If a mixture of single values and arrays are given then the single values will be added to each array element

remove_nansbool, optional

Whether to remove NaNs from the total (if not the total will be NaN), by default True

Returns:
total_magndarray

Total magnitude

Raises:
ValueError

If any magnitude is an invalid type

AssertionError

If any magnitude array has a different length from another