add los_gain calculation function