PyPO User Manual
 
Loading...
Searching...
No Matches
Ray Trace Methods

This section contains a list of public PyPO methods which are used for performing ray trace related tasks. More...

Functions

 PyPO.System.System.removeFrame (self, frameName)
 Remove a ray-trace frame from system.
 
 PyPO.System.System.createTubeFrame (self, argDict)
 Create a tube of rays from a TubeRTDict.
 
 PyPO.System.System.createGRTFrame (self, argDict)
 Create a Gaussian beam distribution of rays from a GRTDict.
 
 PyPO.System.System.calcRayLen (self, *frames, start=None)
 Calculate total length of a ray-trace beam.
 
 PyPO.System.System.runRayTracer (self, runRTDict)
 Run a ray-trace propagation from a frame to a surface.
 
 PyPO.System.System.calcRTcenter (self, name_frame)
 Calculate the geometric center of a ray-trace frame.
 
 PyPO.System.System.calcRTtilt (self, name_frame)
 Calculate the mean direction normal of a ray-trace frame.
 
 PyPO.System.System.calcSpotRMS (self, name_frame)
 Calculate the RMS spot size of a ray-trace frame.
 
 PyPO.System.System.findRTfocus (self, name_frame, f0=None, tol=1e-12)
 Find the focus of a ray-trace frame.
 

Detailed Description

This section contains a list of public PyPO methods which are used for performing ray trace related tasks.

Function Documentation

◆ calcRayLen()

PyPO.System.System.calcRayLen ( self,
* frames,
start = None )

Calculate total length of a ray-trace beam.

Takes multiple frames and calculates the distance for each ray between frames. If the "start" parameter is set to a len-3 Numpy array, the ray length will also include the distance between the position of the ray in the first frame and the given starting point. This is useful in case the rays emanate from a single point which is not included as a frame in the internal dictionary.

Parameters
framesFrames between which to calculate total pathlength.
startPoint from which to start the calculation, len-3 Numpy array. If given, also calculates distance between point and the first frame. Defaults to None.
Returns
out List containing the distances between frames. Can be summed over to obtain total distance.

◆ calcRTcenter()

PyPO.System.System.calcRTcenter ( self,
name_frame )

Calculate the geometric center of a ray-trace frame.

The center is calculated by finding the centroid of the given frame.

Parameters
name_frameName of frame to calculate center of.
Returns
c_f Len-3 Numpy array containing x, y and z co-ordinates of frame center.

◆ calcRTtilt()

PyPO.System.System.calcRTtilt ( self,
name_frame )

Calculate the mean direction normal of a ray-trace frame.

The mean direction is calculated by taking the mean tilt of every ray in the frame.

Parameters
name_frameName of frame to calculate tilt of.
Returns
t_f Len-3 Numpy array containing x, y and z components of frame tilt direction.

◆ calcSpotRMS()

PyPO.System.System.calcSpotRMS ( self,
name_frame )

Calculate the RMS spot size of a ray-trace frame.

The RMS spotsize is calculated by taking the root-mean-square of the positions of the rays in the frame.

Parameters
name_frameName of frame to calculate RMS of.
Returns
rms RMS spot size of frame in mm.

◆ createGRTFrame()

PyPO.System.System.createGRTFrame ( self,
argDict )

Create a Gaussian beam distribution of rays from a GRTDict.

The Gaussian frame will be placed in the internal frame dictionary. The frame is generated by rejection-sampling a Gaussian distribution in position and direction on an xy-grid. Position and orientation trackers for the frame are initialised to the origin and z-axis, respectively.

Parameters
argDictA GRTDict, filled. If not filled properly, will raise an exception.
See also
GRTDict

◆ createTubeFrame()

PyPO.System.System.createTubeFrame ( self,
argDict )

Create a tube of rays from a TubeRTDict.

The tube of rays will be placed in the internal frame dictionary. Position and orientation trackers for the frame are initialised to the origin and z-axis, respectively.

Parameters
argDictA TubeRTDict, filled. If not filled properly, will raise an exception.
See also
TubeRTDict

◆ findRTfocus()

PyPO.System.System.findRTfocus ( self,
name_frame,
f0 = None,
tol = 1e-12 )

Find the focus of a ray-trace frame.

Adds a new plane to the System, perpendicular to the mean ray-trace tilt of the input frame. The new plane is called focal_plane_<name_frame> and stored in the internal system dictionary. After completion, the new plane is centered at the ray-trace focus. The focus frame is stored as focus_<name_frame> in the internal frames dictionary.

Parameters
name_frameName of the input frame.
f0Initial try for focal distance.
verboseAllow verbose System logging.
Returns
out The focus co-ordinate.

◆ removeFrame()

PyPO.System.System.removeFrame ( self,
frameName )

Remove a ray-trace frame from system.

This method takes the name of an internally stored frame object and removes it from the internal dictionary.

Parameters
frameNameName of frame to be removed.

◆ runRayTracer()

PyPO.System.System.runRayTracer ( self,
runRTDict )

Run a ray-trace propagation from a frame to a surface.

The resulting frame is placed in the internal frames dictionary.

Parameters
runRTDictA runRTDict object specifying the ray-trace.