def addExptimeKeywords(hdr_list, hdr):
    """Copy the exposure time keywords to the output headers.

    exptime and rawtime will be the sums of those values from all (both)
    of the input headers, and expstart and expend will be taken from
    the first and last headers.

    Parameters
    ----------
    hdr_list: list of pyfits Header objects
        List of sci extension headers.

    hdr: pyfits Header object
        Output header, modified in-place
    """
    expstart = hdr_list[0].get('expstart', -999.0)
    expend = hdr_list[-1].get('expend', -999.0)
    exptime = 0.0
    rawtime = 0.0
    for hdr_i in hdr_list:
        exptime_i = hdr_i.get('exptime', 0.0)
        exptime += exptime_i
        rawtime += hdr_i.get('rawtime', exptime_i)
    hdr['expstart'] = expstart
    hdr['expend'] = expend
    hdr['exptime'] = exptime
    hdr['rawtime'] = rawtime
