rayoptics.gui.appcmds module
generic ray optics commands for creating plots and tables
- open_model(file_url, info=False, **kwargs) OpticalModel | None | tuple[OpticalModel, tuple[dict, dict]][source]
open a file or url and populate an optical model with the data
- Parameters:
file_url (str) –
a filename or url of a supported file type
.roa - a rayoptics JSON encoded file
.seq - a CODE V (TM) sequence file
.zmx - a Zemax (TM) lens file
a URL from the www.photonstophotos.net OpticalBench database
info (bool) – if true, return an info tuple with import statistics
kwargs (dict) – keyword args passed to the reader functions
- Returns:
if successful, an OpticalModel instance, otherwise, None
- create_new_optical_model_from_specsheet(specsheet)[source]
create an OpticalModel with a basic thinlens model, given specsheet
- set_vignetting(opt_model, gui_parent=None, **kwargs)[source]
From existing fields and clear apertures, calculate vignetting.
- set_apertures(opt_model, gui_parent=None, avoid_list: Sequence[int] | None = None, include_list: Sequence[int] | None = None)[source]
From existing fields and vignetting, calculate clear apertures.
- Parameters:
avoid_list – list of surfaces to skip when setting apertures.
include_list – list of surfaces to include when setting apertures.
If specified, only one of either avoid_list or include_list should be specified. If neither is specified, all surfaces are set. If both are specified, the avoid_list is used.
If a surface is specified as the aperture stop, that surface’s aperture is determined from the boundary rays of the first field.
The avoid_list idea and implementation was contributed by Quentin Bécar
- set_stop_aperture(opt_model, gui_parent=None, **kwargs)[source]
Set the aperture on the stop surface to satisfy the pupil spec and reset the vignetting.
- set_pupil(opt_model, gui_parent=None, use_parax: bool = False)[source]
From existing stop size, calculate pupil spec and vignetting.