Baffle

class marxs.optics.Baffle(**kwargs)[source]

Bases: FlatOpticalElement

Plate with rectangular hole that allows photons through.

The probability of photons that miss is set to 0, assuming that the baffles describes an opening in an otherwise closed structure.

Parameters

photons: astropy.table.Table

table that includes information on all of the photons

Define a new MARXS element.

Attributes Summary

display

Dictionary for display specifications, e.g. color.

Methods Summary

process_photons(photons, intersect, ...)

Simulate interaction of optical element with photons - vectorized.

Attributes Documentation

display = {'color': (1.0, 0.5, 0.4)}

Dictionary for display specifications, e.g. color

Methods Documentation

process_photons(photons, intersect, interpos, intercoos)[source]

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 coordinate system (2d in most cases).

Returns

photons: astropy.table.Table or astropy.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.