1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use LN_2;
use Array1;
use cratenormalized_gaussian;
/// Create a 1D Gaussian instrument response function (IRF).
///
/// # Description
///
/// Creates a Gaussian IRF by converting "full width at half maximum" (FWHM)
/// parameters into a normalized Gaussian distribution. The FWHM is converted to
/// standard deviation using the relationship:
///
/// ```text
/// σ = FWHM / (2 × √(2 × ln(2)))
/// ```
///
/// Where `ln(2) ≈ 0.693147` is the natural logarithm of `2`.
///
/// # Arguments
///
/// * `bins`: The number of discrete points to sample the Gaussian distribution.
/// * `time_range`: The total time range over which to simulate the IRF.
/// * `irf_center`: The temporal position of the IRF peak within the time range.
/// * `irf_width`: The full width at half maximum (FWHM) of the IRF.
/// * `threads`: The requested number of threads to use for parallel execution.
/// If `None` or `Some(1)` sequential execution is used. If `Some(0)`, then
/// the maximum available parallelism is used. Thread counts are clamped to
/// the systems maximum.
///
/// # Returns
///
/// * `Array1<f64>`: The simulated 1D IRF curve array.