specsim.instrument.initialize(config) generates a random state and uses it for the positioner offsets, which is cached in the Simulator.instrument. This random state gets used every time Simulator.simulate() is called, meaning that the answer for simulating a set of spectra depends upon the history of what other spectra were simulated previously using the same Simulator object.
Similarly, simulating the same spectra twice in a row gives different answers. This could be considered a feature, like simulating the same inputs with different exposures with different fiber positioner offsets, but we need better control over this positioner offset random state, e.g. a way to reset the Simulator+Instrument back to the original state.
Related: #36 (provenance and reproducibility) and #51 (deepcopy of Simulator).
Spinning this off from desihub/desisim#393:
specsim.instrument.initialize(config)
generates a random state and uses it for the positioner offsets, which is cached in theSimulator.instrument
. This random state gets used every timeSimulator.simulate()
is called, meaning that the answer for simulating a set of spectra depends upon the history of what other spectra were simulated previously using the sameSimulator
object.Similarly, simulating the same spectra twice in a row gives different answers. This could be considered a feature, like simulating the same inputs with different exposures with different fiber positioner offsets, but we need better control over this positioner offset random state, e.g. a way to reset the Simulator+Instrument back to the original state.
Related: #36 (provenance and reproducibility) and #51 (deepcopy of Simulator).