pyoptools.raytrace.mat_lib.material module¶
Material class definition, and helper functions used to load the constants of the dispersion formula to be used in the calculation of the refraction index.
It uses the database from https://refractiveindex.info
- pyoptools.raytrace.mat_lib.material.find_material(search, printout=True, exact=False, unalias=False)¶
Search for a material where the string _search_ is found in the name or description. For example:
If printout is True, prints a list of the commands used to access the matching materials.
If exact is True, return only the items where the material name is an exact match of the search string.
If unalias is True, the materials found in the alises list, will be translated to the real material.
Returns a list of the keys which can be used to retrieve candidate materials.
Example finding all SF-11 type glasses: ``` material.find_material(‘SF11’)
material.hikari[‘J-SF11’] material.hikari[‘E-SF11’] material.hikari[‘SF11’] material.schott[‘N-SF11’] material.schott[‘SF11’]
Note that for compounds, the common name can be searched as well, for example:
``` material.find_material(‘styrene’)
material.organic[‘C8H8:Sultanova’] material.organic[‘C8H8:Myers’]
- pyoptools.raytrace.mat_lib.material.get_from(name: str, libs: str, check_aliases=True)¶
Finds a glass type located in a specific manufacturer library, or space-separate list of libraries.
This is mostly used internally because many optical component definitions specify the glass catalogs in this way.
Note that this method is only available from the base material module.
name : name of the glass to find libs : A name of a manufacturer library, e.g. ‘schott’, or a list
of space-separate manufacturer names, in which case they will be searched in the order given. Insensitive to capitalization.
- check_aliasesif True (default), will check within material
aliases after checking in specified libraries. Note that aliases can include compounds in addition to glasses.
Raise KeyError if no material found in the given libraries.
- pyoptools.raytrace.mat_lib.material.get_glass_libraries()¶
Returns a list of strings containing the names of the glass libraries defined in PyOpTools
- pyoptools.raytrace.mat_lib.material.get_glass_materials_from_library(libname)¶
Returns a list of strings containing the names of the materials defined in the library ‘libname’