-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It could be useful to generate random numbers in a ProcessingChain. One use for this would be in pulse generation. An example of what such a processing chain config might look like is:
{
"processors": {
"amp": {
"processor": "random_gaus",
"module": "???",
"args": [10, 1, "amp"]
},
"risetime": {
"processor": "random_uniform",
"module": "???",
"args": ["0.5*us", "1*us", "risetime(unit=us)"]
},
"offset": {
"processor": "random_gaus",
"module": "???",
"args": ["10*us", "1*us", "offset(unit=us)"],
},
"waveform": {
"processor": "pulse_injector",
"module": "pygama.dsp.processors",
"args": ["zeros_in", "amp", "risetime", "offset", "waveform"]
}
}
}However, right now it's not clear what RNG processors we could use. The numpy.random generators to do not work with in place array filling. The same is true of the scipy.stats generators. Numba seems to have support for random number generation, but I'm not sure how it works yet. We also want to make sure that we can control the seeding of the RNGs, and make sure that this would work for multi-threading.
Here are the features we want for our RNG processors:
- Fill output array in place (i.e. have an
outargument) - Have a way to set initial seeds
- Robust for multithreaded and MPI
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request