getStokes.from.metaData: Preprocess Meta Data From Stokes Measurements Of Optical...

View source: R/getStokes_from_experiment.R

getStokes.from.metaDataR Documentation

Preprocess Meta 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 meta 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 vector before and after the optical fiber.

Usage

getStokes.from.metaData(meta.elab)

Arguments

meta.elab

The meta 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 vector before interferring with the fiber, after interferring with the fiber. 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.expData.

Examples

# Read data from elabFTW
input.data <- GET.elabftw.bycaption(EXPID, caption="Metadaten", header=T)
# Read data from elabFTW and read the attached .csv files
input.data <- GET.elabftw.bycaption(EXPID, caption="Metadaten", 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.metaData(input.data)


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