|
Mantid
|
This class defines the pulse times for a specific bank. More...
#include <BankPulseTimes.h>
Public Member Functions | |
| bool | arePulseTimesIncreasing () const |
| Threadsafe method to access cached information about sorting. | |
| BankPulseTimes (const std::vector< Mantid::Types::Core::DateAndTime > ×) | |
| Constructor with vector of DateAndTime. | |
| BankPulseTimes (const std::vector< Mantid::Types::Core::DateAndTime > ×, const std::vector< int > &periodNumbers) | |
| Constructor with vector of DateAndTime and Period information for testing only. | |
| BankPulseTimes (Nexus::File &file, const std::vector< int > &periodNumbers) | |
| Constructor with Nexus::File. | |
| bool | equals (size_t otherNumPulse, const std::string &otherStartTime) |
| Equals. | |
| std::vector< size_t > | getPulseIndices (const Mantid::Types::Core::DateAndTime &start, const Mantid::Types::Core::DateAndTime &stop) const |
| Return a vector of [include,exclude) indices into the pulse vectors that are between the start and stop times. | |
| std::vector< size_t > | getPulseIndices (const std::vector< Mantid::Kernel::TimeInterval > &splitters) const |
| size_t | numberOfPulses () const |
| The number of pulses being held. | |
| int | periodNumber (const size_t index) const |
| The raw number from the period stored in the logs. | |
| const Mantid::Types::Core::DateAndTime & | pulseTime (const size_t index) const |
| The wall clock time of the pulse. | |
Public Attributes | |
| std::string | startTime |
| String describing the start time. | |
Static Public Attributes | |
| static const std::string | DEFAULT_START_TIME |
| Unix epoch used as default epoch when the file does not specify one. | |
| static const int | FIRST_PERIOD |
| Starting number for assigning periods. | |
Private Member Functions | |
| void | finalizePeriodNumbers () |
| Ensure that we always have a consistency between nPulses and periodNumbers containers. | |
| template<typename ValueType > | |
| void | readData (Nexus::File &file, std::size_t numValues, Mantid::Types::Core::DateAndTime &start) |
| void | updateStartTime () |
| This determines the start time by finding the minimum value in the array. | |
Private Attributes | |
| bool | have_period_info |
| int8_t | m_sorting_info |
| std::mutex | m_sortingMutex |
| std::vector< int > | periodNumbers |
| Vector of period numbers corresponding to each pulse. | |
| std::vector< Mantid::Types::Core::DateAndTime > | pulseTimes |
| Array of the pulse times. | |
This class defines the pulse times for a specific bank.
Since some instruments (ARCS, VULCAN) have multiple preprocessors, this means that some banks have different lists of pulse times.
Definition at line 19 of file BankPulseTimes.h.
| Mantid::DataHandling::BankPulseTimes::BankPulseTimes | ( | Nexus::File & | file, |
| const std::vector< int > & | periodNumbers | ||
| ) |
Constructor with Nexus::File.
Constructor.
Loads the pulse times from the bank entry of the file
| file | :: nexus file open in the right bank entry |
| periodNumbers | :: Period numbers to index into. Index via frame/pulse |
Definition at line 53 of file BankPulseTimes.cpp.
References finalizePeriodNumbers(), NXnumtype::FLOAT64, startTime, and NXnumtype::UINT64.
| Mantid::DataHandling::BankPulseTimes::BankPulseTimes | ( | const std::vector< Mantid::Types::Core::DateAndTime > & | times | ) |
Constructor with vector of DateAndTime.
Constructor.
Build from a vector of date and times. Handles a zero-sized vector
| times |
Definition at line 34 of file BankPulseTimes.cpp.
References finalizePeriodNumbers(), and updateStartTime().
| Mantid::DataHandling::BankPulseTimes::BankPulseTimes | ( | const std::vector< Mantid::Types::Core::DateAndTime > & | times, |
| const std::vector< int > & | periodNumbers | ||
| ) |
Constructor with vector of DateAndTime and Period information for testing only.
Definition at line 40 of file BankPulseTimes.cpp.
References finalizePeriodNumbers(), and updateStartTime().
| bool Mantid::DataHandling::BankPulseTimes::arePulseTimesIncreasing | ( | ) | const |
Threadsafe method to access cached information about sorting.
Definition at line 141 of file BankPulseTimes.cpp.
References m_sorting_info, m_sortingMutex, and pulseTimes.
Referenced by getPulseIndices().
| bool Mantid::DataHandling::BankPulseTimes::equals | ( | size_t | otherNumPulse, |
| const std::string & | otherStartTime | ||
| ) |
Equals.
Comparison.
Is this bank's pulse times array the same as another one.
| otherNumPulse | :: number of pulses in the OTHER bank event_time_zero. |
| otherStartTime | :: "offset" attribute of the OTHER bank event_time_zero. |
Definition at line 283 of file BankPulseTimes.cpp.
References startTime.
|
private |
Ensure that we always have a consistency between nPulses and periodNumbers containers.
Definition at line 126 of file BankPulseTimes.cpp.
References have_period_info, periodNumbers, and pulseTimes.
Referenced by BankPulseTimes(), BankPulseTimes(), and BankPulseTimes().
| std::vector< size_t > Mantid::DataHandling::BankPulseTimes::getPulseIndices | ( | const Mantid::Types::Core::DateAndTime & | start, |
| const Mantid::Types::Core::DateAndTime & | stop | ||
| ) | const |
Return a vector of [include,exclude) indices into the pulse vectors that are between the start and stop times.
This is very similar to the behavior of Mantid::Kernel::TimeROI.
This will return an empty vector if all pulse indices are between the start and stop.
Definition at line 200 of file BankPulseTimes.cpp.
References arePulseTimesIncreasing(), index, and pulseTime().
| std::vector< size_t > Mantid::DataHandling::BankPulseTimes::getPulseIndices | ( | const std::vector< Mantid::Kernel::TimeInterval > & | splitters | ) | const |
Definition at line 259 of file BankPulseTimes.cpp.
| size_t Mantid::DataHandling::BankPulseTimes::numberOfPulses | ( | ) | const |
The number of pulses being held.
Definition at line 139 of file BankPulseTimes.cpp.
References pulseTimes.
| int Mantid::DataHandling::BankPulseTimes::periodNumber | ( | const size_t | index | ) | const |
The raw number from the period stored in the logs.
Definition at line 154 of file BankPulseTimes.cpp.
References FIRST_PERIOD, have_period_info, index, and periodNumbers.
| const Mantid::Types::Core::DateAndTime & Mantid::DataHandling::BankPulseTimes::pulseTime | ( | const size_t | index | ) | const |
The wall clock time of the pulse.
Definition at line 161 of file BankPulseTimes.cpp.
References index, and pulseTimes.
Referenced by getPulseIndices().
|
private |
Definition at line 95 of file BankPulseTimes.cpp.
References pulseTimes.
|
private |
This determines the start time by finding the minimum value in the array.
Definition at line 118 of file BankPulseTimes.cpp.
References pulseTimes, and startTime.
Referenced by BankPulseTimes(), and BankPulseTimes().
|
static |
Unix epoch used as default epoch when the file does not specify one.
Definition at line 24 of file BankPulseTimes.h.
|
static |
Starting number for assigning periods.
Definition at line 22 of file BankPulseTimes.h.
Referenced by periodNumber().
|
private |
Definition at line 80 of file BankPulseTimes.h.
Referenced by finalizePeriodNumbers(), and periodNumber().
|
mutableprivate |
Definition at line 82 of file BankPulseTimes.h.
Referenced by arePulseTimesIncreasing().
|
mutableprivate |
Definition at line 83 of file BankPulseTimes.h.
Referenced by arePulseTimesIncreasing().
|
private |
Vector of period numbers corresponding to each pulse.
Definition at line 75 of file BankPulseTimes.h.
Referenced by finalizePeriodNumbers(), and periodNumber().
|
private |
Array of the pulse times.
Definition at line 78 of file BankPulseTimes.h.
Referenced by arePulseTimesIncreasing(), finalizePeriodNumbers(), numberOfPulses(), pulseTime(), readData(), and updateStartTime().
| std::string Mantid::DataHandling::BankPulseTimes::startTime |
String describing the start time.
Definition at line 62 of file BankPulseTimes.h.
Referenced by BankPulseTimes(), equals(), and updateStartTime().