def compute_gain(data,pol):
    """ Compute the gain and apeture efficiency from the data.

    Parameters
    ----------
    data : heterogeneous record array containing 'calc_beam_height' and 'flux' records
    
    Return
    ------
    gain : The gains
    """
    gain = data['beam_height_' + pol] / data['flux']
    return gain