Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
MuonNexusReader Class Reference

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...
 

Detailed Description

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:

Author
Ronald Fowler, based on ISISRAW.
Date
14/08/2008

Definition at line 18 of file MuonNexusReader.h.

Constructor & Destructor Documentation

◆ MuonNexusReader()

MuonNexusReader::MuonNexusReader ( )
default

Default constructor.

◆ ~MuonNexusReader()

MuonNexusReader::~MuonNexusReader ( )
default

Default Destructor.

Member Function Documentation

◆ getInstrumentName()

string MuonNexusReader::getInstrumentName ( ) const

◆ getLogLength()

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().

◆ getLogName()

string MuonNexusReader::getLogName ( const int  i) const

Name of i'th log.

return log name of i'th NXlog section

Parameters
i:: the number of the NXlog section find name of.
Returns
the log name at the given index

Definition at line 393 of file MuonNexusReader.cpp.

References m_logNames.

Referenced by Mantid::DataHandling::LoadMuonLog::addLogValueFromIndex().

◆ getLogStringValues()

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().

◆ getLogValues()

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().

◆ getSampleName()

std::string MuonNexusReader::getSampleName ( ) const
inline

Definition at line 78 of file MuonNexusReader.h.

Referenced by Mantid::DataHandling::LoadMuonLog::exec().

◆ getTimeChannels()

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().

◆ logTypeNumeric()

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().

◆ logUnits()

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().

◆ numberOfLogs()

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().

◆ openFirstNXentry()

void MuonNexusReader::openFirstNXentry ( NeXus::File &  handle)
private

Open the first NXentry of the supplied nexus file.

Parameters
handleObject to work on.

Definition at line 57 of file MuonNexusReader.cpp.

Referenced by readFromFile(), and readLogData().

◆ readFromFile()

void MuonNexusReader::readFromFile ( const std::string &  filename)

◆ readLogData()

void MuonNexusReader::readLogData ( const std::string &  filename)

◆ readMuonLogData()

bool MuonNexusReader::readMuonLogData ( NeXus::File &  handle)
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().

◆ readPeriodInfo()

void MuonNexusReader::readPeriodInfo ( NeXus::File &  handle)
private

Try to read in vairous peices of period information.

Period info includes:

  • Period sequences
  • Period Names
  • Period type
  • Frames periods requested
  • Raw frames
  • Tag
  • Total counts per period

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().

◆ to_time_t()

std::time_t MuonNexusReader::to_time_t ( const boost::posix_time::ptime &  t)
inlineprivate

Take the input Posix time, subtract the unix epoch, and return the seconds as a std::time_t value.

Parameters
t:: time of interest as ptime
Returns
:: time_t value of t
Parameters
tconvert posix time to time_t

Definition at line 50 of file MuonNexusReader.h.

Referenced by readLogData().

Member Data Documentation

◆ m_correctedTimes

std::vector<float> MuonNexusReader::m_correctedTimes

temp store for corrected times

Definition at line 93 of file MuonNexusReader.h.

Referenced by getTimeChannels(), and readFromFile().

◆ m_counts

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().

◆ m_detectorGroupings

std::vector<int> MuonNexusReader::m_detectorGroupings

detector grouping info

Definition at line 95 of file MuonNexusReader.h.

Referenced by readFromFile().

◆ m_framesPeriodsRaw

std::string MuonNexusReader::m_framesPeriodsRaw

◆ m_framesPeriodsRequested

std::string MuonNexusReader::m_framesPeriodsRequested

◆ m_logNames

std::vector<std::string> MuonNexusReader::m_logNames
private

stores name read from file

Definition at line 39 of file MuonNexusReader.h.

Referenced by getLogName(), and readMuonLogData().

◆ m_logStringValues

std::vector<std::vector<std::string> > MuonNexusReader::m_logStringValues
private

array of string values for i'th NXlog section

Definition at line 46 of file MuonNexusReader.h.

Referenced by getLogStringValues(), and readMuonLogData().

◆ m_logTimes

std::vector<std::vector<float> > MuonNexusReader::m_logTimes
private

arrys of times for i'th NXlog section

Definition at line 45 of file MuonNexusReader.h.

Referenced by getLogLength(), getLogStringValues(), getLogValues(), and readMuonLogData().

◆ m_logType

std::vector<bool> MuonNexusReader::m_logType
private

true if i'th log is numeric

Definition at line 38 of file MuonNexusReader.h.

Referenced by logTypeNumeric(), and readMuonLogData().

◆ m_logUnits

std::vector<std::string> MuonNexusReader::m_logUnits
private

Definition at line 40 of file MuonNexusReader.h.

Referenced by logUnits(), and readMuonLogData().

◆ m_logValues

std::vector<std::vector<float> > MuonNexusReader::m_logValues
private

array of values for i'th NXlog section

Definition at line 44 of file MuonNexusReader.h.

Referenced by getLogValues(), and readMuonLogData().

◆ m_nexusInstrumentName

std::string MuonNexusReader::m_nexusInstrumentName
private

name read from nexus file

Definition at line 35 of file MuonNexusReader.h.

Referenced by getInstrumentName(), and readFromFile().

◆ m_nexusLogCount

int MuonNexusReader::m_nexusLogCount = 0
private

number of NXlog sections read from file

Definition at line 37 of file MuonNexusReader.h.

Referenced by numberOfLogs(), and readLogData().

◆ m_nexusSampleName

std::string MuonNexusReader::m_nexusSampleName
private

sample name read from Nexus

Definition at line 36 of file MuonNexusReader.h.

Referenced by readLogData().

◆ m_numDetectors

int MuonNexusReader::m_numDetectors = 0

detector count

Definition at line 96 of file MuonNexusReader.h.

Referenced by readFromFile().

◆ m_numPeriodSequences

int MuonNexusReader::m_numPeriodSequences = 0

Definition at line 98 of file MuonNexusReader.h.

Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().

◆ m_periodNames

std::string MuonNexusReader::m_periodNames

Definition at line 99 of file MuonNexusReader.h.

Referenced by Mantid::DataHandling::LoadMuonNexus1::exec(), and readPeriodInfo().

◆ m_periodsCounts

std::string MuonNexusReader::m_periodsCounts

◆ m_periodsOutput

std::string MuonNexusReader::m_periodsOutput

◆ m_periodTypes

std::string MuonNexusReader::m_periodTypes

◆ m_startTime

std::string MuonNexusReader::m_startTime
private

string startTime which must be read from Nexus

Definition at line 47 of file MuonNexusReader.h.

Referenced by readLogData().

◆ m_startTime_time_t

std::time_t MuonNexusReader::m_startTime_time_t = 0
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().

◆ t_nper

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().

◆ t_nsp1

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().

◆ t_ntc1

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().


The documentation for this class was generated from the following files: