Skip to content

Commit

Permalink
Refs #5772. Tweaked code to get edge peaks integrated better
Browse files Browse the repository at this point in the history
  • Loading branch information
RuthFromDuluth committed Nov 24, 2012
1 parent 82b12bd commit 4d5e023
Show file tree
Hide file tree
Showing 7 changed files with 683 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ namespace Crystal
this->time=time;
}

void setStatBase(std::vector<double> const &StatBase );
//Returns true if "Edge Peak" otherwise returns false
bool setStatBase(std::vector<double> const &StatBase );

bool isEdgePeak( double* params, int nparams);


void setHeighHalfWidthInfo( Mantid::MantidVecPtr &xvals,
Mantid::MantidVecPtr &yvals,Mantid::MantidVecPtr &counts,
Expand Down Expand Up @@ -186,10 +190,12 @@ namespace Crystal

bool CalcVariances( );


std::vector<double>GetParams( double background);

double StatBaseVals( int index)
{
if( index < 0 || index >= (int)StatBase.size() )
return 0.0;
return StatBase[index];
}

Expand All @@ -199,7 +205,7 @@ namespace Crystal

double CalcSampleIntensityMultiplier( const double* params) const;


std::vector<double> InitValues( double Varx,double Vary,double b);
double baseRCRadius;
double lastRCRadius;
double HalfWidthAtHalfHeightRadius;
Expand All @@ -211,6 +217,7 @@ namespace Crystal
double CellWidth;
double CellHeight;

double VarxHW, VaryHW;
double currentRadius;
Kernel::V3D currentPosition;
std::vector<double> StatBase;
Expand Down Expand Up @@ -247,6 +254,8 @@ namespace Crystal
HalfWidthAtHalfHeightRadius = -1;
case4 = false;

VarxHW = -1;
VaryHW = -1;
back_calc = Intensity_calc = row_calc =
col_calc = Vx_calc = Vy_calc = Vxy_calc = -1;
}
Expand Down Expand Up @@ -356,10 +365,20 @@ class DLLExport IntegratePeakTimeSlices: public Mantid::API::Algorithm
std::string &spec_idList

) ;
void Fit(API::MatrixWorkspace_sptr &Data,double &chisq, bool &done,

/**
* Tests several starting points in the Marquardt algorithm then calls Fit.
*/
void PreFit(API::MatrixWorkspace_sptr &Data,double &chisq, bool &done,
std::vector<std::string>&names, std::vector<double>&params,
std::vector<double>&errs,double lastRow,double lastCol,double neighborRadius);


void Fit(API::MatrixWorkspace_sptr &Data,double &chisq, bool &done,
std::vector<std::string>&names, std::vector<double>&params,
std::vector<double>&errs,
double lastRow,double lastCol,double neighborRadius);

std::string CalculateFunctionProperty_Fit( ) ;

bool isGoodFit( std::vector<double > const & params,
Expand Down

0 comments on commit 4d5e023

Please sign in to comment.