get_typical_gain_magnitude

sofia_redux.scan.channels.channel_numba_functions.get_typical_gain_magnitude(gains)[source]

Return the typical gain magnitude for a gain array.

The typical gain magnitude (g_mag) for an array of gains (g) is given by:

g_mag = exp(inner_80_percent_mean(ln(1 + |g|))) - 1

Only finite values of g will be included in the mean calculation. If g_mag evaluates to < 0, then a result of 1 will be returned (which should not happen). Note that this mean will rarely ever evaluate to the true mean. Thus, removing this mean and re-evaluating (as is done with many functions for sofia_scan) will probably get you close to zero, but not actually hit the mark. Just be aware of this as it can cause confusion.

Parameters:
gainsnumpy.ndarray (float)
Returns:
gain_magnitudefloat