rayoptics.raytr.opticalspec module
Container class for optical usage information
- class OpticalSpecs(opt_model, specsheet=None, **kwargs)[source]
Bases:
object
Container class for optical usage information
Contains optical usage information to specify the aperture, field of view, spectrum and focal position. These can be accessed via the mapping interface:
self[‘wvls’]: instance of
WvlSpec
self[‘pupil’]: instance of
PupilSpec
self[‘fov’]: instance of
FieldSpec
self[‘focus’]: instance of
FocusRange
It also maintains a repository of paraxial data.
- do_aiming
if True, iterate chief rays to stop center, else entrance pupil
- do_aiming_default = True
- property spectral_region
- property pupil
- property field_of_view
- property defocus
- conjugate_type(space: str = 'object') str [source]
Returns if object or image space is finite or infinite conjugates.
- ray_start_from_osp(pupil, fld, pupil_type: str)[source]
turn pupil and field specs into ray start specification.
- Parameters:
pupil – aperture coordinates of ray
fld – instance of
Field
pupil_type – controls how pupil data is interpreted - ‘rel pupil’: relative pupil coordinates - ‘aim pt’: aim point on pupil plane - ‘aim dir’: aim direction in object space
- class WvlSpec(wlwts=[('d', 1.0)], ref_wl=0, do_init=True, **kwargs)[source]
Bases:
object
Class defining a spectral region
A spectral region is a list of wavelengths (in nm) and corresponding weights. The central wavelength of the spectral region is central_wvl. The index into the wavelength list for central_wvl is reference_wvl.
- property central_wvl
- class PupilSpec(parent, key=('object', 'epd'), value=1.0)[source]
Bases:
object
Aperture specification
- key
‘object’|’image’, ‘epd’|’NA’|’f/#’
- value
size of the pupil
- pupil_rays
list of relative pupil coordinates for pupil limiting rays
- ray_labels
list of string labels for pupil_rays
‘pupil’ is a deprecated literal pupil_value_type; use ‘epd’ instead.
- default_pupil_rays = [[0.0, 0.0], [1.0, 0.0], [-1.0, 0.0], [0.0, 1.0], [0.0, -1.0]]
- default_ray_labels = ['00', '+X', '-X', '+Y', '-Y']
- property key
(‘object’|’image’, ‘epd’|’NA’|’f/#’)
- class FieldSpec(parent, key=('object', 'angle'), value=0, flds=None, index_labels=None, is_relative=False, is_wide_angle=False, do_init=True, **kwargs)[source]
Bases:
object
Field of view specification
- key
‘object’|’image’, ‘height’|’angle’
- value
maximum field, per the key
- fields
list of Field instances
- is_relative
if True, fields are relative to max field
- is_wide_angle
if True, aim at real entrance pupil
- property key
(‘object’|’image’, ‘height’|’angle’)
- property value
- check_is_wide_angle(angle_threshold=45.0) bool [source]
Checks for object angles greater than the threshold.
- obj_coords(fld)[source]
Return a pt, direction pair characterizing fld.
If a field point is defined in image space, the paraxial object space data is used to calculate the field coordinates.
- class Field(x: float = 0.0, y: float = 0.0, wt: float = 1.0, fov=None, max_field=None)[source]
Bases:
object
a single field point, chief ray pkg and pupil limits
The Field class manages several types of data:
the field coordinates, unscaled and fractional
aim info for tracing through the stop surface
the vignetting factors for the pupil definition
pkgs for the chief ray and reference sphere
The Field can have a reference to a fov/FieldSpec (recommended!) which is used to support the fractional and value interfaces simultaneously. If no fov is given, a max_field may be specified, with the default being unit field size.
- vux
+x vignetting factor
- vuy
+y vignetting factor
- vlx
-x vignetting factor
- vly
-y vignetting factor
- wt
field weight
- aim_info
x, y chief ray coords on the paraxial entrance pupil plane, or z_enp for wide angle fovs
- chief_ray
ray package for the ray from the field point throught the center of the aperture stop, traced in the central wavelength
- ref_sphere
a tuple containing (image_pt, ref_dir, ref_sphere_radius)
- property is_relative
if True, x and y are normalized by max_field, else they are unscaled.