xopto.mccyl.mcdetector.fiz module¶
- class FiZ(fiaxis: xopto.mcbase.mcutil.axis.Axis, zaxis: Optional[xopto.mcbase.mcutil.axis.Axis] = None, cosmin: float = 0.0)[source]¶
Bases:
xopto.mccyl.mcdetector.base.Detector
2D Cylindrical reflectance/transmittance accumulator in the φ-z plane.
The grid of the Cartesian accumulators corresponds to a 2D numpy array with the first dimension representing the φ axis and second dimension representing the z axis (reflectance[z, φ] or transmittance[z, φ]).
- Parameters
- cl_declaration(mc: xopto.mcbase.mcobject.McObject) → str[source]¶
Structure that defines the accumulator in the Monte Carlo simulator.
- cl_implementation(mc: xopto.mcbase.mcobject.McObject) → str[source]¶
Implementation of the accumulator in the Monte Carlo simulator.
- cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None) → xopto.cl.cltypes.Structure[source]¶
Fills the structure (target) with the data required by the Monte Carlo simulator. See the
Cartesian.cl_type()
method for a detailed list of fields.- Parameters
mc (mcobject.McObject) – Monte Carlo simulator instance.
target (cltypes.Structure) – Ctypes structure that is filled with the source data.
- Returns
target – Filled ctypes structure received as an input argument or a new instance if the input argument target is None.
- Return type
- static cl_type(mc: xopto.mcbase.mcobject.McObject) → xopto.cl.cltypes.Structure[source]¶
- property cosmin: Tuple[float, float]¶
Cosine of the maximum acceptance angle.
- property fi: numpy.ndarray¶
Centers of the accumulators along the φ axis.
- property fiaxis: xopto.mcbase.mcutil.axis.Axis¶
Axis object of the φ axis.
- property fiedges: numpy.ndarray¶
Edges of the accumulators along the φ axis.
- static fromdict(data: dict) → xopto.mccyl.mcdetector.fiz.FiZ[source]¶
Create an accumulator instance from a dictionary.
- Parameters
data (dict) – Dictionary created by the py:meth:FiZ.todict method.
- meshgrid() → Tuple[numpy.ndarray, numpy.ndarray][source]¶
Returns 2D arrays of z and φ coordinates of the centers of accumulators that match the size of the reflectance / transmittance arrays. The grid of the Cartesian accumulators corresponds to a 2D numpy array with the first dimension representing the z axis and second dimension representing the φ axis (reflectance[z, φ] or transmittance[z, φ]).
- Returns
z (np.ndarray) – A 2D array of φ coordinates.
φ (np.ndarray) – A 2D array of z coordinates.
- property nfi: int¶
Number of accumulators along the φ axis.
- property normalized: numpy.ndarray¶
Normalized.
- property nz: int¶
Number of accumulators along the z axis.
- plot(scale: str = 'log', raw: bool = False, show: bool = True)[source]¶
Show the detector contet as a 2D image.
- Parameters
scale (str) – Data scaling can be “log” for logarithmic or “lin” for linear.
raw (bool) – Set to True to show the raw data. Default is False and shows the normalized (reflectance) content.
show (bool) –
- property reflectance: numpy.ndarray¶
Reflectance.
- todict() → dict[source]¶
Save the accumulator configuration without the accumulator data to a dictionary. Use the
Cartesian.fromdict()
method to create a new accumulator instance from the returned data.- Returns
data – Accumulator configuration as a dictionary.
- Return type
dict
- property transmittance: numpy.ndarray¶
Transmittance.
- update_data(mc: xopto.mcbase.mcobject.McObject, *args, **kwargs)[source]¶
Update the content of raw data accumulators with simulation results.
- Parameters
mc (mcobject.McObject) – Simulator instance that produced the data.
accumulators (List[np.ndarray]) – List of allocated accumulators (this implementation uses only one).
nphotons (int) – The number of photon packets that produced the raw data accumulator content.
kwargs (dict) – Additional keyword arguments not used by this implementation.
- property z: numpy.ndarray¶
Centers of the accumulators along the z axis.
- property zaxis: xopto.mcbase.mcutil.axis.Axis¶
Axis object of the z axis.
- property zedges: numpy.ndarray¶
Edges of the accumulators along the z axis.