46 const auto &rawHdr = isisRaw.
hdr;
48 const size_t byte =
sizeof(char);
49 const char fieldSep(
' ');
52 memcpy(start, rawHdr.inst_abrv, 3 *
byte);
54 memset(start, fieldSep,
byte);
57 memcpy(start, rawHdr.hd_run, 5 *
byte);
59 memset(start, fieldSep,
byte);
62 memcpy(start, rawHdr.hd_user, 20 *
byte);
64 memset(start, fieldSep,
byte);
67 memcpy(start, rawHdr.hd_title, 24 *
byte);
69 memset(start, fieldSep,
byte);
72 memcpy(start, rawHdr.hd_date, 12 *
byte);
74 memset(start, fieldSep,
byte);
77 memcpy(start, rawHdr.hd_time, 8 *
byte);
79 memset(start, fieldSep,
byte);
82 memcpy(start, rawHdr.hd_dur, 8 *
byte);
85 return std::string(header, header + 86);
90 const std::vector<std::string> exts{
".raw",
".s*"};
92 "The name of the [[RAW_File | RAW]] file from which to "
93 "extract the parameters");
95 "If this is true, the parameters from the RPB struct are "
96 "placed into a TableWorkspace called Raw_RPB",
99 "If this is true, the parameters from the SPB struct are "
100 "placed into a TableWorkspace called Raw_SPB. ",
114 if (isis_raw.
readFromFile(filename.c_str(),
false) != 0) {
115 g_log.
error(
"Unable to open file " + filename);
122 g_log.
debug() <<
"Properties retrieved from " << filename <<
"\n"
123 <<
"\tRun title: " << title <<
"\n\tRun header: " << header <<
"\n";
128 int num_holder = isis_raw.
t_nsp1;
130 g_log.
debug() <<
"\tNumber of spectra: " << num_holder <<
"\n";
135 num_holder = isis_raw.
t_ntc1;
137 g_log.
debug() <<
"\tNumber of time channels: " << num_holder <<
"\n";
139 num_holder = isis_raw.
t_nper;
141 g_log.
debug() <<
"\tNumber of periods: " << num_holder <<
"\n";
144 bool get_run_info =
getProperty(
"GetRunParameters");
148 "The name of the TableWorkspace in which to store the list "
149 "of run parameters");
152 run_table->addColumn(
"int",
"r_dur");
153 run_table->addColumn(
"int",
"r_durunits");
154 run_table->addColumn(
"int",
156 run_table->addColumn(
"int",
"r_dmp");
157 run_table->addColumn(
"int",
"r_dmp_units");
158 run_table->addColumn(
"int",
"r_dmp_freq");
159 run_table->addColumn(
"int",
161 run_table->addColumn(
"double",
163 run_table->addColumn(
"double",
165 run_table->addColumn(
"int",
"r_goodfrm");
166 run_table->addColumn(
"int",
"r_rawfrm");
167 run_table->addColumn(
"int",
"r_dur_wanted");
170 run_table->addColumn(
"int",
"r_dur_secs");
171 run_table->addColumn(
"int",
"r_mon_sum1");
172 run_table->addColumn(
"int",
"r_mon_sum2");
173 run_table->addColumn(
"int",
"r_mon_sum3");
174 run_table->addColumn(
"str",
"r_enddate");
175 run_table->addColumn(
"str",
"r_endtime");
176 run_table->addColumn(
"int",
"r_prop");
189 bool getSampleParameters =
getProperty(
"GetSampleParameters");
190 if (getSampleParameters) {
193 "The name of the TableWorkspace in which to store the list "
194 "of sample parameters");
197 sample_table->addColumn(
"int",
"e_posn");
198 sample_table->addColumn(
"int",
"e_type");
199 sample_table->addColumn(
"int",
"e_geom");
200 sample_table->addColumn(
"double",
"e_thick");
201 sample_table->addColumn(
"double",
"e_height");
202 sample_table->addColumn(
"double",
"e_width");
203 sample_table->addColumn(
"double",
205 sample_table->addColumn(
"double",
"e_chi");
206 sample_table->addColumn(
"double",
"e_phi");
207 sample_table->addColumn(
"double",
"e_scatt");
208 sample_table->addColumn(
"double",
210 sample_table->addColumn(
"double",
212 sample_table->addColumn(
"double",
214 sample_table->addColumn(
"double",
216 sample_table->addColumn(
"double",
"e_canthick");
217 sample_table->addColumn(
"double",
219 sample_table->addColumn(
"double",
"can_cs_inc");
220 sample_table->addColumn(
"double",
"can_cs_abs");
221 sample_table->addColumn(
"double",
223 sample_table->addColumn(
"str",
225 sample_table->addColumn(
"int",
"e_equip");
226 sample_table->addColumn(
"int",
"e_eqname");
228 const auto nameLength =
static_cast<int>(strlen(isis_raw.
spb.
e_name));
234 <<
static_cast<double>(isis_raw.
spb.
e_omega) <<
static_cast<double>(isis_raw.
spb.
e_chi)
235 <<
static_cast<double>(isis_raw.
spb.
e_phi) <<
static_cast<double>(isis_raw.
spb.
e_scatt)
#define DECLARE_ALGORITHM(classname)
HDR_STRUCT hdr
header block (80 bytes)
SPB_STRUCT spb
sample parameter block (64*4 bytes)
int t_nper
number of periods
int t_nsp1
number of spectra in time regime 1
int readFromFile(const char *filename, bool read_data=true)
stuff
RPB_STRUCT rpb
run parameter block (32*4 bytes)
int t_ntc1
number of time channels in time regime 1
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
@ Load
allowed here which will be passed to the algorithm
TableRow represents a row in a TableWorkspace.
A property class for workspaces.
An algorithm to extract pertinent information about a RAW file without loading the data.
void init() override
Initialisation code.
const std::string name() const override
Algorithm's name.
void exec() override
Execution code.
static const std::string runTitle(const ISISRAW &isisRaw)
Return the run title from the raw data structure.
static const std::string runHeader(const ISISRAW &isisRaw)
Return the run header from the raw data structure.
Records the filename and the description of failure.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void debug(const std::string &msg)
Logs at debug level.
void error(const std::string &msg)
Logs at error level.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
@ Input
An input workspace.
@ Output
An output workspace.
int r_dur_secs
actual run duration in seconds
int r_freq
2**k where source frequency = 50 / 2**k
int r_dur_freq
test interval for above (seconds)
int r_mon_sum2
monitor sum 2
char r_endtime[8]
format HH-MM-SS
int r_dmp_units
scaler for above
char r_enddate[12]
format DD-MMM-YYYY
int r_dur_wanted
requested run duration (units as for "duration" above)
float r_gd_prtn_chrg
good proton charge (uA.hour)
int r_durunits
scaler for above (1=seconds)
int r_mon_sum1
monitor sum 1
int r_dmp_freq
test interval for above
int r_mon_sum3
monitor sum 3
int r_dur
actual run duration
int r_prop
RB (proposal) number.
float r_tot_prtn_chrg
total proton charge (uA.hour)
float e_canxsect
can coherent scattering cross section (barn)
int e_type
sample type (1=sample+can,2=empty can)
float e_width
sample width (mm)
float can_nd
can number density (atoms.A-3)
float e_xscatt
sample coherent scattering cross section (barn)
float e_phi
phi sample angle (degrees)
float e_scatt
scattering geometry (1=trans, 2 =reflect)
float e_omega
omega sample angle (degrees)
int e_geom
sample geometry
int e_posn
sample changer position
float e_chi
chi sample angle (degrees)
float samp_cs_inc
sample incoherent cross section
float e_dens
sample number density (atoms.A-3)
float e_height
sample height (mm)
float samp_cs_abs
sample absorption cross section
char e_name[40]
sample name of chemical formula
float e_thick
sample thickness normal to sample (mm)
float e_canthick
can wall thickness (mm)