def copySubKeywords(inhdr, outhdr, subarray):
    """Copy the subarray keywords from one header to another.

    This is for copying the subarray keywords from the input extension
    header to the primary header of the csum file.

    Parameters
    ----------
    inhdr: pyfits Header Object
        Input header.

    outhdr: pyfits Header Object
        Output header.

    subarray: boolean
        True if the exposure used one or more subarrays.
    """
    if subarray:
        outhdr['nsubarry'] = inhdr.get('nsubarry', 0)
    else:
        outhdr['nsubarry'] = 0
    for i in range(8):
        x_corner_kwd = 'corner%1dx' % i
        y_corner_kwd = 'corner%1dy' % i
        x_size_kwd = 'size%1dx' % i
        y_size_kwd = 'size%1dy' % i
        outhdr[x_corner_kwd] = inhdr.get(x_corner_kwd, -1)
        outhdr[y_corner_kwd] = inhdr.get(y_corner_kwd, -1)
        outhdr[x_size_kwd] = inhdr.get(x_size_kwd, -1)
        outhdr[y_size_kwd] = inhdr.get(y_size_kwd, -1)
