class dielectric_function


This class handles the storage of the wavelength dependence of the optical constants of a material. The optical constants are internally stored as a lookup table of optical constants n and k, using two elements of the class Table. The optical constants can be assigned values with a single pair of constants (n and k) or from a text file. See Table for information about the format of the text file. The wavelengths are in column 1, the values of n are in column 2, and the values of k are in column 3.

Include file:

#include "dielfunc.h"

Source code:

dielfunc.cpp

See also:

SCATMECH Home,   Conventions,   dielectric_constant,   optical_constant,   Table

Definition of public elements:

class dielectric_function {
        dielectric_function();
        dielectric_function(const string& filename);
        dielectric_function(const optical_constant& nn);
        dielectric_function& operator=(const dielectric_function& df);
        void read(const string& filename);
        dielectric_constant epsilon(double lambda) const;
        optical_constant index(double lambda) const;
        double e1(double lambda) const;
        double e2(double lambda) const;
        double n(double lambda) const;
        double k(double lambda) const;
        static dielectric_function AskUser(const string& query,
                                           const string& deflt);
        static dielectric_function AskUser(const string& query,
                                           const optical_constant& deflt);
        void force_nonabsorbing();

        void set_interpolationx(Table::InterpolationMode m);
        Table::InterpolationMode get_interpolationx();
        void set_interpolationy(Table::InterpolationMode m);
        Table::InterpolationMode get_interpolationy();

};

dielectric_function()
dielectric_function(const string& filename)
dielectric_function(const optical_constant& nn)

The class constructors. When called with no argument, the class must be assigned a value (either through read or with operator=) before other functions can be called. When called with string containing the name of a file, the constructor will call the function read using that file. When called with an optical_constant, the class will be constructed with constant optical constants.

Examples:

dielectric_function eps1;   // Default constructor
dielectric_function eps2("silicon"); // Using a file name to initialize the values
dielectric_function eps3("(1.5,0)"); // Using a (n,k) pair of values as a string
dielectric_function eps4(optical_constant(1.5,0.)); // Using an optical constant
	

Top of Page

dielectric_function& operator=(const dielectric_function& df)

This function allows for assignment.

Example:

dielectric_function eps1 = dielectric_function("silicon");
	

Top of Page

void read(const string& filename)

This function will either read a file whose name is pointed to by filename or attempt to read the string as a complex number, interpreted as a complex index of refraction, e.g., "(3.4,1.2)". If the string is the name of a file, that file must contain at least three columns:

Column   Description
1   Wavelength
2   Real part of refractive index (n)
3   Imaginary part of refractive index (k)

Top of Page

dielectric_constant epsilon(double lambda) const

Function that returns the dielectric_constant of the material at wavelength lambda.

Top of Page

optical_constant index(double lambda) const

Function that returns the optical_constant of the material at wavelength lambda.

Top of Page

double e1(double lambda) const
double e2(double lambda) const

Functions that return either the real part (ε1) or the imaginary part (ε2) of the dielectric constant, evaluated at wavelength lambda.

Top of Page

double n(double lambda) const
double k(double lambda) const

Functions that return either the real part (n) or the imaginary part (k) of the complex index of refraction, evaluated at wavelength lambda.

Top of Page

static dielectric_function AskUser(const string& query,const string& deflt)
static dielectric_function AskUser(const string& query,const optical_constant& deflt)

Functions that query the user using the standard input stream (cin) and the standard unbuffered error stream (cerr). The first argument is the query, while the second is the default response. If the second argument is a reference to a string, the default is interpreted as a filename. If the second argument is an optical_constant, the default is a constant function with that value. The response by the user can be either a filename or a value. If the response is a single number, it will assumed to be the real part of the optical constant, and the user will be asked for a second value, which will be interpreted as the imaginary part of the optical constant. If the initial response cannot be interpreted as a number, then the function will assume the response is the name of a file.

Examples:

dielectric_function eps;
eps = dielectric_function::AskUser("Enter the optical constants","silicon.dat");
eps = dielectric_function::AskUser("Enter the optical constants again",optical_constant(4.15,0.05));

See Console Interface for more information.

Top of Page

void force_nonabsorbing()

This function forces the material to be non-absorbing by setting the imaginary part of the index of refraction to zero.

Top of Page

void set_interpolationx(InterpolationMode m)
InterpolationMode get_interpolationx()
void set_interpolationy(InterpolationMode m)
InterpolationMode get_interpolationy()

Functions to set and get the interpolation mode for each of the axes of the Table. By default, a Table is interpolated linearly. Other The independent variable (x) may be interpolated linearly (LIN) or logarithmically (LOG). The dependet variable (y) may be interpolated linearly (LIN), logarithmically (LOG), as a cubic spline (SPLINE), or as a cubic spline on a logarithmic scale (LOGSPLINE).

Top of Page


For More Information

SCATMECH Technical Information and Questions
Sensor Science Division Home Page
Sensor Science Division Inquiries
Website Comments

Current SCATMECH version: 7.22 (April 2021)