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
57d5e201
Commit
57d5e201
authored
4 years ago
by
William F Godoy
Browse files
Options
Downloads
Patches
Plain Diff
Refactored LoadEntryMetadata
parent
8094ff65
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
+7
-10
7 additions, 10 deletions
...work/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
with
7 additions
and
10 deletions
Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
+
7
−
10
View file @
57d5e201
...
@@ -603,10 +603,8 @@ void LoadEventNexus::loadEntryMetadata(
...
@@ -603,10 +603,8 @@ void LoadEventNexus::loadEntryMetadata(
::
NeXus
::
File
file
(
nexusfilename
);
::
NeXus
::
File
file
(
nexusfilename
);
file
.
openGroup
(
entry_name
,
"NXentry"
);
file
.
openGroup
(
entry_name
,
"NXentry"
);
const
std
::
map
<
std
::
string
,
std
::
string
>
entriesNxentry
=
file
.
getEntries
();
// get the title
// get the title
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/title"
,
"
NXentry
"
))
{
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/title"
,
"
SDS
"
))
{
file
.
openData
(
"title"
);
file
.
openData
(
"title"
);
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
std
::
string
title
=
file
.
getStrData
();
std
::
string
title
=
file
.
getStrData
();
...
@@ -617,7 +615,7 @@ void LoadEventNexus::loadEntryMetadata(
...
@@ -617,7 +615,7 @@ void LoadEventNexus::loadEntryMetadata(
}
}
// get the notes
// get the notes
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/notes"
,
"
NXentry
"
))
{
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/notes"
,
"
SDS
"
))
{
file
.
openData
(
"notes"
);
file
.
openData
(
"notes"
);
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
std
::
string
notes
=
file
.
getStrData
();
std
::
string
notes
=
file
.
getStrData
();
...
@@ -628,7 +626,7 @@ void LoadEventNexus::loadEntryMetadata(
...
@@ -628,7 +626,7 @@ void LoadEventNexus::loadEntryMetadata(
}
}
// Get the run number
// Get the run number
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/run_number"
,
"
NXentry
"
))
{
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/run_number"
,
"
SDS
"
))
{
file
.
openData
(
"run_number"
);
file
.
openData
(
"run_number"
);
std
::
string
run
;
std
::
string
run
;
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
...
@@ -647,8 +645,7 @@ void LoadEventNexus::loadEntryMetadata(
...
@@ -647,8 +645,7 @@ void LoadEventNexus::loadEntryMetadata(
}
}
// get the experiment identifier
// get the experiment identifier
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/experiment_identifier"
,
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/experiment_identifier"
,
"SDS"
))
{
"NXentry"
))
{
file
.
openData
(
"experiment_identifier"
);
file
.
openData
(
"experiment_identifier"
);
std
::
string
expId
;
std
::
string
expId
;
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
if
(
file
.
getInfo
().
type
==
::
NeXus
::
CHAR
)
{
...
@@ -662,10 +659,10 @@ void LoadEventNexus::loadEntryMetadata(
...
@@ -662,10 +659,10 @@ void LoadEventNexus::loadEntryMetadata(
// get the sample name - nested try/catch to leave the handle in an
// get the sample name - nested try/catch to leave the handle in an
// appropriate state
// appropriate state
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/sample"
,
"NX
entry
"
))
{
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/sample"
,
"NX
sample
"
))
{
file
.
openGroup
(
"sample"
,
"NXsample"
);
file
.
openGroup
(
"sample"
,
"NXsample"
);
try
{
try
{
if
(
exists
(
file
,
"name
"
))
{
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/sample/name"
,
"SDS
"
))
{
file
.
openData
(
"name"
);
file
.
openData
(
"name"
);
const
auto
info
=
file
.
getInfo
();
const
auto
info
=
file
.
getInfo
();
std
::
string
name
;
std
::
string
name
;
...
@@ -693,7 +690,7 @@ void LoadEventNexus::loadEntryMetadata(
...
@@ -693,7 +690,7 @@ void LoadEventNexus::loadEntryMetadata(
}
}
// get the duration
// get the duration
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/duration"
,
"
NXentry
"
))
{
if
(
descriptor
.
isEntry
(
"/"
+
entry_name
+
"/duration"
,
"
SDS
"
))
{
file
.
openData
(
"duration"
);
file
.
openData
(
"duration"
);
std
::
vector
<
double
>
duration
;
std
::
vector
<
double
>
duration
;
file
.
getDataCoerce
(
duration
);
file
.
getDataCoerce
(
duration
);
...
...
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