System4f.pop
- raytracing.System4f.pop(self, index: int)
This function is used to remove a matrix at a specific index.
- Parameters:
index (int) – Index where the matrix is removed.
- Returns:
poppedElement – The removed matrix.
- Return type:
Examples
Let’s remove an aperture from a 4f system: >>> from raytracing import * >>> system = MatrixGroup([Space(10), Lens(10), Space(10), Space(10), Lens(10), Space(10), Aperture(100)]) >>> print(f”Has finite diameter? {system.hasFiniteApertureDiameter()}”) Has finite diameter? True
>>> aperture = system.pop(-1) # Removes the last element >>> print(f"Has finite diameter? {system.hasFiniteApertureDiameter()}") Has finite diameter? False