Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
a3824d25
Commit
a3824d25
authored
Nov 03, 2015
by
Owen Arnold
Browse files
refs #14124. Start fixing up DataHandling.
parent
5d01e8de
Changes
35
Hide whitespace changes
Inline
Side-by-side
Framework/Algorithms/test/ConvertUnitsTest.h
View file @
a3824d25
...
...
@@ -62,7 +62,8 @@ public:
"HET_Definition.xml"
;
loader
.
setPropertyValue
(
"Filename"
,
inputFile
);
loader
.
setPropertyValue
(
"Workspace"
,
this
->
inputSpace
);
loader
.
setProperty
(
"RewriteSpectraMap"
,
false
);
loader
.
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loader
.
execute
();
}
...
...
Framework/Crystal/src/LoadIsawSpectrum.cpp
View file @
a3824d25
...
...
@@ -298,7 +298,8 @@ LoadIsawSpectrum::getInstrument3Ways(Algorithm *alg) {
childAlg
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
tempWS
);
childAlg
->
setPropertyValue
(
"Filename"
,
InstrumentFilename
);
childAlg
->
setPropertyValue
(
"InstrumentName"
,
InstrumentName
);
childAlg
->
setProperty
(
"RewriteSpectraMap"
,
false
);
childAlg
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
childAlg
->
executeAsChildAlg
();
inst
=
tempWS
->
getInstrument
();
}
...
...
Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
View file @
a3824d25
...
...
@@ -378,7 +378,8 @@ bool LoadEventNexus::runLoadInstrument(const std::string &nexusfilename,
loadInst
->
setPropertyValue
(
"InstrumentName"
,
instrument
);
loadInst
->
setProperty
<
Mantid
::
API
::
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"RewriteSpectraMap"
,
false
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loadInst
->
execute
();
// Populate the instrument parameters in this workspace - this works around
...
...
Framework/DataHandling/src/AppendGeometryToSNSNexus.cpp
View file @
a3824d25
...
...
@@ -360,7 +360,7 @@ bool AppendGeometryToSNSNexus::runLoadInstrument(
try
{
loadInst
->
setPropertyValue
(
"Filename"
,
idf_filename
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"
Re
writeSpectraMap"
,
false
);
loadInst
->
setProperty
(
"
Over
writeSpectraMap"
,
OptionalBool
(
false
)
)
;
loadInst
->
execute
();
}
catch
(
std
::
invalid_argument
&
e
)
{
alg
->
getLogger
().
information
(
...
...
Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
View file @
a3824d25
#include
"MantidKernel/OptionalBool.h"
#include
"MantidAPI/FileProperty.h"
#include
"MantidAPI/MatrixWorkspace.h"
#include
"MantidAPI/ITableWorkspace.h"
...
...
@@ -375,6 +376,8 @@ Instrument_const_sptr CreateChunkingFromInstrument::getInstrument() {
childAlg
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
tempWS
);
childAlg
->
setPropertyValue
(
"Filename"
,
instFilename
);
childAlg
->
setPropertyValue
(
"InstrumentName"
,
instName
);
childAlg
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
true
));
childAlg
->
executeAsChildAlg
();
return
tempWS
->
getInstrument
();
}
...
...
Framework/DataHandling/src/CreateSimulationWorkspace.cpp
View file @
a3824d25
...
...
@@ -5,6 +5,7 @@
#include
"MantidKernel/ArrayProperty.h"
#include
"MantidKernel/ListValidator.h"
#include
"MantidKernel/MandatoryValidator.h"
#include
"MantidKernel/OptionalBool.h"
#include
"MantidKernel/RebinParamsValidator.h"
#include
"MantidKernel/UnitFactory.h"
#include
"MantidKernel/VectorHelper.h"
...
...
@@ -103,6 +104,8 @@ void CreateSimulationWorkspace::createInstrument() {
}
else
{
loadInstrument
->
setPropertyValue
(
"InstrumentName"
,
instrProp
);
}
loadInstrument
->
setProperty
(
"OverwriteSpectraMap"
,
Kernel
::
OptionalBool
(
true
));
loadInstrument
->
executeAsChildAlg
();
tempWS
=
loadInstrument
->
getProperty
(
"Workspace"
);
...
...
Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
View file @
a3824d25
...
...
@@ -803,7 +803,8 @@ void FilterEventsByLogValuePreNexus::runLoadInstrument(
// Now execute the Child Algorithm. Catch and log any error, but don't stop.
loadInst
->
setPropertyValue
(
"InstrumentName"
,
instrument
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"RewriteSpectraMap"
,
false
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loadInst
->
executeAsChildAlg
();
// Populate the instrument parameters in this workspace - this works around a
...
...
Framework/DataHandling/src/LoadBBY.cpp
View file @
a3824d25
...
...
@@ -404,7 +404,8 @@ void LoadBBY::exec() {
createChildAlgorithm
(
"LoadInstrument"
);
loadInstrumentAlg
->
setProperty
(
"Workspace"
,
eventWS
);
loadInstrumentAlg
->
setPropertyValue
(
"InstrumentName"
,
"BILBY"
);
loadInstrumentAlg
->
setProperty
(
"RewriteSpectraMap"
,
false
);
loadInstrumentAlg
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loadInstrumentAlg
->
executeAsChildAlg
();
setProperty
(
"OutputWorkspace"
,
eventWS
);
...
...
Framework/DataHandling/src/LoadCalFile.cpp
View file @
a3824d25
...
...
@@ -115,7 +115,8 @@ LoadCalFile::getInstrument3Ways(Algorithm *alg) {
childAlg
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
tempWS
);
childAlg
->
setPropertyValue
(
"Filename"
,
InstrumentFilename
);
childAlg
->
setPropertyValue
(
"InstrumentName"
,
InstrumentName
);
childAlg
->
setProperty
(
"RewriteSpectraMap"
,
false
);
childAlg
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
childAlg
->
executeAsChildAlg
();
inst
=
tempWS
->
getInstrument
();
}
...
...
Framework/DataHandling/src/LoadCanSAS1D.cpp
View file @
a3824d25
...
...
@@ -301,6 +301,8 @@ void LoadCanSAS1D::runLoadInstrument(const std::string &inst_name,
loadInst
->
setPropertyValue
(
"InstrumentName"
,
inst_name
);
loadInst
->
setProperty
<
API
::
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
true
));
loadInst
->
execute
();
}
catch
(
std
::
invalid_argument
&
)
{
g_log
.
information
(
"Invalid argument to LoadInstrument Child Algorithm"
);
...
...
Framework/DataHandling/src/LoadDetectorsGroupingFile.cpp
View file @
a3824d25
...
...
@@ -98,7 +98,8 @@ void LoadDetectorsGroupingFile::exec() {
MatrixWorkspace_sptr
tempWS
(
new
DataObjects
::
Workspace2D
());
childAlg
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
tempWS
);
childAlg
->
setPropertyValue
(
"Filename"
,
instrumentFilename
);
childAlg
->
setProperty
(
"RewriteSpectraMap"
,
false
);
childAlg
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
childAlg
->
executeAsChildAlg
();
m_instrument
=
tempWS
->
getInstrument
();
}
...
...
Framework/DataHandling/src/LoadDiffCal.cpp
View file @
a3824d25
...
...
@@ -252,7 +252,8 @@ void LoadDiffCal::getInstrument(H5File &file) {
}
else
{
childAlg
->
setPropertyValue
(
"Filename"
,
idf
);
}
childAlg
->
setProperty
(
"RewriteSpectraMap"
,
false
);
childAlg
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
childAlg
->
executeAsChildAlg
();
m_instrument
=
tempWS
->
getInstrument
();
...
...
Framework/DataHandling/src/LoadEmptyInstrument.cpp
View file @
a3824d25
...
...
@@ -173,6 +173,7 @@ API::MatrixWorkspace_sptr LoadEmptyInstrument::runLoadInstrument() {
IAlgorithm_sptr
loadInst
=
createChildAlgorithm
(
"LoadInstrument"
,
0
,
1
);
loadInst
->
setPropertyValue
(
"Filename"
,
fullPathIDF
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
OptionalBool
(
true
));
MatrixWorkspace_sptr
ws
=
WorkspaceFactory
::
Instance
().
create
(
"Workspace2D"
,
1
,
2
,
1
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
ws
);
...
...
Framework/DataHandling/src/LoadEventPreNexus.cpp
View file @
a3824d25
...
...
@@ -383,7 +383,8 @@ void LoadEventPreNexus::runLoadInstrument(const std::string &eventfilename,
// Now execute the Child Algorithm. Catch and log any error, but don't stop.
loadInst
->
setPropertyValue
(
"InstrumentName"
,
instrument
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"RewriteSpectraMap"
,
false
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loadInst
->
executeAsChildAlg
();
// Populate the instrument parameters in this workspace - this works around a
...
...
Framework/DataHandling/src/LoadEventPreNexus2.cpp
View file @
a3824d25
...
...
@@ -631,7 +631,8 @@ void LoadEventPreNexus2::runLoadInstrument(
// Now execute the Child Algorithm. Catch and log any error, but don't stop.
loadInst
->
setPropertyValue
(
"InstrumentName"
,
instrument
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"RewriteSpectraMap"
,
false
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loadInst
->
executeAsChildAlg
();
// Populate the instrument parameters in this workspace - this works around a
...
...
Framework/DataHandling/src/LoadILL.cpp
View file @
a3824d25
...
...
@@ -604,6 +604,8 @@ void LoadILL::runLoadInstrument() {
try
{
loadInst
->
setPropertyValue
(
"InstrumentName"
,
m_instrumentName
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
m_localWorkspace
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
true
));
loadInst
->
execute
();
}
catch
(...)
{
g_log
.
information
(
"Cannot load the instrument definition."
);
...
...
Framework/DataHandling/src/LoadILLReflectometry.cpp
View file @
a3824d25
...
...
@@ -102,6 +102,8 @@ void LoadILLReflectometry::runLoadInstrument() {
try
{
loadInst
->
setPropertyValue
(
"InstrumentName"
,
m_instrumentName
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
true
));
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
m_localWorkspace
);
loadInst
->
execute
();
...
...
Framework/DataHandling/src/LoadILLSANS.cpp
View file @
a3824d25
...
...
@@ -408,6 +408,8 @@ void LoadILLSANS::runLoadInstrument() {
try
{
loadInst
->
setPropertyValue
(
"InstrumentName"
,
m_instrumentName
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
m_localWorkspace
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
true
));
loadInst
->
execute
();
}
catch
(...)
{
g_log
.
information
(
"Cannot load the instrument definition."
);
...
...
Framework/DataHandling/src/LoadISISNexus2.cpp
View file @
a3824d25
...
...
@@ -886,7 +886,8 @@ void LoadISISNexus2::runLoadInstrument(
try
{
loadInst
->
setPropertyValue
(
"InstrumentName"
,
m_instrument_name
);
loadInst
->
setProperty
<
MatrixWorkspace_sptr
>
(
"Workspace"
,
localWorkspace
);
loadInst
->
setProperty
(
"RewriteSpectraMap"
,
false
);
loadInst
->
setProperty
(
"OverwriteSpectraMap"
,
Mantid
::
Kernel
::
OptionalBool
(
false
));
loadInst
->
execute
();
}
catch
(
std
::
invalid_argument
&
)
{
g_log
.
information
(
"Invalid argument to LoadInstrument Child Algorithm"
);
...
...
Framework/DataHandling/src/LoadInstrument.cpp
View file @
a3824d25
...
...
@@ -197,8 +197,8 @@ void LoadInstrument::exec() {
// Rebuild the spectra map for this workspace so that it matches the
// instrument
// if required
const
OptionalBool
r
e
writeSpectraMap
=
getProperty
(
"OverwriteSpectraMap"
);
if
(
r
e
writeSpectraMap
==
OptionalBool
::
True
)
const
OptionalBool
Ove
rwriteSpectraMap
=
getProperty
(
"OverwriteSpectraMap"
);
if
(
Ove
rwriteSpectraMap
==
OptionalBool
::
True
)
m_workspace
->
rebuildSpectraMapping
();
}
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment