RefractiveIndex

RefractiveIndex.RefractiveMaterialMethod
RefractiveMaterial(shelf, book, page)

Load the refractive index data for the material corresponding to the specified shelf, book, and page within the refractiveindex.info database. The data can be queried by calling the returned RefractiveMaterial object at a given wavelength. In the case of database entries with multiple types of dispersion data (e.g. both raw dispersion data and dispersion formula coefficients), a vector of RefractiveMaterials is returned for each data type.

Examples

julia> MgLiTaO3 = RefractiveMaterial("other", "Mg-LiTaO3", "Moutzouris-o")
"Mg-LiTaO3 (Moutzouris et al. 2011: n(o) 0.450-1.551 µm; 8 mol.% Mg)"

julia> MgLiTaO3(0.45) # default unit is microns
2.2373000025056826

julia> using Unitful

julia> MgLiTaO3(450u"nm") # auto-conversion from generic Unitful.jl length units
2.2373000025056826

julia> MgLiTaO3(450e-9, "m") # strings can be used to specify units (parsing is cached)
2.2373000025056826

julia> Hikari_F1 = RefractiveMaterial("glass", "HIKARI-F", "F1")
2-element Vector{RefractiveMaterial}:
 HIKARI-F (F1) - Polynomial
 HIKARI-F (F1) - TabulatedK
source
RefractiveIndex.RefractiveMaterialMethod
RefractiveMaterial(url::String)

Extracts the shelf, book, and page from a refractiveindex.info URL and loads the corresponding data from the local database (does not require an active internet connection).

Warning

The refractiveindex.info website is regularly updated and may contain materials not yet available in the local copy of the database, which is updated on a roughly annual basis. Future versions of this package may allow these new entries to be automatically downloaded on demand.

Examples

julia> Ar = RefractiveMaterial("https://refractiveindex.info/?shelf=main&book=Ar&page=Peck-15C")
"Ar (Peck and Fisher 1964: n 0.47-2.06 µm; 15 °C)"

julia> describe(Ar)
Name: Ar (Peck and Fisher 1964: n 0.47–2.06 µm; 15 °C)
Reference: E. R. Peck and D. J. Fisher. Dispersion of argon, <a href="https://doi.org/10.1364/JOSA.54.001362"><i>J. Opt. Soc. Am.</i> <b>54</b>, 1362-1364 (1964)</a>
Comments: 15 °C, 760 torr (101.325 kPa)
Dispersion Formula: Gases
Wavelength Range: (0.4679, 2.0587)
Specifications: Dict{Symbol, Any}(:temperature => "15 °C", :wavelength_vacuum => true, :pressure => "101325 Pa", :n_absolute => true)
source
RefractiveIndex.dispersionMethod
dispersion(m::RefractiveMaterial, λ::Float64)

Returns the refractive index of the material m at the wavelength λ (in microns). An error is thrown if the material does not have refractive index data.

source
RefractiveIndex.extinctionMethod
extinction(m::RefractiveMaterial, λ::Float64)

Returns the extinction coefficient of the material m at the wavelength λ (in microns). An error is thrown if the material does not have extinction data.

source
RefractiveIndex.showmetadataMethod
showmetadata(rm::RefractiveMaterial)

Prints the metadata for the material rm to the terminal.

Examples

julia> Ar = RefractiveMaterial("main", "Ar", "Peck-15C")
Ar (Peck and Fisher 1964: n 0.47–2.06 µm; 15 °C) - Gases

julia> showmetadata(Ar)
Name: Ar (Peck and Fisher 1964: n 0.47–2.06 µm; 15 °C)
Reference: E. R. Peck and D. J. Fisher. Dispersion of argon, <a href="https://doi.org/10.1364/JOSA.54.001362"><i>J. Opt. Soc. Am.</i> <b>54</b>, 1362-1364 (1964)</a>
Comments: 15 °C, 760 torr (101.325 kPa)
Dispersion Formula: Gases
Wavelength Range: (0.4679, 2.0587)
Specifications: Dict{Symbol, Any}(:temperature => "15 °C", :wavelength_vacuum => true, :pressure => "101325 Pa", :n_absolute => true)
source
RefractiveIndex.specificationsMethod
specifications(rm::RefractiveMaterial)

Returns a Dict containing the measurement specifications for the material rm.

Examples

julia> using Unitful

julia> specs = specifications(Ar)
Dict{Symbol, Any} with 4 entries:
  :temperature       => "15 °C"
  :wavelength_vacuum => true
  :pressure          => "101325 Pa"
  :n_absolute        => true

julia> T, P = [uparse(replace(specs[s], ' ' => '*')) for s in (:temperature, :pressure)]
2-element Vector{Quantity{Int64}}:
     15 °C
 101325 Pa
source