SPPr-package {SPPr} | R Documentation |
Provides a modelling of multilayer reflection coefficient, convenient functions to reshape the data, plot it against the model and fit.
Package: | SPPr |
Type: | Package |
Version: | 1.0 |
Date: | 2008-01-13 |
License: | GPL |
Baptiste Auguie
Maintainer: baptiste <ba208@ex.ac.uk>
Raether, Born and Wolf
## Not run: library(SPPr) data(scanSPP) data(parameters) head(scanSPP) parameters$zeroShift <- 0 parameters$thickness[3] <- 0 dataNorm <- data2norm(scanSPP,parameters) head(dataNorm) plotData(dataNorm, int=TRUE, col=1, ylim=c(0, 1)) criticalEdge(parameters) layer2fit <- 1 # specify which layer is the one to fit p0 <- pIni(parameters, layer2fit) plotModel(parameters, int=TRUE, col=2) result <- optim(p0, objF) yFin <- fitModel(result$par) yErr<-abs(yFin-dataNorm$N) lines(dataNorm$intAngle, yFin, col=3) parameters <- updateParameters(result$par, layer=layer2fit) ## End(Not run)