From 7107ec9edc630d67a06536aec6b75795d4f88f5c Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 1 Dec 2014 12:25:38 +0000 Subject: [PATCH] Use _ann_ naming for annulus, support on apply corr Refs #10641 --- .../MantidQtCustomInterfaces/IndirectDataAnalysis.ui | 5 +++++ .../Mantid/MantidQt/CustomInterfaces/src/ApplyCorr.cpp | 10 ++++++++++ Code/Mantid/MantidQt/CustomInterfaces/src/CalcCorr.cpp | 10 +++++++--- Code/Mantid/scripts/Inelastic/IndirectAbsCor.py | 4 ++-- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui index 31cf2e650fb7..4d5805d370ee 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui @@ -2469,6 +2469,11 @@ Flat + + + Annulus + + Cylinder diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/ApplyCorr.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/ApplyCorr.cpp index 3586c5c5acfe..c96b23499ac2 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/ApplyCorr.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/ApplyCorr.cpp @@ -131,6 +131,10 @@ namespace IDA { geom = "cyl"; } + else if ( geom == "Annulus" ) + { + geom = "ann"; + } QString pyInput = "from IndirectDataAnalysis import abscorFeeder, loadNexus\n"; @@ -284,6 +288,12 @@ namespace IDA uiForm().abscor_dsCorrections->setFBSuffixes(QStringList(ext + ".nxs")); break; case 1: + // Geomtry is annulus + ext = "_ann_Abs"; + uiForm().abscor_dsCorrections->setWSSuffixes(QStringList(ext)); + uiForm().abscor_dsCorrections->setFBSuffixes(QStringList(ext + ".nxs")); + break; + case 2: // Geomtry is cylinder ext = "_cyl_Abs"; uiForm().abscor_dsCorrections->setWSSuffixes(QStringList(ext)); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/CalcCorr.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/CalcCorr.cpp index 608bba70a05a..5f5946fd9786 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/CalcCorr.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/CalcCorr.cpp @@ -180,7 +180,7 @@ namespace IDA } else if ( uiForm().absp_cbShape->currentText() == "Annulus" ) { - geom = "cyl"; + geom = "ann"; // R3 only populated when using can. R4 is fixed to 0.0 if ( uiForm().absp_ckUseCan->isChecked() ) @@ -437,8 +437,12 @@ namespace IDA void CalcCorr::shape(int index) { // Meaning of the "avar" variable changes depending on shape selection - if ( index == 0 ) { uiForm().absp_lbAvar->setText("Sample Angle:"); } - else if ( index == 1 ) { uiForm().absp_lbAvar->setText("Step Size:"); } + if(index == 0) + // For Flat + uiForm().absp_lbAvar->setText("Sample Angle:"); + else + // For Annulus and CYlinder + uiForm().absp_lbAvar->setText("Step Size:"); // Radius 2 is not used for annulus uiForm().absp_ler2->setEnabled(index != 2); diff --git a/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py b/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py index 8a930356a4a6..3e58664f93cd 100644 --- a/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py +++ b/Code/Mantid/scripts/Inelastic/IndirectAbsCor.py @@ -144,8 +144,8 @@ def AbsRun(inputWS, geom, beam, ncan, size, density, sigs, siga, avar, Verbose, (A1,A2,A3,A4) = FlatAbs(ncan, size, density, sigs, siga, angles, waves) kill = 0 - #geometry is a cylinder - elif geom == 'cyl': + #geometry is an annulus or cylinder + elif geom == 'cyl' or geom == 'ann': astep = avar if (astep) < 1e-5: error = 'Step size is zero'