Skip to content

correct_drift_intvals.m

Basic Information

  SYNTAX:  corrected_d = correct_drift_intvals(old_data,old_tvec,intval1,intval2)

  PURPOSE:  Correct measured shot data for integrator drift.

  INPUT:
    old_data = data vector to correct for drift
    old_tvec = time vector corresponding to old_data
    intval1  = vector [tmin,tmax] to define offset near beginning of data
    intval2  = vector [tmin,tmax] to define offset near end of data
        (optional, default = remove offset from intval1 only)

  OUTPUT:
    corrected_d = data corrected for drift

  RESTRICTIONS:
     (1) Assumes approximately linear drift over duration of shot.

  METHOD: Samples are averaged in data defined by intervals to define beginning
    and end offsets.  Beginning offset is subtracted out.  A linear drift
    defined by the 2 offsets is assumed and corrected for in remainder of data.

Dependencies