satlas.utilities.utilities.generate_spectrum¶
-
satlas.utilities.utilities.
generate_spectrum
(spectrum, x, number_of_counts, nwalkers=100)[source]¶ Generates a model by random sampling from the provided
HFSModel
and range. The total number of counts for the generated spectrum is required.Parameters: - spectrum (
HFSModel
) – An instance of class:.HFSModel, which gives the probability distribution from which the random samples are drawn. - x (NumPy array) – NumPy array representing the bin centers for the spectrum.
- number_of_counts (int) – Parameter controlling the total number of counts in the spectrum.
- nwalkers (int, optional) – Number of walkers for the random sampling algorithm from emcee.
Returns: y – Array containing the number of counts corresponding to each value in x.
Return type: NumPy array
- spectrum (