Mantid
|
MuunNexusReader opens a Nexus file and reads certain fields expected for a ISIS Muon data file (old format). More...
#include <MuonNexusReader.h>
Public Member Functions | |
std::string | getInstrumentName () const |
return instrument name More... | |
int | getLogLength (const int i) const |
Lenght of i'th log. More... | |
std::string | getLogName (const int i) const |
Name of i'th log. More... | |
void | getLogStringValues (const int &logNumber, const int &logSequence, std::time_t &logTime, std::string &value) |
get logSequence pair of logNumber string log More... | |
void | getLogValues (const int &logNumber, const int &logSequence, std::time_t &logTime, double &value) |
get logSequence pair of logNumber log More... | |
std::string | getSampleName () const |
void | getTimeChannels (float *timebnds, const int &nbnds) const |
get time bin boundaries return sample name More... | |
bool | logTypeNumeric (const int i) const |
true if i'th log is of numeric type More... | |
std::string | logUnits (const int i) const |
MuonNexusReader ()=default | |
Default constructor. More... | |
int | numberOfLogs () const |
Number of NXlog sections read from file. More... | |
void | readFromFile (const std::string &filename) |
read histogram data More... | |
void | readLogData (const std::string &filename) |
read log data More... | |
~MuonNexusReader ()=default | |
Default Destructor. More... | |
Public Attributes | |
std::vector< float > | m_correctedTimes |
temp store for corrected times More... | |
std::vector< int > | m_counts |
temp store of histogram data More... | |
std::vector< int > | m_detectorGroupings |
detector grouping info More... | |
std::string | m_framesPeriodsRaw |
std::string | m_framesPeriodsRequested |
int | m_numDetectors = 0 |
detector count More... | |
int | m_numPeriodSequences = 0 |
std::string | m_periodNames |
std::string | m_periodsCounts |
std::string | m_periodsOutput |
std::string | m_periodTypes |
int | t_nper = 0 |
number of periods in file (=1 at present) More... | |
int | t_nsp1 = 0 |
number of spectra in time regime 1 More... | |
int | t_ntc1 = 0 |
number of time channels in time regime 1 More... | |
Private Member Functions | |
void | openFirstNXentry (NeXus::File &handle) |
Open the first NXentry of the supplied nexus file. More... | |
bool | readMuonLogData (NeXus::File &handle) |
method to read the fields of open NXlog section More... | |
void | readPeriodInfo (NeXus::File &handle) |
Try to read in vairous peices of period information. More... | |
std::time_t | to_time_t (const boost::posix_time::ptime &t) |
Private Attributes | |
std::vector< std::string > | m_logNames |
stores name read from file More... | |
std::vector< std::vector< std::string > > | m_logStringValues |
array of string values for i'th NXlog section More... | |
std::vector< std::vector< float > > | m_logTimes |
arrys of times for i'th NXlog section More... | |
std::vector< bool > | m_logType |
true if i'th log is numeric More... | |
std::vector< std::string > | m_logUnits |
std::vector< std::vector< float > > | m_logValues |
array of values for i'th NXlog section More... | |
std::string | m_nexusInstrumentName |
name read from nexus file More... | |
int | m_nexusLogCount = 0 |
number of NXlog sections read from file More... | |
std::string | m_nexusSampleName |
sample name read from Nexus More... | |
std::string | m_startTime |
string startTime which must be read from Nexus More... | |
std::time_t | m_startTime_time_t = 0 |
file to base all NXlog times on More... | |
MuunNexusReader opens a Nexus file and reads certain fields expected for a ISIS Muon data file (old format).
These values are stored for access via LoadMuonNexus.
Required Properties:
Definition at line 18 of file MuonNexusReader.h.
|
default |
Default constructor.
|
default |
Default Destructor.
string MuonNexusReader::getInstrumentName | ( | ) | const |
return instrument name
Definition at line 224 of file MuonNexusReader.cpp.
References m_nexusInstrumentName.
Referenced by Mantid::DataHandling::LoadInstrumentFromNexus::exec(), and Mantid::DataHandling::LoadMuonNexus1::exec().
int MuonNexusReader::getLogLength | ( | const int | i | ) | const |
Lenght of i'th log.
Definition at line 383 of file MuonNexusReader.cpp.
References m_logTimes.
Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().
string MuonNexusReader::getLogName | ( | const int | i | ) | const |
Name of i'th log.
return log name of i'th NXlog section
i | :: the number of the NXlog section find name of. |
Definition at line 393 of file MuonNexusReader.cpp.
References m_logNames.
Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().
void MuonNexusReader::getLogStringValues | ( | const int & | logNumber, |
const int & | logSequence, | ||
std::time_t & | logTime, | ||
std::string & | value | ||
) |
get logSequence pair of logNumber string log
Definition at line 368 of file MuonNexusReader.cpp.
References m_logStringValues, m_logTimes, m_startTime_time_t, and value.
Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().
void MuonNexusReader::getLogValues | ( | const int & | logNumber, |
const int & | logSequence, | ||
std::time_t & | logTime, | ||
double & | value | ||
) |
get logSequence pair of logNumber log
Definition at line 357 of file MuonNexusReader.cpp.
References m_logTimes, m_logValues, m_startTime_time_t, and value.
Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().
|
inline |
Definition at line 78 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonLog::exec().
void MuonNexusReader::getTimeChannels | ( | float * | timebnds, |
const int & | nbnds | ||
) | const |
get time bin boundaries return sample name
Definition at line 216 of file MuonNexusReader.cpp.
References m_correctedTimes.
Referenced by Mantid::DataHandling::LoadMuonNexus1::loadData().
bool MuonNexusReader::logTypeNumeric | ( | const int | i | ) | const |
true if i'th log is of numeric type
Definition at line 387 of file MuonNexusReader.cpp.
References m_logType.
Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().
std::string MuonNexusReader::logUnits | ( | const int | i | ) | const |
Definition at line 385 of file MuonNexusReader.cpp.
References m_logUnits.
Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().
int MuonNexusReader::numberOfLogs | ( | ) | const |
Number of NXlog sections read from file.
Definition at line 381 of file MuonNexusReader.cpp.
References m_nexusLogCount.
Referenced by Mantid::DataHandling::LoadMuonLog::exec().
|
private |
Open the first NXentry of the supplied nexus file.
handle | Object to work on. |
Definition at line 57 of file MuonNexusReader.cpp.
Referenced by readFromFile(), and readLogData().
void MuonNexusReader::readFromFile | ( | const std::string & | filename | ) |
read histogram data
Definition at line 82 of file MuonNexusReader.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, m_correctedTimes, m_counts, m_detectorGroupings, m_nexusInstrumentName, m_numDetectors, openFirstNXentry(), readPeriodInfo(), t_nper, t_nsp1, and t_ntc1.
Referenced by Mantid::DataHandling::LoadInstrumentFromNexus::exec(), and Mantid::DataHandling::LoadMuonNexus1::exec().
void MuonNexusReader::readLogData | ( | const std::string & | filename | ) |
read log data
Definition at line 237 of file MuonNexusReader.cpp.
References m_nexusLogCount, m_nexusSampleName, m_startTime, m_startTime_time_t, openFirstNXentry(), readMuonLogData(), and to_time_t().
Referenced by Mantid::DataHandling::LoadMuonLog::exec().
|
private |
method to read the fields of open NXlog section
Definition at line 279 of file MuonNexusReader.cpp.
References Mantid::API::g_log, m_logNames, m_logStringValues, m_logTimes, m_logType, m_logUnits, m_logValues, tmp, and Mantid::Kernel::Logger::warning().
Referenced by readLogData().
|
private |
Try to read in vairous peices of period information.
Period info includes:
Definition at line 170 of file MuonNexusReader.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, m_framesPeriodsRaw, m_framesPeriodsRequested, m_numPeriodSequences, m_periodNames, m_periodsCounts, m_periodsOutput, and m_periodTypes.
Referenced by readFromFile().
|
inlineprivate |
Take the input Posix time, subtract the unix epoch, and return the seconds as a std::time_t value.
t | :: time of interest as ptime |
t | convert posix time to time_t |
Definition at line 50 of file MuonNexusReader.h.
Referenced by readLogData().
std::vector<float> MuonNexusReader::m_correctedTimes |
temp store for corrected times
Definition at line 93 of file MuonNexusReader.h.
Referenced by getTimeChannels(), and readFromFile().
std::vector<int> MuonNexusReader::m_counts |
temp store of histogram data
Definition at line 94 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::loadData(), and readFromFile().
std::vector<int> MuonNexusReader::m_detectorGroupings |
detector grouping info
Definition at line 95 of file MuonNexusReader.h.
Referenced by readFromFile().
std::string MuonNexusReader::m_framesPeriodsRaw |
Definition at line 102 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
std::string MuonNexusReader::m_framesPeriodsRequested |
Definition at line 101 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
|
private |
stores name read from file
Definition at line 39 of file MuonNexusReader.h.
Referenced by getLogName(), and readMuonLogData().
|
private |
array of string values for i'th NXlog section
Definition at line 46 of file MuonNexusReader.h.
Referenced by getLogStringValues(), and readMuonLogData().
|
private |
arrys of times for i'th NXlog section
Definition at line 45 of file MuonNexusReader.h.
Referenced by getLogLength(), getLogStringValues(), getLogValues(), and readMuonLogData().
|
private |
true if i'th log is numeric
Definition at line 38 of file MuonNexusReader.h.
Referenced by logTypeNumeric(), and readMuonLogData().
|
private |
Definition at line 40 of file MuonNexusReader.h.
Referenced by logUnits(), and readMuonLogData().
|
private |
array of values for i'th NXlog section
Definition at line 44 of file MuonNexusReader.h.
Referenced by getLogValues(), and readMuonLogData().
|
private |
name read from nexus file
Definition at line 35 of file MuonNexusReader.h.
Referenced by getInstrumentName(), and readFromFile().
|
private |
number of NXlog sections read from file
Definition at line 37 of file MuonNexusReader.h.
Referenced by numberOfLogs(), and readLogData().
|
private |
sample name read from Nexus
Definition at line 36 of file MuonNexusReader.h.
Referenced by readLogData().
int MuonNexusReader::m_numDetectors = 0 |
int MuonNexusReader::m_numPeriodSequences = 0 |
Definition at line 98 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
std::string MuonNexusReader::m_periodNames |
Definition at line 99 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
std::string MuonNexusReader::m_periodsCounts |
Definition at line 104 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
std::string MuonNexusReader::m_periodsOutput |
Definition at line 103 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
std::string MuonNexusReader::m_periodTypes |
Definition at line 100 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().
|
private |
string startTime which must be read from Nexus
Definition at line 47 of file MuonNexusReader.h.
Referenced by readLogData().
|
private |
file to base all NXlog times on
startTime in time_t format
Definition at line 49 of file MuonNexusReader.h.
Referenced by getLogStringValues(), getLogValues(), and readLogData().
int MuonNexusReader::t_nper = 0 |
number of periods in file (=1 at present)
Definition at line 91 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readFromFile().
int MuonNexusReader::t_nsp1 = 0 |
number of spectra in time regime 1
Definition at line 89 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readFromFile().
int MuonNexusReader::t_ntc1 = 0 |
number of time channels in time regime 1
Definition at line 90 of file MuonNexusReader.h.
Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readFromFile().