Package theia :: Package optics :: Module optic :: Class Optic
[hide private]
[frames] | no frames]

Class Optic

source code




Optic class.

This class is a base class for optics which may interact with Gaussian
beams and return transmitted and reflected beams (mirrors, lenses, etc.)

The way an optic interacts with a beam (if it adds to the order of a beam
upon reflection or transmission on HR or AR etc) is specified by the
action integers RonHR, TonHR, RonAR, TonAR of the optic. A beam which
reflects on HR will have its order increased by RonHR, etc.

All the optics which transmit or reflect beams (beam splitters, mirrors,
thin and thick lenses and special optics) inherit from this class. A
particular type of optic is characterized by its action integers and by the
inputs provided to the constuctors by the users. Everything else of the
optics follow the shape of this Optic class.


*=== Attributes ===*
SetupCount (inherited): class attribute, counts all setup components.
    [integer]
OptCount: class attribute, counts optical components. [integer]
Name: class attribute. [string]
HRCenter (inherited): center of the 'chord' of the HR surface. [3D vector]
ARCenter (inherited): center of the 'chord' of the AR surface. [3D vector]
HRNorm (inherited): unitary normal to the 'chord' of the HR (always pointing
 towards the outside of the component). [3D vector]
Thick (inherited): thickness of the optic, counted in opposite direction to
    HRNorm. [float]
Dia (inherited): diameter of the component. [float]
Ref (inherited): reference string (for keeping track with the lab). [string]
ARNorm: unitary normal to the 'chord' of the AR (always pointing
 towards the outside of the component). [3D vector]
N: refraction index of the material. [float]
HRK, ARK: curvature of the HR, AR surfaces. [float]
HRr, HRt, ARr, ARt: power reflectance and transmission coefficients of
    the HR and AR surfaces. [float]
KeepI: whether of not to keep data of rays for interference calculations
        on the HR. [boolean]
Wedge: wedge angle on the optic. [float]
Alpha: angle of the rotation to describe the orientation of the wedge.
    See the documentation for details on this angle. [float]
TonHR, RonHR, TonAR, RonAR: amount by which the orders of the beams will
    be increased upon relfection or transmission on AR or HR surfaces.
    These are the principal parameters which distinguish mirrors and lenses
    and beamsplitters, etc.

**Note**: the curvature of any surface is positive for a concave surface
(coating inside the sphere).
Thus kurv*HRNorm/|kurv| always points to the center
of the sphere of the surface, as is the convention for the lineSurfInter of
geometry module. Same for AR.

*******     HRK > 0 and ARK > 0     *******           HRK > 0 and ARK < 0
 *****                               ********         and |ARK| > |HRK|
 H***A                               H*********A
 *****                               ********
*******                             *******

Nested Classes [hide private]

Inherited from component.SetupComponent: __metaclass__

Instance Methods [hide private]
 
__init__(self, ARCenter, HRCenter, HRNorm, ARNorm, N, HRK, ARK, ARr, ARt, HRr, HRt, KeepI, Thickness, Diameter, Wedge, Alpha, RonHR, TonHR, RonAR, TonAR, Ref)
Optic base initializer.
source code
 
apexes(self)
Returns the positions of the apexes of HR and AR as a tuple.
source code
 
collision(self)
Determine whether the HR and AR surfaces intersect.
source code
 
geoCheck(self, word)
Makes geometrical checks on surfaces and warns when necessary.
source code
 
hit(self, beam, order, threshold)
Compute the refracted and reflected beams after interaction.
source code
 
hitAR(self, beam, point, order, threshold)
Compute the daughter beams after interaction on AR at point.
source code
 
hitHR(self, beam, point, order, threshold)
Compute the daughter beams after interaction on HR at point.
source code
 
hitSide(self, beam)
Compute the daughter beams after interaction on Side at point.
source code
 
isHit(self, beam)
Determine if a beam hits the Optic.
source code
 
isHitDics(self, beam)
Determine the dictionaries to evaluate if a beam hits the optic.
source code
 
translate(self, X=0.0, Y=0.0, Z=0.0)
Move the optic to (current position + (X, Y, Z)).
source code

Inherited from component.SetupComponent: __str__, lines

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  Name = 'Optic'
  OptCount = 0
  __abstractmethods__ = frozenset(['lines'])

Inherited from component.SetupComponent: SetupCount

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, ARCenter, HRCenter, HRNorm, ARNorm, N, HRK, ARK, ARr, ARt, HRr, HRt, KeepI, Thickness, Diameter, Wedge, Alpha, RonHR, TonHR, RonAR, TonAR, Ref)
(Constructor)

source code 

Optic base initializer.

Parameters are the attributes of the object to construct.

Returns an Optic.

Overrides: object.__init__

collision(self)

source code 

Determine whether the HR and AR surfaces intersect.

Returns True if there is an intersection, False if not.

hit(self, beam, order, threshold)

source code 
Compute the refracted and reflected beams after interaction.

The beams returned are those selected after the order and threshold
criterion.

beam: incident beam. [GaussianBeam]
order: maximum strayness of daughter beams, which are not returned if
    their strayness is over this order. [integer]
threshold: idem for the power of the daughter beams. [float]

Returns a dictionary of beams with keys:
    't': refracted beam. [GaussianBeam]
    'r': reflected beam. [GaussianBeam]

Overrides: component.SetupComponent.hit

hitAR(self, beam, point, order, threshold)

source code 
Compute the daughter beams after interaction on AR at point.

beam: incident beam. [GaussianBeam]
point: point in space of interaction. [3D vector]
order: maximum strayness of daughter beams, which are not returned if
    their strayness is over this order. [integer]
threshold: idem for the power of the daughter beams. [float]

Returns a dictionary of beams with keys:
    't': refracted beam. [GaussianBeam]
    'r': reflected beam. [GaussianBeam]

hitHR(self, beam, point, order, threshold)

source code 
Compute the daughter beams after interaction on HR at point.

beam: incident beam. [GaussianBeam]
point: point in space of interaction. [3D vector]
order: maximum strayness of daughter beams, which are not returned if
    their strayness is over this order. [integer]
threshold: idem for the power of the daughter beams. [float]

Returns a dictionary of beams with keys:
    't': refracted beam. [GaussianBeam]
    'r': reflected beam. [GaussianBeam]

hitSide(self, beam)

source code 

Compute the daughter beams after interaction on Side at point.

Generic function: all sides stop beams.

beam: incident beam. [GaussianBeam]

Returns {'t': None, 'r': None}

isHit(self, beam)

source code 
Determine if a beam hits the Optic.

This is a function uses the dictionaries provided by isHitDics to
find the closest face hit by the beam.

beam: incoming beam. [GaussianBeam]

Returns a dictionary with keys:
    'isHit': whether the beam hits the optic. [boolean]
    'intersection point': point in space where it is first hit.
            [3D vector]
    'face': to indicate which face is first hit, can be 'HR', 'AR' or
        'Side'. [string]
    'distance': geometrical distance from beam origin to impact. [float]

Overrides: component.SetupComponent.isHit

isHitDics(self, beam)

source code 
Determine the dictionaries to evaluate if a beam hits the optic.

Uses the line***Inter functions from the geometry module to calculate
the dictionaries of data on interaction with HR and AR and side of
optics.

Returns a tuple of 3 dictionaries with keys:
    'isHit': whether the optic is hit by the beam. [bool]
    'intersection point': 3D point where the beam impacts.
        [3D np-array]
    'distance': distance from beam origin to interaction point. [float]

translate(self, X=0.0, Y=0.0, Z=0.0)

source code 

Move the optic to (current position + (X, Y, Z)).

This version takes care of HRcenter and ARCenter and overwrites the SetupComponent version.

X, Y, Z: components of the translation vector.

No return value.

Overrides: component.SetupComponent.translate