Baffle¶
- class marxs.optics.Baffle(**kwargs)[source] [edit on github]¶
Bases:
FlatOpticalElement
Plate with rectangular hole that allows photons through.
The probability of photons that miss is set to 0.
- Parameters:
- photons: astropy Table
table that includes information on all of the photons
Define a new MARXS element.
Attributes Summary
Dictionary for display specifications, e.g. color.
Methods Summary
process_photons
(photons, intersect, ...)Simulate interaction of optical element with photons - vectorized.
Return a triangulation of the baffle hole embedded in a square.
Attributes Documentation
- display = {'color': (1.0, 0.5, 0.4), 'outer_factor': 3, 'shape': 'plane with hole'}¶
Dictionary for display specifications, e.g. color
Methods Documentation
- process_photons(photons, intersect, intercoos, interpoos)[source] [edit on github]¶
Simulate interaction of optical element with photons - vectorized.
Derived classes should overwrite this function or
process_photon
.- Parameters:
- photons: `astropy.table.Table` or `astropy.table.Row`
Table with photon properties
- intersectarray
Boolean array marking which photons should be processed by this element.
- interpos, intercoosarray (N, 4)
The array
interpos
contains the intersection points in the global coordinate system,intercoos
in a local coordiante system (2d in most cases).
- Returns:
- photons:
astropy.table.Table
orastropy.table.Row
Table with photon properties. If possible, the input table is modified in place, but in some cases this might not be possible and the returned Table may be a copy. Do not rely on either - use
photons.copy()
if you want to ensure you are working with an independent copy.
- photons:
- triangulate_inner_outer()[source] [edit on github]¶
Return a triangulation of the baffle hole embedded in a square.
The size of the outer square is determined by the
'outer_factor'
element inself.display
.- Returns:
- xyznp.array
Numpy array of vertex positions in Eukeldian space
- trianglesnp.array
Array of index numbers that define triangles