knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)

rindex

All user-provided wavelengths must be given in meters.

Installation

You can install rindex from github with:

# install.packages("devtools")
devtools::install_github("tjconstant/rindex")

Example

Searching for a refractive index dataset

library(rindex)

rindex.search("silver")

Retreiving a dataset

Retrieving a dataset is done using the rindex.get() function. You must specify the unique pageid as found in the search table.

rindex.get(pageid = 1)

Interpolation Functions

You can generate a spline-fit for any dataset using rindex.function(). For example, to get the interpolated refractive index of silver at 633 nm,

Ag <- rindex.function(1)
Ag(633e-9)

A comparison of dataset to spline-function is shown below.

Ag_data <- rindex.get(1)
wavelengths <- seq(200,1900,, 100) * 1e-9

plot(Ag_data$wavelength, Ag_data$n, 
     xlab = "wavelength (m) - log scale", 
     ylab = "n",
     main = "Refractive Index of Silver (Real part)")
lines(wavelengths, Re(Ag(wavelengths)), col = 2, lwd = 2)


tjconstant/rindex documentation built on May 31, 2019, 3:39 p.m.