3.10.1.21.1.4. opengate.sources.generic¶
3.10.1.21.1.4.1. Attributes¶
3.10.1.21.1.4.2. Classes¶
Base class for all source types. |
|
GenericSource close to the G4 SPS, but a bit simpler. |
|
Source template: to create a new type of source, copy-paste |
3.10.1.21.1.4.3. Functions¶
|
read the file downloaded from LNHB |
|
Given a list of (energy) bins center, compute the width of each bin. |
|
|
|
Compute the CDF (Cumulative Density Function) of a list of non-uniform energy bins |
|
like in G4SPSAngDistribution.cc |
|
|
|
|
|
3.10.1.21.1.4.4. Module Contents¶
- opengate.sources.generic.all_beta_plus_radionuclides = ['F18', 'Ga68', 'Zr89', 'Na22', 'C11', 'N13', 'O15', 'Rb82'][source]¶
- opengate.sources.generic.read_beta_plus_spectra(rad_name)[source]¶
read the file downloaded from LNHB there are 15 lines-long header to skip first column is E(keV) second column is dNtot/dE b+ WARNING : bins width is not uniform (need to scale for density)
- opengate.sources.generic.compute_bins_density(bins)[source]¶
Given a list of (energy) bins center, compute the width of each bin.
- opengate.sources.generic.compute_cdf_and_total_yield(data, bins)[source]¶
Compute the CDF (Cumulative Density Function) of a list of non-uniform energy bins with associated probability. Also return the total probability.
- opengate.sources.generic.generate_isotropic_directions(n, min_theta=0, max_theta=np.pi, min_phi=0, max_phi=2 * np.pi, rs=np.random)[source]¶
like in G4SPSAngDistribution.cc
Later : do a version with torch (gpu) instead of np (cpu) ?
- class opengate.sources.generic.SourceBase(user_info)[source]¶
Bases:
opengate.userelement.UserElementBase class for all source types.
- class opengate.sources.generic.GenericSource(user_info)[source]¶
Bases:
SourceBaseGenericSource close to the G4 SPS, but a bit simpler. The G4 source created by this class is GateGenericSource.
- class opengate.sources.generic.TemplateSource(user_info)[source]¶
Bases:
SourceBaseSource template: to create a new type of source, copy-paste this file and adapt to your needs. Also declare the source type in the file helpers_source.py