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
108697c2
Commit
108697c2
authored
5 years ago
by
Geish Miladinovic
Browse files
Options
Downloads
Patches
Plain Diff
fix exception handling for missing param (no ticket)
parent
4cc098db
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/DataHandling/src/LoadBBY.cpp
+9
-7
9 additions, 7 deletions
Framework/DataHandling/src/LoadBBY.cpp
instrument/BILBY_Parameters.xml
+11
-7
11 additions, 7 deletions
instrument/BILBY_Parameters.xml
with
20 additions
and
14 deletions
Framework/DataHandling/src/LoadBBY.cpp
+
9
−
7
View file @
108697c2
...
@@ -504,7 +504,7 @@ void LoadBBY::loadInstrumentParameters(
...
@@ -504,7 +504,7 @@ void LoadBBY::loadInstrumentParameters(
if
(
!
hdfTag
.
empty
()
&&
loadNXDataSet
(
entry
,
hdfTag
,
tmpFloat
))
{
if
(
!
hdfTag
.
empty
()
&&
loadNXDataSet
(
entry
,
hdfTag
,
tmpFloat
))
{
auto
factor
=
std
::
stod
(
details
[
1
]);
auto
factor
=
std
::
stod
(
details
[
1
]);
logParams
[
logTag
]
=
factor
*
tmpFloat
;
logParams
[
logTag
]
=
factor
*
tmpFloat
;
}
else
{
}
else
if
(
details
.
size
()
>
2
)
{
logParams
[
logTag
]
=
std
::
stod
(
details
[
2
]);
logParams
[
logTag
]
=
std
::
stod
(
details
[
2
]);
if
(
!
hdfTag
.
empty
())
if
(
!
hdfTag
.
empty
())
g_log
.
warning
()
<<
"Cannot find hdf parameter "
g_log
.
warning
()
<<
"Cannot find hdf parameter "
...
@@ -609,13 +609,15 @@ void LoadBBY::createInstrument(ANSTO::Tar::File &tarFile,
...
@@ -609,13 +609,15 @@ void LoadBBY::createInstrument(ANSTO::Tar::File &tarFile,
loadInstrumentParameters
(
entry
,
logParams
,
allParams
);
loadInstrumentParameters
(
entry
,
logParams
,
allParams
);
// adjust parameters
// Ltof_det_value is not present for monochromatic data so check
try
{
// and replace with default
auto
findLtof
=
logParams
.
find
(
"Ltof_det_value"
);
if
(
findLtof
!=
logParams
.
end
())
{
logParams
[
"L1_chopper_value"
]
=
logParams
[
"L1_chopper_value"
]
=
logParams
[
"Ltof_det_value"
]
-
logParams
[
"L2_det_value"
];
logParams
[
"Ltof_det_value"
]
-
logParams
[
"L2_det_value"
];
}
catch
(
const
std
::
invalid_argument
&
)
{
}
else
{
logParams
[
"L1_chopper_value"
]
=
18.472
58984375
;
logParams
[
"L1_chopper_value"
]
=
18.472
6
;
g_log
.
warning
()
<<
"Cannot
find
parameter 'L1_chopper_value'"
g_log
.
warning
()
<<
"Cannot
recover
parameter 'L1_chopper_value'"
<<
", using default.
\n
"
;
<<
", using default.
\n
"
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
instrument/BILBY_Parameters.xml
+
11
−
7
View file @
108697c2
...
@@ -13,7 +13,10 @@
...
@@ -13,7 +13,10 @@
<!-- following parameters are saved to the run log,
<!-- following parameters are saved to the run log,
parameters are entered as log_[log_name] and the
parameters are entered as log_[log_name] and the
and the value is: "hdf_tag,scale,def_value" -->
and the value is: "hdf_tag,scale[,def_value]"
if the default value is not included and the
parameter is not in the hdf file no log value is
recorded-->
<parameter
name=
"log_sample_aperture"
type=
"string"
>
<parameter
name=
"log_sample_aperture"
type=
"string"
>
<value
val=
"sample/sample_aperture, 1.0, 0.0"
/>
<value
val=
"sample/sample_aperture, 1.0, 0.0"
/>
</parameter>
</parameter>
...
@@ -47,26 +50,27 @@
...
@@ -47,26 +50,27 @@
</parameter>
</parameter>
<parameter
name=
"log_L2_det_value"
type=
"string"
>
<parameter
name=
"log_L2_det_value"
type=
"string"
>
<value
val=
"instrument/L2_det, 0.001, 33.156
16015625
"
/>
<value
val=
"instrument/L2_det, 0.001, 33.156
2
"
/>
</parameter>
</parameter>
<!-- no valid default value -->
<parameter
name=
"log_Ltof_det_value"
type=
"string"
>
<parameter
name=
"log_Ltof_det_value"
type=
"string"
>
<value
val=
"instrument/Ltof_det, 0.001
, 0.0
"
/>
<value
val=
"instrument/Ltof_det, 0.001"
/>
</parameter>
</parameter>
<parameter
name=
"log_L1"
type=
"string"
>
<parameter
name=
"log_L1"
type=
"string"
>
<value
val=
"instrument/L1, 0.001, 16.671"
/>
<value
val=
"instrument/L1, 0.001, 16.671"
/>
</parameter>
</parameter>
<parameter
name=
"log_L2_curtainl_value"
type=
"string"
>
<parameter
name=
"log_L2_curtainl_value"
type=
"string"
>
<value
val=
"instrument/L2_curtainl, 0.001, 23.284
46093750
"
/>
<value
val=
"instrument/L2_curtainl, 0.001, 23.284
5
"
/>
</parameter>
</parameter>
<parameter
name=
"log_L2_curtainr_value"
type=
"string"
>
<parameter
name=
"log_L2_curtainr_value"
type=
"string"
>
<value
val=
"instrument/L2_curtainr, 0.001, 23.2820
1953125
"
/>
<value
val=
"instrument/L2_curtainr, 0.001, 23.2820"
/>
</parameter>
</parameter>
<parameter
name=
"log_L2_curtainu_value"
type=
"string"
>
<parameter
name=
"log_L2_curtainu_value"
type=
"string"
>
<value
val=
"instrument/L2_curtainu, 0.001, 24.286
16015625
"
/>
<value
val=
"instrument/L2_curtainu, 0.001, 24.286
2
"
/>
</parameter>
</parameter>
<parameter
name=
"log_L2_curtaind_value"
type=
"string"
>
<parameter
name=
"log_L2_curtaind_value"
type=
"string"
>
<value
val=
"instrument/L2_curtaind, 0.001, 24.282
35937500
"
/>
<value
val=
"instrument/L2_curtaind, 0.001, 24.282
4
"
/>
</parameter>
</parameter>
<parameter
name=
"log_D_curtainl_value"
type=
"string"
>
<parameter
name=
"log_D_curtainl_value"
type=
"string"
>
...
...
This diff is collapsed.
Click to expand it.
WHITFIELDRE email
@rwp
mentioned in commit
07ddac6b
·
5 years ago
mentioned in commit
07ddac6b
mentioned in commit 07ddac6b5f2794f6e155e0eb06b35eaf3902de71
Toggle commit list
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