getStokes.from.expData: Preprocess Data From Stokes Measurements Of Optical Fibers

View source: R/getStokes_from_experiment.R

getStokes.from.expDataR Documentation

Preprocess Data From Stokes Measurements Of Optical Fibers

Description

This function takes the output from RHotStuff::GET.elabftw.bycaption or RHotStuff::parseTable.elabftw with the parameter outputHTTP=FALSE (see the man page of the functions for details) and computes the stokes vectors for the experimental data of the experiment. The function extracts the power measurements from the input table, normalises it with data from the input table and calculates the stokes vectors before and after the optical fiber for different inital orientations of the lasers plane of polarisation.

Usage

getStokes.from.expData(data.elab)

Arguments

data.elab

The experimental data of a stokes measurement experiment

Details

This function expects the input to be in a specific format. If the elabFTW template "Bestimmung von Stokesvektoren an einer optischen Faser" is used for logging the measurements, the data meets the expectations. If the right template is used, the data can be downloaded like shown in the examples.

Value

A list containing two data.frames: The stokes vectors before interferring with the fiber, after interferring with the fiber for different inital orientations of the lasers plane of polarisation. The data.frames also contain the total measured laser power after and before the fiber. The returned data has the same structure as the return value of getStokes.from.metaData.

Examples

# Read data from elabFTW
input.data <- GET.elabftw.bycaption(EXPID, caption="Messdaten", header=T)
# Read data from elabFTW and read the attached .csv files
input.data <- GET.elabftw.bycaption(EXPID, caption="Messdaten", header=T, outputHTTP=T) 
               %>% parseTable.elabftw(., func=function(x) qmean(x[,4], 
                                                                0.8, 
                                                                na.rm=T, 
                                                                inf.rm=T),
                                      header=T, skip=14, sep=";")
# Convert the measurements into stokes vectors
getStokes.from.expData(input.data)


AlreadyTakenJonas/RHotStuff documentation built on Oct. 28, 2022, 10:15 p.m.