Applies correction values to the MS1 ion m/z arrays in order to correct
    for a time dependent m/z error.

    :param msrunContainer: intance of :class:`maspy.core.MsrunContainer`,
        containing the :class:`maspy.core.Sai` items of the "specfile".
    :param specfile: filename of an ms-run file to which the m/z calibration
        should be applied
    :param correctionData: a dictionary containing the calibration values for
        each MS1 ``Si``, as returned by :func:`timecalMs1DataMedian()`.
        ``{si.id: {'calibValue': float}``
    :param toleranceMode: "relative" or "absolute"
        Specifies how the ``massTolerance`` value is applied, by default
        "relative".

def applyTimeCalMs1(msrunContainer, specfile, correctionData, **kwargs):
    """Applies correction values to the MS1 ion m/z arrays in order to correct
    for a time dependent m/z error.

    :param msrunContainer: intance of :class:`maspy.core.MsrunContainer`,
        containing the :class:`maspy.core.Sai` items of the "specfile".
    :param specfile: filename of an ms-run file to which the m/z calibration
        should be applied
    :param correctionData: a dictionary containing the calibration values for
        each MS1 ``Si``, as returned by :func:`timecalMs1DataMedian()`.
        ``{si.id: {'calibValue': float}``
    :param toleranceMode: "relative" or "absolute"
        Specifies how the ``massTolerance`` value is applied, by default
        "relative".
    """
    toleranceMode = kwargs.get('toleranceMode', 'relative')

    if toleranceMode == 'relative':
        for siId in correctionData:
            calibValue = correctionData[siId]['calibValue']
            msrunContainer.saic[specfile][siId].arrays['mz'] *= (1 + calibValue)
    elif toleranceMode == 'absolute':
        for siId in correctionData:
            calibValue = correctionData[siId]['calibValue']
            msrunContainer.saic[specfile][siId].arrays['mz'] += calibValue
    else:
        raise Exception('#TODO: a proper exception text')