def set_header(comp, hdul):
    """
    Set the header of the beam FITS file.

    Parameters
    ----------
    comp : ndarray
        Array of shape (channels, resolution, resolution) containing the
        real or imaginary values of the beam sensitivity.
    hdul : HDUList object
        HDUList of a FITS file object.

    Returns
    -------
    hdul : HDUList object
        The HDUList object with its header defined.
    """

    hdul[0].header['CTYPE1'] = 'L'
    hdul[0].header['CRPIX1'] = comp.shape[1]/2 + 1
    hdul[0].header['CRVAL1'] = 0.0
    hdul[0].header['CDELT1'] = 30.0/comp.shape[1]
    hdul[0].header['CUNIT1'] = 'deg'

    hdul[0].header['CTYPE2']  = 'M'
    hdul[0].header['CRPIX2'] = comp.shape[1]/2 + 1
    hdul[0].header['CRVAL2'] = 0.0
    hdul[0].header['CDELT2'] = 30.0/comp.shape[1]
    hdul[0].header['CUNIT2'] = 'deg'

    hdul[0].header['CTYPE3'] = 'FREQ'
    hdul[0].header['CRPIX3'] = 1
    hdul[0].header['CRVAL3'] = 800000000.0
    hdul[0].header['CDELT3'] = 1000000000.0/comp.shape[0]
    hdul[0].header['CUNIT3'] = 'Hz'

    hdul[0].header['TELESCOP'] = 'FAKE MeerKAT'

    return hdul