def _average_nadir_gain_dbi(pattern, angles):
    """Average gain on the nadir face of the satellite.

    For simplicity, this function assumes some hard-coded values of
    65-degrees off of boresight.  That translates to 0->65 and (360-65)->360
    """
    s = 0
    n = 0
    offset = 65
    for i in range(len(pattern)):
        angle = angles[i]
        gain = pattern[i]
        if 0 <= angle <= offset or 360 - offset <= angle <= 360:
            s += gain
            n += 1
    return s / n
