read.delay_scan: Quick analysis and plot of time dynamics

Description Usage Arguments Value Examples

Description

Takes an average time dynamics dataset and returns a dataframe and optionally plots data.

Usage

1
read.delay_scan(filename, time_max = 1, zero_offset = 1:10, quick_plot = T)

Arguments

filename

The filename of the averaged output file from labview

time_max

maximum time in the scan

zero_offset

Add a zero offset if required

quick_plot

Toggle a quick plot

Value

returns a dataframe of time vs signal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (filename, time_max = 1, zero_offset = 1:10, quick_plot = T) 
{
    data <- read.table(filename)$V1
    time <- seq(0, time_max, , length(read.table(filename)$V1))
    data_offset <- data - mean(data[zero_offset])
    if (quick_plot) {
        plot(time, data_offset, xlab = "time (ps)", pch = 16)
        grid()
        lines(time, data_offset)
    }
    return(data.frame(time, data_offset))
  }

tjconstant/photonMonkey documentation built on May 31, 2019, 3:38 p.m.