libSUFR
a LIBrary of Some Useful Fortran Routines
All Classes Namespaces Files Functions Variables Pages
sufr_optics Module Reference

Procedures to do computations in optics. More...

Functions/Subroutines

elemental subroutine reflectance_transmittance (angi, nref1, nref2, runp, tunp, rprp, rpar, tprp, tpar, angt)
 Compute the reflectance for the transition from a medium with refractive index Nref1 to one with Nref2, under an incident angle ang. Optionally, compute the transmittance, and the polarised components. The media are assumed to be non-magnetic.
 
pure real(double) function refractive_index_air (wavelength, temperature, pressure, humidity)
 Computes real index of refraction of air given wavelength, temperature, pressure and relative humidity.
 
pure real(double) function refractive_index_pmma (wavelength)
 Refractive index of PMMA as a function of wavelength.
 
real(double) function, dimension(3) wavelength2rgb (wl, df)
 Return an RGB-value representing the colour corresponding to a light ray with a given wavelength.
 

Detailed Description

Procedures to do computations in optics.

Function/Subroutine Documentation

◆ reflectance_transmittance()

elemental subroutine sufr_optics::reflectance_transmittance ( real(double), intent(in) angi,
real(double), intent(in) nref1,
real(double), intent(in) nref2,
real(double), intent(out) runp,
real(double), intent(out), optional tunp,
real(double), intent(out), optional rprp,
real(double), intent(out), optional rpar,
real(double), intent(out), optional tprp,
real(double), intent(out), optional tpar,
real(double), intent(out), optional angt )

Compute the reflectance for the transition from a medium with refractive index Nref1 to one with Nref2, under an incident angle ang. Optionally, compute the transmittance, and the polarised components. The media are assumed to be non-magnetic.

Parameters
angIAngle of incidence (rad)
Nref1Refractive index of first medium, incoming ray
Nref2Refractive index of second medium, transmitted ray
RunpUnpolarised reflectance (output)
TunpUnpolarised transmittance (output, optional)
RprpPerpendicular polarised reflectance (output, optional)
RparParallel polarised reflectance (output, optional)
TprpPerpendicular polarised transmittance (output, optional)
TparParallel polarised transmittance (output, optional)
angTAngle of transmittance (rad; optional) (output, optional)
See also

Definition at line 54 of file optics.f90.

References sufr_kinds::double, and sufr_constants::pio2.

◆ refractive_index_air()

pure real(double) function sufr_optics::refractive_index_air ( real(double), intent(in) wavelength,
real(double), intent(in) temperature,
real(double), intent(in) pressure,
real(double), intent(in) humidity )

Computes real index of refraction of air given wavelength, temperature, pressure and relative humidity.

Parameters
wavelengthWavelength (nanometers)
temperatureTemperature (degrees Celsius)
pressurePressure (millibar)
humidityRelative humidity (%)
Return values
refractive_index_airRefractive index of air
See also
http://emtoolbox.nist.gov/Wavelength/Documentation.asp#AppendixA

Definition at line 111 of file optics.f90.

References sufr_kinds::double, and refractive_index_air().

Referenced by refractive_index_air().

Here is the call graph for this function:

◆ refractive_index_pmma()

pure real(double) function sufr_optics::refractive_index_pmma ( real(double), intent(in) wavelength)

Refractive index of PMMA as a function of wavelength.

Parameters
wavelengthWavelength in nanometres
Return values
refractive_index_pmmaRefractive index of PMMA
Note
  • valid for 23 degrees C
  • valid between 404.7 and 1083 nm
See also
Marcin Szczurowski, http://refractiveindex.info/?shelf=3d&book=plastics&page=pmma

Definition at line 175 of file optics.f90.

References sufr_kinds::double, and refractive_index_pmma().

Referenced by refractive_index_pmma().

Here is the call graph for this function:

◆ wavelength2rgb()

real(double) function, dimension(3) sufr_optics::wavelength2rgb ( real(double), intent(in) wl,
real(double), intent(in) df )

Return an RGB-value representing the colour corresponding to a light ray with a given wavelength.

Parameters
wlWavelength in nm (390-770 nm)
dfDimming factor 0-1 to scale RGB values with (0-1; 0: black, 1: full colour)
Return values
wavelength2rgbRGB values: (0-1, 0-1, 0-1)
Note
  • Assumed pure colour at centre of their wavelength bands: Colours: Violet, blue, green, yellow, orange, red: (1,0,1) (0,0,1) (0,1,0) (1,1,0) (1,0.5,0) (1,0,0)
  • Colours between 390 and 420nm and 696 and 770nm are darker due to 'fading in' and 'fading out' effects

Definition at line 205 of file optics.f90.

References sufr_kinds::double, sufr_system::warn(), and wavelength2rgb().

Referenced by wavelength2rgb().

Here is the call graph for this function: