Skip to content

Commit

Permalink
Re #6151 Tiny fixes to API2 reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Dec 7, 2012
1 parent fa22af8 commit 80b7fd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Code/Mantid/Framework/WorkflowAlgorithms/src/SetupHFIRReduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,13 @@ void SetupHFIRReduction::exec()
const std::string centerMethod = getPropertyValue("BeamCenterMethod");

// Beam center option for transmission data
if (boost::iequals(centerMethod, "Value") && !isEmpty(beamCenterX) && !isEmpty(beamCenterY))
if (boost::iequals(centerMethod, "Value"))
{
reductionManager->declareProperty(new PropertyWithValue<double>("LatestBeamCenterX", beamCenterX) );
reductionManager->declareProperty(new PropertyWithValue<double>("LatestBeamCenterY", beamCenterY) );
if(!isEmpty(beamCenterX) && !isEmpty(beamCenterY))
{
reductionManager->declareProperty(new PropertyWithValue<double>("LatestBeamCenterX", beamCenterX) );
reductionManager->declareProperty(new PropertyWithValue<double>("LatestBeamCenterY", beamCenterY) );
}
}
else if (!boost::iequals(centerMethod, "None"))
{
Expand Down Expand Up @@ -605,12 +608,14 @@ void SetupHFIRReduction::setupSensitivity(boost::shared_ptr<PropertyManager> red

// Beam center option for sensitivity data
const std::string centerMethod = getPropertyValue("SensitivityBeamCenterMethod");
if (boost::iequals(centerMethod, "Value") &&
!isEmpty(sensitivityBeamCenterX) &&
!isEmpty(sensitivityBeamCenterY))
if (boost::iequals(centerMethod, "Value"))
{
effAlg->setProperty("BeamCenterX", sensitivityBeamCenterX);
effAlg->setProperty("BeamCenterY", sensitivityBeamCenterY);
if (!isEmpty(sensitivityBeamCenterX) &&
!isEmpty(sensitivityBeamCenterY))
{
effAlg->setProperty("BeamCenterX", sensitivityBeamCenterX);
effAlg->setProperty("BeamCenterY", sensitivityBeamCenterY);
}
}
else if (boost::iequals(centerMethod, "DirectBeam") ||
boost::iequals(centerMethod, "Scattering"))
Expand All @@ -632,7 +637,7 @@ void SetupHFIRReduction::setupSensitivity(boost::shared_ptr<PropertyManager> red
algProp->setValue(ctrAlg->toString());
reductionManager->declareProperty(algProp);
} else {
g_log.error() << "ERROR: Beam center determination was required"
g_log.error() << "ERROR: Sensitivity beam center determination was required"
" but no file was provided" << std::endl;
}
}
Expand Down Expand Up @@ -813,7 +818,7 @@ void SetupHFIRReduction::setupTransmission(boost::shared_ptr<PropertyManager> re
algProp->setValue(ctrAlg->toString());
reductionManager->declareProperty(algProp);
} else {
g_log.error() << "ERROR: Beam center determination was required"
g_log.error() << "ERROR: Transmission beam center determination was required"
" but no file was provided" << std::endl;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def NoTransmission():
del ReductionSingleton().reduction_properties["ThetaDependentTransmission"]

def SetTransmission(trans, error, theta_dependent=True):
ReductionSingleton().reduction_properties["TransmissionMethod"] = "Value"
ReductionSingleton().reduction_properties["TransmissionValue"] = trans
ReductionSingleton().reduction_properties["TransmissionError"] = error
ReductionSingleton().reduction_properties["ThetaDependentTransmission"] = theta_dependent
Expand Down Expand Up @@ -229,6 +230,7 @@ def NoBckTransmission():
del ReductionSingleton().reduction_properties["BckThetaDependentTransmission"]

def SetBckTransmission(trans, error, theta_dependent=True):
ReductionSingleton().reduction_properties["BckTransmissionMethod"] = "Value"
ReductionSingleton().reduction_properties["BckTransmissionValue"] = trans
ReductionSingleton().reduction_properties["BckTransmissionError"] = error
ReductionSingleton().reduction_properties["BckThetaDependentTransmission"] = theta_dependent
Expand Down

0 comments on commit 80b7fd5

Please sign in to comment.