pyoptools.raytrace.system.system module

Module that defines the optical system class System()

class pyoptools.raytrace.system.system.System

Bases: pyoptools.misc.picklable.picklable.Picklable

Class to define an optical system.

The System class defines an optical system as a list of optical components, the coordinates of the component origin, and the rotation angles of such components. To define a system the refraction index, or the material surrounding the components must also be given in the n attribute.

ARGUMENTS:

complist contains a tuple list that defines the optical system. The first component of the tuple is an instance of the component to include in the system. The second is tuple with the with the component location (X,Y,Z) The third is a tuple with the rotation around each axis (rx,ry,rz) the rotations ar applied first rz, then ry and then rx.
n contains the refraction index of the media where the system is immersed.

EXAMPLE:

Example of a system containing a doublet and a CCD detector:

# Definition of a doublet type lens
DB1=Doublet(radius=12.5,
    curvature_as =1./61.47,
    curvature_ms =-1./44.64,
    curvature_ps =-1./129.94,
    thickness_al = 6.,
    thickness_pl = 2.5,
    material_al  = N_BK7,
    material_pl  = SF5)

# Definition of a ccd type detector
ccd=CCD()

# Definition of a system
os=System(complist=[(DB1,(20,0,200),(0,0,0)),(ccd,(20,0,400),(0,0,0)),],n=1)
clear()
clear_ray_list()

Clear the ray lists of the system

complist
distance()

Distance length from a ray origin to a subsystem, 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_component()

Return the component thatis defined using the surface described by path

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

get_surface()

Return a surface, given a path.

A path is given as a list of keys

items()
iter()
iteritems()
iterkeys()
itervalues()
keys()
merge()

Method to merge simulation systems. Useful for joining raytraces that where split for parallel processing.

n
pop()
popitem()
prop_ray
propagate()

Propagates all the rays in the non propagated list.

propagate_ray()

Method to propagate the ray in the system. It creates the nexts rays and links them using the Ray.parent, and Ray.childs attributes. It calls itself recurrently.

Arguments:

ri
Ray to propagate

Return Value

It returns ri

propagate_ray_ns()

Method to propagate the ray in the system.

Arguments

gr Guide ray previously propagated in the system using the non sequential algorithm. This ray contains the surface sequence that the rays must follow.
dpath Path (key) of the destination surface.

This method uses the same n as the calculated in the non sequential propagation. If the wavelength change, assertion error is raised

ray_add()

Rutina que adiciona un rayo a la lista de rayos primarios del sistema optico. Recibe como parametro una rayo o una lista de rayos. Genera un error si se le pasa algo diferente a un rayo (instancia de la clase Ray, genera una excepcion ‘’’

reset()

Run the reset method on all the components used to create the system

setdefault()
update()
update_ids()

Update the ids for all the surfaces in the system.

This should be done before running a propagation.

values()
viewitems()
viewkeys()
viewvalues()