Skip to content
Snippets Groups Projects
Commit 0270fa09 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Change order of operations to allow RemovePromptPulse to be skipped

parent 0de4192a
No related branches found
No related tags found
No related merge requests found
......@@ -365,23 +365,7 @@ void AlignAndFocusPowder::exec() {
// set up a progress bar with the "correct" number of steps
m_progress = new Progress(this, 0., 1., 22);
// filter the input events if appropriate
if (m_inputEW) {
double removePromptPulseWidth = getProperty("RemovePromptPulseWidth");
if (removePromptPulseWidth > 0.) {
g_log.information() << "running RemovePromptPulse(Width="
<< removePromptPulseWidth << ")\n";
API::IAlgorithm_sptr filterPAlg =
createChildAlgorithm("RemovePromptPulse");
filterPAlg->setProperty("InputWorkspace", m_outputW);
filterPAlg->setProperty("OutputWorkspace", m_outputW);
filterPAlg->setProperty("Width", removePromptPulseWidth);
filterPAlg->executeAsChildAlg();
m_outputW = filterPAlg->getProperty("OutputWorkspace");
m_outputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_outputW);
}
m_progress->report();
double tolerance = getProperty("CompressTolerance");
if (tolerance > 0.) {
g_log.information() << "running CompressEvents(Tolerance=" << tolerance
......@@ -398,10 +382,8 @@ void AlignAndFocusPowder::exec() {
g_log.information() << "Not compressing event list\n";
doSortEvents(m_outputW); // still sort to help some thing out
}
m_progress->report();
} else {
m_progress->reportIncrement(2);
}
m_progress->report();
if (xmin > 0. || xmax > 0.) {
bool doCorrection(true);
......@@ -414,8 +396,8 @@ void AlignAndFocusPowder::exec() {
double tempmax;
m_outputW->getXMinMax(tempmin, tempmax);
g_log.information() << "running CropWorkspace(Xmin=" << xmin
<< ", Xmax=" << xmax << ")\n";
g_log.information() << "running CropWorkspace(TOFmin=" << xmin
<< ", TOFmax=" << xmax << ")\n";
API::IAlgorithm_sptr cropAlg = createChildAlgorithm("CropWorkspace");
cropAlg->setProperty("InputWorkspace", m_outputW);
cropAlg->setProperty("OutputWorkspace", m_outputW);
......@@ -425,10 +407,27 @@ void AlignAndFocusPowder::exec() {
cropAlg->setProperty("Xmax", xmax);
cropAlg->executeAsChildAlg();
m_outputW = cropAlg->getProperty("OutputWorkspace");
m_outputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_outputW);
}
}
m_progress->report();
// filter the input events if appropriate
double removePromptPulseWidth = getProperty("RemovePromptPulseWidth");
if (removePromptPulseWidth > 0.) {
g_log.information() << "running RemovePromptPulse(Width="
<< removePromptPulseWidth << ")\n";
API::IAlgorithm_sptr filterPAlg =
createChildAlgorithm("RemovePromptPulse");
filterPAlg->setProperty("InputWorkspace", m_outputW);
filterPAlg->setProperty("OutputWorkspace", m_outputW);
filterPAlg->setProperty("Width", removePromptPulseWidth);
filterPAlg->executeAsChildAlg();
m_outputW = filterPAlg->getProperty("OutputWorkspace");
m_outputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_outputW);
}
m_progress->report();
if (maskBinTableWS) {
g_log.information() << "running MaskBinsFromTable\n";
API::IAlgorithm_sptr alg = createChildAlgorithm("MaskBinsFromTable");
......@@ -437,6 +436,7 @@ void AlignAndFocusPowder::exec() {
alg->setProperty("MaskingInformation", maskBinTableWS);
alg->executeAsChildAlg();
m_outputW = alg->getProperty("OutputWorkspace");
m_outputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_outputW);
}
m_progress->report();
......@@ -448,6 +448,7 @@ void AlignAndFocusPowder::exec() {
maskAlg->executeAsChildAlg();
Workspace_sptr tmpW = maskAlg->getProperty("Workspace");
m_outputW = boost::dynamic_pointer_cast<MatrixWorkspace>(tmpW);
m_outputEW = boost::dynamic_pointer_cast<EventWorkspace>(m_outputW);
}
m_progress->report();
......
......@@ -13,9 +13,9 @@ This is a workflow algorithm that does the bulk of the work for time
focusing diffraction data. This is done by executing several
sub-algorithms as listed below.
#. :ref:`algm-RemovePromptPulse` (event workspace only)
#. :ref:`algm-CompressEvents` (event workspace only)
#. :ref:`algm-CropWorkspace`
#. :ref:`algm-RemovePromptPulse`
#. :ref:`algm-MaskDetectors`
#. :ref:`algm-Rebin` or :ref:`algm-ResampleX` if not d-space binning
#. :ref:`algm-AlignDetectors`
......@@ -51,9 +51,9 @@ and
You will have to rename :literal:`pg3_mantid_det.cal` manually, as its name in the link above is a list of random characters.
.. code-block:: python
PG3_9830_event = Load('PG3_9830_event.nxs')
PG3_9830_event = AlignAndFocusPowder(PG3_9830_event,
PG3_9830_event = AlignAndFocusPowder(PG3_9830_event,
CalFileName='pg3_mantid_det.cal', Params='100')
......
......@@ -52,16 +52,18 @@ digraph AlignAndFocusPowder {
InputWorkspace -> isEventWorkspace1
isEventWorkspace1 -> removePromptPulse [label="Yes"]
RemovePromptPulseWidth -> removePromptPulse
removePromptPulse -> compressEvents
isEventWorkspace1 -> compressEvents [label="Yes"]
CompressTolerance -> compressEvents
compressEvents -> cropWorkspace
isEventWorkspace1 -> cropWorkspace [label="No"]
CropWaveLengthMin -> cropWorkspace
cropWorkspace -> removePromptPulse
RemovePromptPulseWidth -> removePromptPulse
cropWorkspace -> maskDetectors
removePromptPulse -> maskDetectors
MaskWorkspace -> maskDetectors
maskDetectors -> isDspace1
isDspace1 -> resampleX [label="Yes"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment