Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
63833689
Commit
63833689
authored
5 years ago
by
Stephen
Browse files
Options
Downloads
Patches
Plain Diff
Fixing docs warning, and clearing up comments
parent
13cfea62
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/DataHandling/src/LoadISISNexus2.cpp
+1
-1
1 addition, 1 deletion
Framework/DataHandling/src/LoadISISNexus2.cpp
Framework/DataHandling/src/LoadISISNexusHelper.cpp
+30
-36
30 additions, 36 deletions
Framework/DataHandling/src/LoadISISNexusHelper.cpp
with
31 additions
and
37 deletions
Framework/DataHandling/src/LoadISISNexus2.cpp
+
1
−
1
View file @
63833689
...
...
@@ -433,7 +433,7 @@ void LoadISISNexus2::exec() {
m_spec
.
clear
();
m_monitors
.
clear
();
m_wsInd2specNum_map
.
clear
();
}
// namespace DataHandling
}
// Function object for remove_if STL algorithm
namespace
{
...
...
This diff is collapsed.
Click to expand it.
Framework/DataHandling/src/LoadISISNexusHelper.cpp
+
30
−
36
View file @
63833689
...
...
@@ -8,7 +8,7 @@
#include
"MantidAPI/Run.h"
#include
"MantidAPI/Sample.h"
namespace
{
static
constexpr
size_t
RUN_TIME_STRING_LENGTH
=
19
;
static
constexpr
std
::
size_t
RUN_TIME_STRING_LENGTH
=
19
;
}
// namespace
namespace
Mantid
{
...
...
@@ -17,10 +17,8 @@ namespace DataHandling {
namespace
LoadISISNexusHelper
{
using
namespace
Kernel
;
using
namespace
API
;
using
namespace
NeXus
;
using
std
::
size_t
;
/**
* Find total number of spectra in the nexus file
...
...
@@ -76,7 +74,7 @@ findDetectorIDsAndSpectrumNumber(const NXEntry &entry, const bool hasVMSBlock) {
/**
* Load geometrical data about the sample from the nexus entry into a workspace
* @param
S
ample :: The sample which the geometrical data will be saved into
* @param
s
ample :: The sample which the geometrical data will be saved into
* @param entry :: The Nexus entry
* @param hasVMSBlock :: Whether the current nexus entry has a vms_compat
* block
...
...
@@ -123,18 +121,19 @@ void loadSampleGeometry(Sample &sample, const NXEntry &entry,
/**
* Load data about the run
* @param
R
un :: The run where the information will be stored
* @param
r
un :: The run where the information will be stored
* @param entry :: The Nexus entry
* @param hasVMSBlock :: Whether the current nexus entry has a vms_compat
*/
void
loadRunDetails
(
API
::
Run
&
run
Details
,
const
NXEntry
&
entry
,
void
loadRunDetails
(
API
::
Run
&
run
,
const
NXEntry
&
entry
,
const
bool
hasVMSBlock
)
{
// Charge is stored as a float
double
proton_charge
=
static_cast
<
double
>
(
entry
.
getFloat
(
"proton_charge"
));
run
Details
.
setProtonCharge
(
proton_charge
);
run
.
setProtonCharge
(
proton_charge
);
std
::
string
run_num
=
std
::
to_string
(
entry
.
getInt
(
"run_number"
));
run
Details
.
addProperty
(
"run_number"
,
run_num
);
run
.
addProperty
(
"run_number"
,
run_num
);
// End date and time is stored separately in ISO format in the
// "raw_data1/endtime" class
...
...
@@ -142,18 +141,16 @@ void loadRunDetails(API::Run &runDetails, const NXEntry &entry,
char_data
.
load
();
std
::
string
end_time_iso
=
std
::
string
(
char_data
(),
RUN_TIME_STRING_LENGTH
);
run
Details
.
addProperty
(
"run_end"
,
end_time_iso
);
run
.
addProperty
(
"run_end"
,
end_time_iso
);
char_data
=
entry
.
openNXChar
(
"start_time"
);
char_data
.
load
();
std
::
string
start_time_iso
=
std
::
string
(
char_data
(),
RUN_TIME_STRING_LENGTH
);
run
Details
.
addProperty
(
"run_start"
,
start_time_iso
);
run
.
addProperty
(
"run_start"
,
start_time_iso
);
// Some details are only stored in the VMS comparability block so we'll
// everything from there
// for consistency
// If we have a vms block, load details from there
if
(
hasVMSBlock
)
{
NXClass
vms_compat
=
entry
.
openNXGroup
(
"isis_vms_compat"
);
...
...
@@ -161,53 +158,50 @@ void loadRunDetails(API::Run &runDetails, const NXEntry &entry,
// RPB struct info
NXInt
rpb_int
=
vms_compat
.
openNXInt
(
"IRPB"
);
rpb_int
.
load
();
runDetails
.
addProperty
(
"freq"
,
rpb_int
[
6
]);
// 2**k where source frequency = 50 / 2**k
run
.
addProperty
(
"freq"
,
rpb_int
[
6
]);
// 2**k where source frequency = 50 / 2**k
// Now double data
NXFloat
rpb_dbl
=
vms_compat
.
openNXFloat
(
"RRPB"
);
rpb_dbl
.
load
();
run
Details
.
addProperty
(
run
.
addProperty
(
"gd_prtn_chrg"
,
static_cast
<
double
>
(
rpb_dbl
[
7
]));
// good proton charge (uA.hour)
run
Details
.
addProperty
(
run
.
addProperty
(
"tot_prtn_chrg"
,
static_cast
<
double
>
(
rpb_dbl
[
8
]));
// total proton charge (uA.hour)
run
Details
.
addProperty
(
"goodfrm"
,
rpb_int
[
9
]);
// good frames
run
Details
.
addProperty
(
"rawfrm"
,
rpb_int
[
10
]);
// raw frames
run
Details
.
addProperty
(
"rb_proposal"
,
rpb_int
[
21
]);
// RB (proposal)
static_cast
<
double
>
(
rpb_dbl
[
8
]));
// total proton charge (uA.hour)
run
.
addProperty
(
"goodfrm"
,
rpb_int
[
9
]);
// good frames
run
.
addProperty
(
"rawfrm"
,
rpb_int
[
10
]);
// raw frames
run
.
addProperty
(
"rb_proposal"
,
rpb_int
[
21
]);
// RB (proposal)
vms_compat
.
close
();
}
else
{
NXFloat
floatData
=
entry
.
openNXFloat
(
"duration"
);
floatData
.
load
();
run
Details
.
addProperty
(
"dur"
,
static_cast
<
double
>
(
floatData
[
0
]),
floatData
.
attributes
(
"units"
),
true
);
run
.
addProperty
(
"dur"
,
static_cast
<
double
>
(
floatData
[
0
]),
floatData
.
attributes
(
"units"
),
true
);
// These variables have changed, gd_prtn_chrg is now proton_charge
floatData
=
entry
.
openNXFloat
(
"proton_charge"
);
floatData
.
load
();
run
Details
.
addProperty
(
"gd_prtn_chrg"
,
static_cast
<
double
>
(
floatData
[
0
]),
floatData
.
attributes
(
"units"
),
true
);
run
.
addProperty
(
"gd_prtn_chrg"
,
static_cast
<
double
>
(
floatData
[
0
]),
floatData
.
attributes
(
"units"
),
true
);
// Total_proton_charge is now proton_charge_raw
floatData
=
entry
.
openNXFloat
(
"proton_charge_raw"
);
floatData
.
load
();
run
Details
.
addProperty
(
"tot_prtn_chrg"
,
static_cast
<
double
>
(
floatData
[
0
]),
floatData
.
attributes
(
"units"
),
true
);
run
.
addProperty
(
"tot_prtn_chrg"
,
static_cast
<
double
>
(
floatData
[
0
]),
floatData
.
attributes
(
"units"
),
true
);
if
(
entry
.
containsGroup
(
"instrument/source/frequency"
))
{
runDetails
.
addProperty
(
"freq"
,
entry
.
getFloat
(
"instrument/source/frequency"
));
run
.
addProperty
(
"freq"
,
entry
.
getFloat
(
"instrument/source/frequency"
));
}
else
{
// If no entry, assume 50hz source (suggested by Freddie Akeroyd)
run
Details
.
addProperty
(
"freq"
,
50
,
"Hz"
,
true
);
run
.
addProperty
(
"freq"
,
50
,
"Hz"
,
true
);
}
runDetails
.
addProperty
(
"goodfrm"
,
entry
.
getInt
(
"good_frames"
));
runDetails
.
addProperty
(
"rawfrm"
,
entry
.
getInt
(
"raw_frames"
));
runDetails
.
addProperty
(
"rb_proposal"
,
entry
.
getString
(
"experiment_identifier"
));
// RB (proposal)
run
.
addProperty
(
"goodfrm"
,
entry
.
getInt
(
"good_frames"
));
run
.
addProperty
(
"rawfrm"
,
entry
.
getInt
(
"raw_frames"
));
run
.
addProperty
(
"rb_proposal"
,
entry
.
getString
(
"experiment_identifier"
));
// RB (proposal)
}
}
}
// namespace LoadISISNexusHelper
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment