sensor — Sensor active media#
Module documentation#
Active sensor medium.
- class hexsample.sensor.CrossSection(*values)[source]#
Enum class expressing the various cross sections.
- COHERENT = 'coh'#
- INCOHERENT = 'incho'#
- PHOTOELECTRIC = 'photo'#
- TOTAL = 'total'#
- class hexsample.sensor.Material(symbol: str, fano_factor: float, density: float = None, ionization_potential: float = None)[source]#
Class describing a material.
This will work for either an element or a compound, provided that the symbol is recognized by xraydb.
- _attenuation_length(energy: ndarray, kind: CrossSection) ndarray[source]#
Return the attenuation length (in cm) for the material.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- kindCrossSection
The cross secttion to be used.
- coherent_attenuation_length(energy: ndarray) ndarray[source]#
Return the coherent attenuation length (in cm) for the material.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- incoherent_attenuation_length(energy: ndarray) ndarray[source]#
Return the incoherent attenuation length (in cm) for the material.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- photoelectric_attenuation_length(energy: ndarray) ndarray[source]#
Return the photoelectric attenuation length (in cm) for the material.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- total_attenuation_length(energy: ndarray) ndarray[source]#
Return the total length (in cm) for the material.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- _mu_components(energy: ndarray, kind: CrossSection) dict[source]#
Return the absorption coefficients (in cm^{-1}) for the various elements in a compound.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- kindCrossSection
The cross secttion to be used.
- coherent_mu_components(energy: ndarray) ndarray[source]#
Return the coherent absorption coefficients (in cm^{-1}) for the various elements in a compound.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- incoherent_mu_components(energy: ndarray) ndarray[source]#
Return the incoherent absorption coefficients (in cm^{-1}) for the various elements in a compound.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- photoelectric_mu_components(energy: ndarray) ndarray[source]#
Return the photoelectric absorption coefficients (in cm^{-1}) for the various elements in a compound.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- total_mu_components(energy: ndarray) ndarray[source]#
Return the total absorption coefficients (in cm^{-1}) for the various elements in a compound.
Arguments#
- energyarray_like
The energy (in eV) at which the attenuation length is calculated.
- class hexsample.sensor.Sensor(material: Material, thickness: float, trans_diffusion_sigma: float)[source]#
Simple class describing a sensor.
This is essentially a parallel-plate like slab of material acting as an absorbing medium for impinging X-rays.
Arguments#
- materialMaterial instance
The sensor material.
- thicknessfloat
The sensor thickness in cm.
- trans_diffusion_sigmafloat
The transverse diffusion sigma in um / sqrt(cm).
- photabsorption_efficiency(energy: ndarray) ndarray[source]#
Return the photabsorption efficiency for a given array of energy values.
- rvs_absorption_depth(energy: ndarray) ndarray[source]#
Exract random variates for the absorption depth.
Note this is using a truncated exponential distribution with the maximum value corresponding to the thickness of the detector.
- rvs_absz(energy: ndarray) ndarray[source]#
Extract random variates for the absorption position along the z axis.
Not that, in our parallel-plane geometry, the z axis runs perpendicularly to the readout plane, which is assumed to be at z = 0. The top of the sensor is therefore at z = thickness, and all the photons are assumed to have a momentum parallel to the z axis.