pyoptools.raytrace.component package

Module contents

Module containing the component Class definition

class pyoptools.raytrace.component.Component

Bases: pyoptools.misc.picklable.picklable.Picklable

Class used to define an optical component

To create a component the the user must provide a list containing the surfaces bounding the component, the vertex coordinates of each surface, and the rotation angles describing its orientation. It must also provide information about the material used to build the component.

The material information of the component is given in the “material” attribute. This information can be a Material class instance (some default materials are defined in the mat_lib module), or a refraction index for materials with constant refraction index.

ARGUMENTS:

surflist A list of tuples of the form (surface, (PosX,PosY,PosZ), (RotX,RotY,RotZ)) where surface is an instance of the :class:surface class, PosX,PosY,PosZ are the surface’s vertex coordinates, and RotX,RotY,RotZ are the rotation angles of the surface around the X , Y , and Z axes, in radians. The rotation about the Z axis if applied first, then the rotation about the Y axis, and finally the rotation about the X axis.
material Instance of the class Material with the material definition, or a floating point number to indicate a constant refraction index material
clear()
distance()

Distance length from a ray origin to a component, following the ray path.

Method that calculates the distance traveled by a ray from its origin to the next surface of the component. It returns the physical distance, not the optical distance

Return value
A tuple with the distance, the point of intersection using the coordinate system of the surface, and a pointer to the surface that is closest to the ray (distance,point of intersection, surface)
get_surf_paths()

Method that returns a list that contains the path for each surface.

A path here is a list containing the keys needed to read each surface.

This method is an auxiliary method so this works when called from a System

hit_list
items()
iter()
iteritems()
iterkeys()
itervalues()
keys()
material
n()

Refraction index of the component at the specified wavelength

The wavelength should be given in um. If the wavelength is not given, it is assumed wavelength=0.58929 um

pop()
popitem()
propagate()

Returns the next ray in the propagation

Taking into account the interaction (refraction, reflection, …) at the Component surfaces, return a list containing the resulting rays. n_m is the refraction index of the media surrounding the component.

reset()

Reset the optical component

Method that reset the optical surfaces that compose the Component. For example the detector surfaces should be reset before repeating the ray trace to erase the hit lists. Normally this method should not be used directly. It is called when the reset method of the system class is called

setdefault()
surf_changed()

Increases changes, to indicate that any of the surfaces used to build the optical component was modified :param self: :return:

surflist
update()
values()
viewitems()
viewkeys()
viewvalues()