This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// detector information can be currently lost in NoQ mode only, when no conversion from detectors position to Q occurs
if(is_detector_info_lost && emode!=-1){
if(TargWSDescription.detInfoLost && emode!=-1){
convert_log.error()<<" Algorithm with ID: "<<the_algID<<" emode: "<<emode<<" request workspace with isntrument and full detectord information attached\n"
<<" but the detector information on input workspace has been lost\n";
throw(std::invalid_argument(" input workspace do not have full detector information attached to it"));
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,is_detInfoLost));
TSM_ASSERT("Det info should be defined for conversion",!is_detInfoLost);
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,TWS));
TSM_ASSERT("Det info should be defined for conversion",!TWS.detInfoLost);
pAx = newAPI::NumericAxis(3);
pAx->setUnit("Wavelength");
ws2D->replaceAxis(0,pAx);
// This is probably bug in conversion --> does not work in elastic mode
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,is_detInfoLost));
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,TWS));
//TSM_ASSERT_THROWS("Can not convert wavelength to momentum transfer in elastic mode ",pAlg->identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units),std::invalid_argument);
TSM_ASSERT("Det info should be defined for conversion",!is_detInfoLost);
TSM_ASSERT("Det info should be defined for conversion",!TWS.detInfoLost);
pAx = newAPI::NumericAxis(3);
pAx->setUnit("Energy");
ws2D->replaceAxis(0,pAx);
// This is probably bug in conversion --> does not work in elastic mode
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,is_detInfoLost));
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,TWS));
// TSM_ASSERT_THROWS("Can not convert Energy to momentum transfer in elastic mode ",pAlg->identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units),std::invalid_argument);
TSM_ASSERT("Det info should be defined for conversion",!is_detInfoLost);
TSM_ASSERT("Det info should be defined for conversion",!TWS.detInfoLost);
pAx = newAPI::NumericAxis(3);
pAx->setUnit("dSpacing");
ws2D->replaceAxis(0,pAx);
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,is_detInfoLost));
TSM_ASSERT("Det info should be defined for conversion",!is_detInfoLost);
TSM_ASSERT_THROWS_NOTHING("Elastic conversion needs X-axis to be in an Energy-related units",params.identifyMatrixAlg(ws2D,"|Q|","Elastic",dim_names,dim_units,TWS));
TSM_ASSERT("Det info should be defined for conversion",!TWS.detInfoLost);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Lighteweith class wrapping together all parameters, related to MDEventoWorkspace description used mainly to reduce number of parameters trasferred between
* an algorithm, creating MD workspace and UI.
/*** Lighteweith class wrapping together all parameters, related to conversion from a workspace to MDEventoWorkspace
* used mainly to reduce number of parameters trasferred between an algorithm, creating a MD workspace and the UI.
*
* It also defines some auxiliary functions, used for convenient description of MD workspace, see below.
/// the variable which describes the number of the dimensions, in the target workspace.
/// Calculated from number of input properties and the operations, performed on input workspace;
size_t nDims;
@@ -65,27 +58,47 @@ namespace MDEvents
std::vector<std::string> dimIDs;
/// the units of target workspace dimensions and properties of input MD workspace dimensions
std::vector<std::string> dimUnits;
/// if defined, specifies number of bins in each dimension
std::vector<size_t> nBins;
/// the swich, specifying if the target Q3D -dimensions should be converted to hkl. Ignored in ModQ and NoQ mode and if no oriented lattice is found in input ws.
bool convert_to_hkl;
/** vectors, which describe the projection plain the target ws is based on (notional coordinate system). The transformation matrix below
/** vectors, which describe the projection plain the target ws is based on (notional or cryst cartezian coordinate system). The transformation matrix below
* should bring the momentums from lab coordinate system into orthogonal, related to u,v vectors, coordinate system */
Kernel::V3D u,v;
/// the matrix to transform momentums of the workspace into target coordinate system, it is constructed from UB matix and W-matrix;
std::vector<double> rotMatrix; // can be Quat if not for non-orthogonal lattices
/// the string which describes subalgorithm, used to convert source ws to target MD ws.
std::string AlgID;
/// the oriented lattice which should be picked up from source ws and be carryed out to target ws. Defined for transfromation from Matrix or Event WS
std::auto_ptr<Geometry::OrientedLattice> pLatt;
/// the matrix transforming Q-coodinates in crystal cartesian coordinate system into target coodinate system.
Kernel::DblMatrix Wtransf;
/// the indicator, informing if the uv plain has been set as a parameter. If they are not, the UB matrix from the source workspace is used uncnanged
bool is_uv_default;
/// the matrix to transform momentums of the workspace into target coordinate system
std::vector<double> rotMatrix; // should it be the Quat?
/// the oriented lattice which should be picked up from source ws and be carryed out to target ws as it can be modified by u,v on the way.
Geometry::OrientedLattice Latt;
/// helper function checks if min values are less them max values and are consistent between each other
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<string>You can to transfer source workspace dimensions into target worskpace directly (NoQ) or transform into mod(Q) (1 dimension) or QxQyQz (3 dimensions) in Q space</string>
<string>You can to transfer source workspace dimensions into target worskpace directly (NoQ) or transform into mod(Q) (1 dimension) or Q3D (3 dimensions) in Q space</string>
</property>
<propertyname="text">
<string>Q Dimensions</string>
@@ -80,7 +80,7 @@
a) 1+N_OtherDimensions if the first dimension (QDimensions property) is equal to |Q| or
b) 3+N_OtherDimensions if the first (3) dimensions (QDimensions property) equal QxQyQz or
b) 3+N_OtherDimensions if the first (3) dimensions (QDimensions property) equal Q3D or
c) (1 or 2)+N_OtherDimesnions if QDimesnins property is empty.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters