6.2. Global Module

6.2.1. optrace.metadata

optrace.metadata.author = 'Damian Mendroch'

project author

optrace.metadata.description = 'An optics simulation package with sequential raytracing, image rendering and a GUI frontend'

short project description

optrace.metadata.documentation = 'https://drocheam.github.io/optrace/'

project documentation url

optrace.metadata.license = 'MIT'

project license

optrace.metadata.name = 'optrace'

project title

optrace.metadata.url = 'https://github.com/drocheam/optrace'

project url

optrace.metadata.version = '1.7.0'

project version

6.2.2. optrace.warnings

exception optrace.warnings.OptraceWarning

Warnings subclass so warnings from this library can be filtered separately with the warnings library

optrace.warnings.simplified_warning(message, category, filename, lineno, file=None, line=None)

simplified warning formatting without filename and linenumber as would be default

Return type:

str

optrace.warnings.warning(text)

emit a warning in a custom warning class with custom formatter and only if global_options allow it

Parameters:

text (str)

Return type:

None

6.2.3. optrace.global_options

class optrace.global_options.ClassGlobalOptions
no_progress_bar()

context manager that toggles the progressbar off

Return type:

None

no_warnings()

context manager that toggles the warning off. NOT RECOMMENDED AS WARNINGS CAN BE IMPORTANT

Return type:

None

multithreading: bool = True

enable/disable multithreading in the backend. For the GUI threading is always enabled

plot_dark_mode: bool = True

dark mode for the pyplots. Background is dark and black and white colors are inverted.

show_progress_bar: bool = True

show a progressbar for backend activities (rendering, tracing, convolving, focussing, …)

show_warnings: bool = True

if optrace should print warnings

spectral_colormap: Callable[[ndarray], ndarray] = None

spectral colormap function that takes wavelengths in nm as numpy.ndarray and returns a (N, 4) shaped numpy array with RGBA colors with values in range 0-1. By default (Value = None) uses a colormap with hues that would be visible by the human eye. It is useful to define a different colormap when working in UV or IR.

ui_dark_mode: bool = True

dark mode for GUI elements (TraceGui, matplotlib windows etc.

wavelength_range: tuple[float, float] = [380.0, 780.0]

wavelength range in nm for light generation and simulation. Must include the range 380-780nm