def correctTraceAndAlignment(dq_array, info, traceprofile, shift1,
    alignment_correction):
    """Correct the DQ array for the trace and alignment correction.
    The trace and alignment correction shifts every spectrum to a horizontal
    spectrum in (xfull, yfull) space.  The DQ arrays need to be shifted in the
    same way.

    Parameters
    ----------

    dq_array: array-like
        The input DQ array

    info: dictionary
        Keywords and values

    traceprofile: array-like
        Trace profile, a 1-d vector of delta YFULL values for each XCORR.  This
        was SUBTRACTED from the yfull values, so we need to ADD the NEGATIVE
        of this

    alignment_correction:
        The offset that was added to the YFULL values  to correct the alignment
        
    """
    nrows, ncols = dq_array.shape
    total_correction = None
    if alignment_correction is not None:
        total_correction = alignment_correction
        if traceprofile is not None:
            total_correction = -traceprofile + alignment_correction
    return
