Skip to content

Commit

Permalink
third batch refs #7808
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDraper committed Aug 22, 2013
1 parent b62c13f commit 08fd0c5
Show file tree
Hide file tree
Showing 17 changed files with 647 additions and 638 deletions.
5 changes: 0 additions & 5 deletions Code/Mantid/Framework/Crystal/src/SaveIsawUB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ namespace Crystal
else
Volume = lattice.volume();


double xA=cos(latticeParams[3]/180.*M_PI);
double xB=cos(latticeParams[4]/180.*M_PI);
double xC=cos(latticeParams[5]/180.*M_PI);

double dV =0;
for( int i=0;i<3;i++)
{
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/CurveFitting/src/FitPowderDiffPeaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2959,6 +2959,8 @@ namespace CurveFitting
// Calcualte d-spacing
d_h = m_unitCell.d(hkl[0], hkl[1], hkl[2]);
// d_h = calCubicDSpace(latticesize, hkl[0], hkl[1], hkl[2]);
// cppcheck complains about the NaN check
// cppcheck-suppress duplicateExpression
if ( (d_h != d_h) || (d_h < -DBL_MAX) || (d_h > DBL_MAX) )
{
stringstream warnss;
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/CurveFitting/src/SplineBackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void SplineBackground::exec()
{
double Bj = gsl_vector_get(B, j);
gsl_matrix_set(Z, i, j, Bj);
}
}S
}

/* do the fit */
Expand All @@ -161,10 +161,10 @@ void SplineBackground::exec()
API::MatrixWorkspace_sptr outWS = WorkspaceFactory::Instance().create(inWS,1,X.size(),Y.size());
{
outWS->getSpectrum(0)->setSpectrumNo(inWS->getSpectrum(spec)->getSpectrumNo());
double xi, yi, yerr;
double yi, yerr;
for (MantidVec::size_type i=0;i<Y.size();i++)
{
xi = X[i];
double xi = X[i];
gsl_bspline_eval(xi, B, bw);
gsl_multifit_linear_est(B, c, cov, &yi, &yerr);
outWS->dataY(0)[i] = yi;
Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,11 @@ namespace CurveFitting
//iterate over smoothing points
std::set<int>::const_iterator iter = smoothPts.begin();
int start = *iter;
int end(0);
bool accurate(true);

for(++iter; iter != smoothPts.end(); ++iter)
{
end = *iter;
int end = *iter;

//check each point falls within our range of error.
accurate = checkSmoothingAccuracy(start,end,ys.data(),ysmooth.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ namespace CurveFitting
*/
std::complex<double> E1(std::complex<double> z)
{
const double el = 0.5772156649015328;


std::complex<double> exp_e1;

Expand All @@ -755,7 +755,6 @@ namespace CurveFitting
else if (az <= 10.0 || (rz < 0.0 && az < 20.0))
{
// Some interesting region, equal to integrate to infinity, converged
// cout << "[DB] Type 1" << endl;

complex<double> r(1.0, 0.0);
exp_e1 = r;
Expand All @@ -773,8 +772,7 @@ namespace CurveFitting
}
} // ENDFOR k

// cout << "[DB] el = " << el << ", exp_e1 = " << exp_e1 << endl;

const double el = 0.5772156649015328;
exp_e1 = -el - log(z) + (z*exp_e1);
}
else
Expand All @@ -796,7 +794,6 @@ namespace CurveFitting
}
}

// cout << "[DB] Final exp_e1 = " << exp_e1 << "\n";

return exp_e1;
}
Expand Down
5 changes: 2 additions & 3 deletions Code/Mantid/Framework/DataHandling/src/FindDetectorsPar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_const_sptr spDet,cons
double d1_max(-FLT_MAX);
double d1_sum(0);
double dist_sum(0);
double d_azim(0);


std::vector<Kernel::V3D> coord(3);
Expand All @@ -248,7 +247,7 @@ FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_const_sptr spDet,cons
coord[1] = (GroupCenter-Observer);
double d0 = coord[1].norm();
coord[1] /= d0;
// access contribured detectors;
// access contributed detectors;
Geometry::DetectorGroup_const_sptr pDetGroup = boost::dynamic_pointer_cast<const Geometry::DetectorGroup>(spDet);
if(!pDetGroup){
g_log.error()<<"calc_cylDetPar: can not downcast IDetector_sptr to detector group for det->ID: "<<spDet->getID()<<std::endl;
Expand All @@ -272,7 +271,7 @@ FindDetectorsPar::calc_cylDetPar(const Geometry::IDetector_const_sptr spDet,cons

double d_min = d1+bbox.xMin(); if(d_min<d1_min)d1_min = d_min;
double d_max = d1+bbox.xMax(); if(d_max>d1_max)d1_max = d_max;
d_azim = (bbox.zMax()-bbox.zMin())/d1;
double d_azim = (bbox.zMax()-bbox.zMin())/d1;
azim_width+=d_azim;

d1_sum +=d1;
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataHandling/src/GroupDetectors2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,9 @@ void GroupDetectors2::RangeHelper::getList(const std::string &line, std::vector<
}
Poco::StringTokenizer ranges(line, "-");

size_t loop = 0;
try
{
size_t loop = 0;
do
{
Poco::StringTokenizer beforeHyphen(ranges[loop], " ", IGNORE_SPACES);
Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadDAE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ namespace Mantid
boost::shared_array<int> udet(new int[ndet]);
dims_array[0] = ndet;
sv_ndims = 1;
int res = 0;
if ((res = IDCgetpari(dae_handle, "UDET", udet.get(), dims_array, &sv_ndims)) != 0)
if (IDCgetpari(dae_handle, "UDET", udet.get(), dims_array, &sv_ndims) != 0)
{
g_log.error("Unable to read detector information (UDET) from DAE " + m_daename);
}
Expand Down
18 changes: 8 additions & 10 deletions Code/Mantid/Framework/DataHandling/src/LoadGSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,8 @@ namespace Mantid
std::string wsTitle;
std::string slogTitle;
std::string instrumentname = "Generic";
bool slogtitleset = false;
char filetype = 'x';

int nSpec = 0;
bool calslogx0 = true;
double bc4 = 0;
double bc3 = 0;

bool db1 = true;

bool multiplybybinwidth = false;

std::ifstream input(filename.c_str(), std::ios_base::in);

// Gather data
Expand All @@ -153,6 +143,14 @@ namespace Mantid

// 2. Loop all the lines
bool isOutOfHead = false;
bool slogtitleset = false;
bool multiplybybinwidth = false;
bool db1 = true;
int nSpec = 0;
bool calslogx0 = true;
double bc4 = 0;
double bc3 = 0;

while (!input.eof() && input.getline(currentLine, 256))
{

Expand Down
Loading

0 comments on commit 08fd0c5

Please sign in to comment.