PyPO User Manual
Common Transformation Methods

This section contains a list of public PyPO methods which are used for rotating and translating reflectors, groups and frame objects. More...

Functions

def PyPO.System.System.rotateGrids (self, str name, np.ndarray rotation, Objects obj=Objects.ELEMENT, Modes mode=Modes.REL, np.ndarray pivot=None, bool keep_pol=False)
 Rotate reflector grids. More...
 
None PyPO.System.System.translateGrids (self, str name, np.ndarray translation, Objects obj=Objects.ELEMENT, Modes mode=Modes.REL)
 Translate reflector grids. More...
 

Detailed Description

This section contains a list of public PyPO methods which are used for rotating and translating reflectors, groups and frame objects.

Function Documentation

◆ rotateGrids()

def PyPO.System.System.rotateGrids (   self,
str  name,
np.ndarray  rotation,
Objects   obj = Objects.ELEMENT,
Modes   mode = Modes.REL,
np.ndarray   pivot = None,
bool   keep_pol = False 
)

Rotate reflector grids.

Apply a rotation, around a center of rotation, to a reflector, group or frame. Note that an absolute orientation rotates the orientation such that it is oriented w.r.t. the z-axis. In this case, the pivot defaults to the origin and not to the specified pivot. In the case that a PO field and/or a PO current is associated with the reflector, the polarisation of the field and/or current is rotated along as well. This can be disabled by setting the "keep_pol" parameter to "True".

Parameters
nameReflector name or list of reflector names.
rotationNumpy ndarray of length 3, containing rotation angles around x, y and z axes, in degrees.
objWhether the name corresponds to a single element, group, or frame. Fields and currents are translated by translating the associated surface. Choose from Objects enum.
modeApply rotation relative to current orientation (Modes.REL), or rotate to specified orientation (Modes.ABS).
pivotNumpy ndarray of length 3, containing pivot x, y and z co-ordinates, in mm. Defaults to pos.
keep_polKeep polarisation of a field/current defined on the surface, if present. If True, does not rotate polarisation of any defined fields/currents along with the rotation of reflector. If False, rotates polarisation along with reflector. Defaults to False.

◆ translateGrids()

None PyPO.System.System.translateGrids (   self,
str  name,
np.ndarray  translation,
Objects   obj = Objects.ELEMENT,
Modes   mode = Modes.REL 
)

Translate reflector grids.

Apply a translation to a reflector, group or frame. If the translation is absolute, the object will be translated such that its internal position parameter coincides with the specified translation.

Parameters
nameReflector name or list of reflector names.
translationNumpy ndarray of length 3, containing translation x, y and z co-ordinates, in mm.
objWhether the name corresponds to a single element, group, or frame. Fields and currents are translated by translating the associated surface. Choose from Objects enum.
modeApply translation relative ('relative') to current position, or move to specified position ('absolute').