2. For this example, the data file (water.dat in this case) will be put in the same directory as the .ind design file in which the material will be used. If needed, you can create a centrally stored Group Library of materials which can be shared among design files; see Section 8.A in the CAD manual for details.
3. Open the Material Editor with the left CAD toolbar, create a new material, and give the material a descriptive name.
4. The functions userreal() and userimag() are used to link the data files with the material. The real and imaginary parts of the refractive index can be accessed, as a function of the wavelength, with the expressions ‘userreal(“water.dat”,free_space_wavelength)’ and ‘userimag(“water.dat”,free_space_wavelength)’ respectively. Note that these expressions assume that the wavelength is defined in microns in the file. If this is not the case, modify the second argument to be in the desired unit. For example, if the wavelength is defined in nanometers, replace ‘free_space_wavelength’ with ‘free_space_wavelength*1000’. See Appendix C in the CAD manual for a complete description of these functions.
5. Use these expressions to define the Index (real) and Index (Imag) options for the material. Changing the wavelength, either directly in the RSoft CAD or via a MOST parameter scan, will now change the refractive index of the material.