Skip to content

Commit

Permalink
Refs #8208 option to use lattice constants
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Dec 12, 2013
1 parent 15c7c79 commit 3bd9707
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions Code/Mantid/Framework/Crystal/src/SCDCalibratePanels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ To do so select the workspace, which you have calibrated as the InputWorkspace a
#include "MantidAPI/IFunction.h"
#include "MantidGeometry/Instrument/RectangularDetector.h"
#include "MantidGeometry/Crystal/IndexingUtils.h"
#include "MantidGeometry/Crystal/OrientedLattice.h"

using namespace Mantid::DataObjects;
using namespace Mantid::API;
Expand Down Expand Up @@ -669,7 +670,17 @@ namespace Mantid
double alpha = getProperty("alpha");
double beta = getProperty("beta");
double gamma = getProperty("gamma");

if ((a == EMPTY_DBL() || b == EMPTY_DBL() || c == EMPTY_DBL() || alpha == EMPTY_DBL() ||
beta == EMPTY_DBL() || gamma == EMPTY_DBL()) && peaksWs->sample().hasOrientedLattice())
{
OrientedLattice latt = peaksWs->mutableSample().getOrientedLattice();
a = latt.a();
b = latt.b();
c = latt.c();
alpha = latt.alpha();
beta = latt.beta();
gamma = latt.gamma();
}
double tolerance = getProperty("tolerance");

if( !GoodStart( peaksWs, a,b,c,alpha,beta,gamma,tolerance))
Expand Down Expand Up @@ -1371,12 +1382,12 @@ namespace Mantid
auto mustBePositive = boost::make_shared<BoundedValidator<double> >();
mustBePositive->setLower(0.0);

declareProperty("a", 0.0, mustBePositive, "Lattice Parameter a");
declareProperty("b", 0.0, mustBePositive, "Lattice Parameter b");
declareProperty("c", 0.0, mustBePositive, "Lattice Parameter c");
declareProperty("alpha", 0.0, mustBePositive, "Lattice Parameter alpha in degrees");
declareProperty("beta", 0.0, mustBePositive, "Lattice Parameter beta in degrees");
declareProperty("gamma", 0.0, mustBePositive, "Lattice Parameter gamma in degrees");
declareProperty("a", EMPTY_DBL(), mustBePositive, "Lattice Parameter a (Leave empty to use lattice constants in peaks workspace)");
declareProperty("b", EMPTY_DBL(), mustBePositive, "Lattice Parameter b (Leave empty to use lattice constants in peaks workspace)");
declareProperty("c", EMPTY_DBL(), mustBePositive, "Lattice Parameter c (Leave empty to use lattice constants in peaks workspace)");
declareProperty("alpha", EMPTY_DBL(), mustBePositive, "Lattice Parameter alpha in degrees (Leave empty to use lattice constants in peaks workspace)");
declareProperty("beta", EMPTY_DBL(), mustBePositive, "Lattice Parameter beta in degrees (Leave empty to use lattice constants in peaks workspace)");
declareProperty("gamma", EMPTY_DBL(), mustBePositive, "Lattice Parameter gamma in degrees (Leave empty to use lattice constants in peaks workspace)");

declareProperty("useL0", true, "Fit the L0(source to sample) distance");
declareProperty("usetimeOffset", true, "Fit the time offset value");
Expand Down

0 comments on commit 3bd9707

Please sign in to comment.