Console InterfaceThe SCATMECH library provides functions for querying a user for data and for displaying program status. This page describes how these functions behave. Their functionality can be subdivided into a number of topics: Note that use of the interactive console functions is optional to the programmer. There are other ways of transferring data to and from the library. For example, all classes inheriting Model have a function set_parameter defined to set model parameters. Furthermore, the template class Model_Ptr<model> has a function operator=(const string& name), which enables a particular instance of the class to be created. Single value entryThe simplest functions query the user for a single value and are described in User Interface Functions. These routines always present the user with a default value, given in brackets (e.g. < >). The user can type in a specific value followed by return, or accept the default value by just pressing return without entering anything else. For example: Wavelength [um] <0.532> : Here, the user can accept the default of 0.532 μm, or type in something else. Top of Page.Dielectric function entryThe class dielectric_function has functions AskUser which query the user. When the user is asked for an optical constant or dielectric function, he has a number of options. Consider the following prompt: Substrate [n, (n,k), or filename] <(4.15,0.05)> : If the user just presses return, then the substrate optical constant will be taken to be 4.15+i0.05. If the user responds with a single number, then the program will ask for the value of k. For example, Substrate [n, (n,k), or filename] <(4.15,0.05)> :1.5 Substrate (k) <0.05> : If the user wishes to enter both n and k simultaneously, then he can type them both as a complex number: Substrate [n, (n,k), or filename] <(4.15,0.05)> :(1.5,0) The user can also enter the name of a file containing the tabulated wavelength dependence of the optical constants: Substrate [n, (n,k), or filename] <(4.15,0.05)> :silicon.dat See the information in Table for a discription of the file formats allowed. For a dielectric_function, the file must contain at least three columns, corresponding to wavelength, index of refraction, and extinction coefficient. Top of Page.Film stack entryThe class dielectric_stack has functions AskUser which query the user. If the library queries for information about a stack of films, it will prompt the user with something like: Films on rough surface (':filename', or index and thickness) <> : The user can accept the default (no films) by pressing return. The user can also type an index (as a complex number pair) and thickness. For example: Films on rough surface (':filename', or index and thickness, or a blank line) <> :(2.1,0) 0.3 Layer #2: Films are entered in the order that they are deposited onto the sample. That is, the most buried film is entered first. A blank line will complete the description of the film stack. The index can also be entered as a filename as described above. For example, if the file TiO2 contains a tabulation of the optical properties of a common coating material, then: Films on rough surface (':filename', or index and thickness, or a blank line) <> :TiO2 0.3 Layer #2: Several films can be entered in a single line by alternating materials and thicknesses: Films on rough surface (':filename', or index and thickness, or a blank line) <> :MgF 0.185 ZnS 0.218 MgF 0.185 Layer #4: Finally, one can specify a film stack using a file containing the film information by entering a colon (:) followed by the filename: Films on rough surface (':filename', or index and thickness, or a blank line) <> ::filmfile The film description file contains two columns. The first column is the material (specified by complex number or filename), and the second column is the thickness. Again, the films are entered in the order in which they are deposited. For example, the following is an appropriate file for an interference filter: Top of Page.MgF 0.185 ZnS 0.109 MgF 0.185 ZnS 0.109 MgF 0.185 ZnS 0.109 MgF 0.185 ZnS 0.218 MgF 0.185 ZnS 0.109 MgF 0.185 ZnS 0.109 MgF 0.185 ZnS 0.109 MgF 0.185 Model entryThe template class Model_Ptr<model> has an operator defined that enables statements like, Model_Ptr<BRDF_Model> brdf = Get_Model_Ptr(); Model_Ptr<Slope_Distribution_Function> sdf = Get_Model_Ptr(); Model_Ptr<SphericalScatterer> sphere = Get_Model_Ptr(); which will query the user for a specific model and assign a pointer to a new instance of that model. For example, if the first of these statements were executed, then the user would see, -- Available BRDF_Model Classes -- (A) <MENU> Roughness_BRDF_Model (B) <MENU> Facet_BRDF_Model (C) <MENU> Lambertian_BRDF_Model (D) <MENU> Local_BRDF_Model (E) <MENU> Instrument_BRDF_Model (F) First_Diffuse_BRDF_Model (?) Turn on descriptions Choose one <A> : The user can either enter the letter preceeding the choice or the entire name of the class. The <MENU> indication tells the user that there are more models under that menu item. For example, if the user types A and return, then he will see the menu -- Available Roughness_BRDF_Model Classes -- (A) Microroughness_BRDF_Model (B) Correlated_Roughness_BRDF_Model (C) <MENU> Roughness_Stack_BRDF_Model (D) Two_Face_BRDF_Model (?) Turn on descriptions (^) Return to previous menu Choose one <A> : When one is not in the top level listing of models, then one can return to the previous menu by typing a caret (^) and return. By typing a question mark (?) and return, one can get more descriptive names of the models: -- Available BRDF_Model Classes -- (A) <MENU> Roughness_BRDF_Model.............Models requiring a power spectrum. (B) <MENU> Facet_BRDF_Model.................Specular point approximation. (C) <MENU> Lambertian_BRDF_Model............A constant, fully-depolarizing BRDF. (D) <MENU> Local_BRDF_Model.................All models for discrete defects. (E) <MENU> Instrument_BRDF_Model............A virtual class for effective BRDF models for instrument functions (F) First_Diffuse_BRDF_Model................Model for the single scattering from a diffuse material. (?) Turn off descriptions (^) Return to previous menu Choose one <A> : The user can type the full name of any model shown or hidden in a lower level menu. For example, the following response will cause the program to use Microroughness_BRDF_Model: Top of Page.-- Available BRDF_Model Classes -- (A) <MENU> Roughness_BRDF_Model (B) <MENU> Facet_BRDF_Model (C) <MENU> Lambertian_BRDF_Model (D) <MENU> Local_BRDF_Model (E) <MENU> Instrument_BRDF_Model (F) First_Diffuse_BRDF_Model (?) Turn on descriptions Choose one <A> :Microroughness_BRDF_Model Searching for filesAs mentioned above, in order to obtain information about
optical properties or film stacks,
some routines may attempt to access a file during
execution. These routines will search in the current
directory for the file. If the file is not found in the
current directory, an attempt will be made to access the
environment variable SCATMECH. If it exists the
routines will use its contents to search for the file. The environment variable should
contain a list of directories to search, separated by semicolons, and each directory should
include the final directory delimiter ("\" or "/"). For example, in Windows
the SCATMECH variable might be set to something like C:\DATA\OPTPROP\;C:\DATA\GRATINGS\ In a UNIX-like system, the SCATMECH variable might be set to something like ~/data/optprop/;~/data/gratings/ Top of Page. For More Information
SCATMECH Technical Information and Questions
Current SCATMECH version: 7.22 (April 2021) |