ess.bifrost.io.mcstas.convert_simulated_time_to_event_time_offset#
- ess.bifrost.io.mcstas.convert_simulated_time_to_event_time_offset(mcstas_data, pulse_period)[source]#
Helper to make McStas simulated event data look more like real data
McStas has the ability to track the time-of-flight from source to detector for every probabilistic neutron ray. This is very helpful, but unfortunately real instrument at ESS are not able to record the same information due to how the timing and data collection systems work.
Real neutron events will record their event_time_zero most-recent-pulse reference time, and their event_time_offset detection time relative to that reference time. These two values added together give a real wall time; and information about the primary spectrometer is necessary to find any time-of-flight
This function takes event data with per-event coordinate event_time_offset (actually McStas time-of-arrival) and converts the coordinate to be the time-of-arrival modulo the source repetition period.
Notes
If the input data has realistic event_time_offset values, this function should be a noop.