R/getDwell.R

getDwell=function(frame,dwellTime,zPos,F,t,extraTrim=0){
                                        #Strip the extension curve from imported ibw data stored in frame (a data frame) zPos should be the column of that frame corresponding to the position of the z piezo (deflection would also probably work)
                                        #remove extract curve and any tail at the start of the extension
    startPoint=which.max(frame[,F])
    tStart=frame[startPoint,t]
    tEnd=tStart+dwellTime-extraTrim*dwellTime
    endPoint=which.min(abs(frame[,t]-tEnd))
    endPoint=floor(1*endPoint)
    return(frame[startPoint:endPoint,])
}
nstone8/Rasylum documentation built on May 9, 2019, 8:18 a.m.