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
1bbde4a8
Commit
1bbde4a8
authored
Jan 08, 2016
by
Lynch, Vickie
Browse files
Refs #12863 use convention of workspace for saves
parent
0d4acd88
Changes
7
Hide whitespace changes
Inline
Side-by-side
Framework/API/inc/MantidAPI/IMDWorkspace.h
View file @
1bbde4a8
...
...
@@ -119,6 +119,8 @@ public:
IMDIterator
*
createIterator
(
Mantid
::
Geometry
::
MDImplicitFunction
*
function
=
NULL
)
const
;
std
::
string
getConvention
()
const
;
signal_t
getSignalAtVMD
(
const
Mantid
::
Kernel
::
VMD
&
coords
,
const
Mantid
::
API
::
MDNormalization
&
normalization
=
Mantid
::
API
::
VolumeNormalization
)
const
;
...
...
Framework/API/inc/MantidAPI/IPeaksWorkspace.h
View file @
1bbde4a8
...
...
@@ -64,6 +64,11 @@ public:
*/
virtual
int
getNumberPeaks
()
const
=
0
;
//---------------------------------------------------------------------------------------------
/** @return the number of peaks
*/
virtual
std
::
string
getConvention
()
const
=
0
;
//---------------------------------------------------------------------------------------------
/** Removes the indicated peak
* @param peakNum the peak to remove. peakNum starts at 0
...
...
@@ -155,6 +160,8 @@ public:
peakInfo
(
Kernel
::
V3D
QFrame
,
bool
labCoords
)
const
=
0
;
virtual
int
peakInfoNumber
(
Kernel
::
V3D
qLabFrame
,
bool
labCoords
)
const
=
0
;
std
::
string
convention
;
protected:
/// Protected copy constructor. May be used by childs for cloning.
IPeaksWorkspace
(
const
IPeaksWorkspace
&
other
)
...
...
@@ -165,7 +172,6 @@ protected:
virtual
const
std
::
string
toString
()
const
;
private:
std
::
string
convention
;
virtual
IPeaksWorkspace
*
doClone
()
const
=
0
;
};
}
...
...
Framework/API/src/IMDWorkspace.cpp
View file @
1bbde4a8
...
...
@@ -43,6 +43,11 @@ IMDIterator *IMDWorkspace::createIterator(
return
iterators
[
0
];
}
//---------------------------------------------------------------------------------------------
/** @return the convention
*/
std
::
string
IMDWorkspace
::
getConvention
()
const
{
return
convention
;
}
//-------------------------------------------------------------------------------------------
/** Returns the signal (normalized by volume) at a given coordinates
*
...
...
@@ -91,7 +96,7 @@ const std::string IMDWorkspace::toString() const {
os
<<
"Binned from '"
<<
getOriginalWorkspace
()
->
getName
();
}
os
<<
"
\n
"
;
if
(
c
onvention
==
"Crystallography"
)
if
(
this
->
getC
onvention
()
==
"Crystallography"
)
os
<<
"Crystallography: kf-ki"
;
else
os
<<
"Inelastic: ki-kf"
;
...
...
Framework/Crystal/src/SaveIsawPeaks.cpp
View file @
1bbde4a8
...
...
@@ -250,8 +250,7 @@ void SaveIsawPeaks::exec() {
// HKL's are flipped by -1 because of the internal Q convention
// unless Crystallography convention
double
qSign
=
-
1.0
;
std
::
string
convention
=
ConfigService
::
Instance
().
getString
(
"Q.convention"
);
if
(
convention
==
"Crystallography"
)
if
(
ws
->
getConvention
()
==
"Crystallography"
)
qSign
=
1.0
;
// ============================== Save all Peaks
// =========================================
...
...
Framework/DataObjects/inc/MantidDataObjects/PeaksWorkspace.h
View file @
1bbde4a8
...
...
@@ -102,6 +102,7 @@ public:
void
sort
(
std
::
vector
<
std
::
pair
<
std
::
string
,
bool
>>
&
criteria
);
int
getNumberPeaks
()
const
;
std
::
string
getConvention
()
const
;
void
removePeak
(
int
peakNum
);
void
addPeak
(
const
Geometry
::
IPeak
&
ipeak
);
Peak
&
getPeak
(
int
peakNum
);
...
...
Framework/DataObjects/src/MDBoxFlatTree.cpp
View file @
1bbde4a8
...
...
@@ -752,7 +752,7 @@ void MDBoxFlatTree::saveWSGenericInfo(::NeXus::File *const file,
// Write out the Qconvention
// ki-kf for Inelastic convention; kf-ki for Crystallography convention
std
::
string
m_QConvention
=
Kernel
::
ConfigService
::
Instance
().
getString
(
"Q.c
onvention
"
);
ws
->
getC
onvention
(
);
file
->
putAttr
(
"QConvention"
,
m_QConvention
);
// Write out the set display normalization
...
...
Framework/DataObjects/src/PeaksWorkspace.cpp
View file @
1bbde4a8
...
...
@@ -127,6 +127,11 @@ void PeaksWorkspace::sort(std::vector<std::pair<std::string, bool>> &criteria) {
*/
int
PeaksWorkspace
::
getNumberPeaks
()
const
{
return
int
(
peaks
.
size
());
}
//---------------------------------------------------------------------------------------------
/** @return the convention
*/
std
::
string
PeaksWorkspace
::
getConvention
()
const
{
return
convention
;
}
//---------------------------------------------------------------------------------------------
/** Removes the indicated peak
* @param peakNum the peak to remove. peakNum starts at 0
...
...
@@ -608,8 +613,7 @@ void PeaksWorkspace::saveNexus(::NeXus::File *file) const {
// HKL is flipped by -1 due to different q convention in Crystallography.
// Always write out in ki-kf so consistent with old files
double
qSign
=
1.0
;
std
::
string
convention
=
ConfigService
::
Instance
().
getString
(
"Q.convention"
);
if
(
convention
==
"Crystallography"
)
if
(
this
->
getConvention
()
==
"Crystallography"
)
qSign
=
-
1.0
;
// Populate column vectors from Peak Workspace
...
...
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