Logo Search packages:      
Sourcecode: objcryst-fox version File versions  Download package

ObjCryst::PowderPattern Class Reference

#include <PowderPattern.h>

Inheritance diagram for ObjCryst::PowderPattern:

ObjCryst::RefinableObj

List of all members.


Detailed Description

Powder pattern class, with an observed pattern and several calculated components to modelize the pattern.

This can also be used for simulation, using a fake Iobs. Supports multiple phases.

Definition at line 482 of file PowderPattern.h.


Public Member Functions

void AddExcludedRegion (const REAL min2Theta, const REAL max2theta)
void AddPar (RefinableObj &newRefParList, const bool copyParam=false)
void AddPar (RefinablePar *newRefPar)
void AddPar (const RefinablePar &newRefPar)
void AddPowderPatternComponent (PowderPatternComponent &)
void AddRestraint (Restraint *pNewRestraint)
void BeginGlobalOptRandomMove ()
virtual void BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false)
void ClearParamSet (const unsigned long id) const
 Erase the param set with the given id, releasing memory.
unsigned long CreateParamSet (const string name="") const
 Save the current set of refined values in a new set.
virtual void DeRegisterClient (RefinableObj &) const
 Deregister an object (which not any more) using this object.
virtual void EndOptimization ()
const void EraseAllParamSet ()
 Erase all saved refpar sets.
void ExportFullprof (const std::string &prefix) const
PeakList FindPeaks (const float dmin=2.0, const float maxratio=0.01, const unsigned int maxpeak=100)
 Find peaks in the pattern.
void FitScaleFactorForIntegratedR () const
void FitScaleFactorForIntegratedRw () const
void FitScaleFactorForR () const
 Fit the scale(s) factor of each component to minimize R.
void FitScaleFactorForRw () const
 Fit the scale(s) factor of each component to minimize Rw.
void FixAllPar ()
 Fix All parameters.
REAL GetChi2 () const
 Return conventionnal Chi^2.
const CrystVector_REAL & GetChi2Cumul () const
virtual const string & GetClassName () const
virtual ObjRegistry
< RefinableObj > & 
GetClientRegistry ()
 Get the list of clients.
virtual const ObjRegistry
< RefinableObj > & 
GetClientRegistry () const
 Get the list of clients.
const RefinableObjClockGetClockMaster () const
 This clocks records _any_ change in the object. See refinableObj::mClockMaster.
const RefinableObjClockGetClockNbPointUsed () const
 Clock corresponding to the last time the number of points used was changed.
const RefinableObjClockGetClockPowderPatternCalc () const
 Last time the pattern was calculated.
const RefinableObjClockGetClockPowderPatternPar () const
 When were the pattern parameters (2theta range, step) changed ?
const RefinableObjClockGetClockPowderPatternRadiation () const
 When were the radiation parameter (radiation type, wavelength) changed ?
const RefinableObjClockGetClockPowderPatternXCorr () const
virtual void GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter.
const RefinableObjClockGetIntegratedProfileLimitsClock () const
 When were the integration intervals last changed ?
const CrystVector_long & GetIntegratedProfileMax () const
 Get the list of last pixels for the integration intervals.
const CrystVector_long & GetIntegratedProfileMin () const
 Get the list of first pixels for the integration intervals.
REAL GetIntegratedR () const
REAL GetIntegratedRw () const
virtual REAL GetLogLikelihood () const
virtual const CrystVector_REAL & GetLSQCalc (const unsigned int) const
 Get the current calculated value for the LSQ function.
virtual const CrystVector_REAL & GetLSQDeriv (const unsigned int, RefinablePar &)
virtual const CrystVector_REAL & GetLSQObs (const unsigned int) const
 Get the observed values for the LSQ function.
virtual const CrystVector_REAL & GetLSQWeight (const unsigned int) const
 Get the weight values for the LSQ function.
REAL GetMaxSinThetaOvLambda () const
 Get the maximum value for sin(theta)/lambda.
virtual const string & GetName () const
 Name of the object.
virtual unsigned int GetNbLSQFunction () const
 Number of LSQ functions.
unsigned int GetNbOption () const
 Number of Options for this object.
long GetNbPar () const
long GetNbParNotFixed () const
 Total number of non-fixed parameters. Is initialized by PrepareForRefinement().
unsigned long GetNbPoint () const
 Number of points ?
unsigned long GetNbPointUsed () const
 Number of points actually calculated (below the chosen max(sin(theta)/lambda)) ?
unsigned int GetNbPowderPatternComponent () const
 Number of components.
const RefObjOptGetOption (const unsigned int i) const
 const access to the options
RefObjOptGetOption (const unsigned int i)
 Access to the options.
const RefinableParGetPar (const REAL *) const
 Access parameter from its adress.
RefinableParGetPar (const REAL *)
 Access parameter from its adress.
const RefinableParGetPar (const string &name) const
 Access all parameters from their name.
RefinableParGetPar (const string &name)
 Access all parameters from their name.
const RefinableParGetPar (const long i) const
 Access all parameters in the order they were inputted.
RefinableParGetPar (const long i)
 Access all parameters in the order they were inputted.
CrystVector_REAL & GetParamSet (const unsigned long setId)
 Access one save refpar set.
const CrystVector_REAL & GetParamSet (const unsigned long setId) const
 Access one save refpar set.
REAL GetParamSet_ParNotFixedHumanValue (const unsigned long setId, const long parNumber) const
 Access the (human) value of one refined parameter in a saved set of parameters.
const string & GetParamSetName (const unsigned long setId) const
 Get the name associated to a refpar set.
const RefinableParGetParNotFixed (const long i) const
RefinableParGetParNotFixed (const long i)
const CrystVector_REAL & GetPowderPatternCalc () const
 Get the calculated powder pattern.
PowderPatternComponentGetPowderPatternComponent (const int)
 Access to a component of the powder pattern.
PowderPatternComponentGetPowderPatternComponent (const string &name)
 Access to a component of the powder pattern.
const PowderPatternComponentGetPowderPatternComponent (const int) const
 Access to a component of the powder pattern.
const PowderPatternComponentGetPowderPatternComponent (const string &name) const
 Access to a component of the powder pattern.
const CrystVector_REAL & GetPowderPatternObs () const
 Get the observed powder pattern.
const CrystVector_REAL & GetPowderPatternObsSigma () const
 Get the sigma for each point of the observed powder pattern.
const CrystVector_REAL & GetPowderPatternVariance () const
 Get the variance (obs+model) for each point of the powder pattern.
const CrystVector_REAL & GetPowderPatternWeight () const
 Get the weight for each point of the powder pattern.
const CrystVector_REAL & GetPowderPatternX () const
 Get the vector of X (2theta or time-of-flight) coordinates.
REAL GetPowderPatternXMax () const
 Get the maximum 2theta.
REAL GetPowderPatternXMin () const
 Get the Minimum 2theta.
REAL GetPowderPatternXStep () const
REAL GetR () const
 Unweighted R-factor.
RadiationGetRadiation ()
 Neutron or x-ray experiment ?
const RadiationGetRadiation () const
 Neutron or x-ray experiment ?
RadiationType GetRadiationType () const
 Neutron or x-ray experiment ?
const RefinableObjClockGetRefParListClock () const
virtual REAL GetRestraintCost () const
REAL GetRw () const
CrystVector_REAL & GetScaleFactor ()
 Access the scale factors (see PowderPattern::mScaleFactor).
const CrystVector_REAL & GetScaleFactor () const
 Access the scale factors (see PowderPattern::mScaleFactor).
REAL GetScaleFactor (const PowderPatternComponent &comp) const
 Access to the scale factor of components (will be 1 for background components).
REAL GetScaleFactor (const int i) const
 Access to the scale factor of components (will be 1 for background components).
const ObjRegistry< RefinableObj > & GetSubObjRegistry () const
 Access to the registry of RefinableObj used by this object.
ObjRegistry< RefinableObj > & GetSubObjRegistry ()
 Access to the registry of RefinableObj used by this object.
REAL GetWavelength () const
 wavelength of the experiment (in Angstroems)
virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
void ImportPowderPattern2ThetaObs (const string &fileName, const int nbSkip=0)
 Import file with 2 columns 2Theta Iobs.
void ImportPowderPattern2ThetaObsSigma (const string &fileName, const int nbSkip=0)
 Import file with 3 columns 2Theta Iobs Sigma.
void ImportPowderPatternCIF (const CIF &cif)
void ImportPowderPatternFullprof (const string &fullprofFileName)
 Import fullprof-style diffraction data.
void ImportPowderPatternFullprof4 (const string &fileName)
 Import diffraction data from a file, with the first line has 2ThetaMin, step, 2thetaMax, and the following lines alternate 10 Iobs and 10 sigma. Ends with null entries (to fill last Iobs line to reach last sigme line).
void ImportPowderPatternGSAS (const string &fileName)
void ImportPowderPatternILL_D1A5 (const string &filename)
 Import powder pattern, format from ILL D1A/D2B (format without counter info).
void ImportPowderPatternMultiDetectorLLBG42 (const string &fileName)
 diffraction data in a multi-detector format (fullprof format #6).
void ImportPowderPatternPSI_DMC (const string &filename)
 Import powder pattern, format DMC from PSI.
void ImportPowderPatternSietronicsCPI (const string &fileName)
 Import *.cpi Sietronics diffraction data.
void ImportPowderPatternTOF_ISIS_XYSigma (const string &fileName)
 Import TOF file (ISIS type, 3 columns t, Iobs, sigma(Iobs)).
void ImportPowderPatternXdd (const string &fileName)
 Import *.xdd diffraction data (Topas,...).
bool IsBeingRefined () const
 Is the object being refined ? (Can be refined by one algorithm at a time only.).
 PowderPattern (const PowderPattern &)
void Prepare ()
void PrepareForRefinement () const
virtual void Print () const
void PrintObsCalcData (ostream &os=cout) const
virtual void RandomizeConfiguration ()
virtual void RegisterClient (RefinableObj &) const
vector< RefinablePar * >::iterator RemovePar (RefinablePar *refPar)
vector< Restraint * >::iterator RemoveRestraint (Restraint *pRestraint)
void ResetParList ()
void RestoreParamSet (const unsigned long id)
 Restore a saved set of values.
void SaveParamSet (const unsigned long id) const
 Save the current set of refined values over a previously-created set of saved values.
void SavePowderPattern (const string &filename="powderPattern.out") const
void Set2ThetaDisplacement (const REAL displacement)
void Set2ThetaTransparency (const REAL transparency)
void SetDeleteRefParInDestructor (const bool b)
void SetEnergy (const REAL energy)
 Set the energy of the experiment [in keV, lambda(A)=12398/E(keV)].
void SetGlobalOptimStep (const RefParType *type, const REAL step)
 Change the maximum step to use during Global Optimization algorithms.
void SetLimitsAbsolute (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, giving absolute new limits.
void SetLimitsAbsolute (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, giving absolute new limits.
void SetLimitsProportional (const RefParType *type, const REAL min, const REAL max)
void SetLimitsProportional (const string &parName, const REAL min, const REAL max)
void SetLimitsRelative (const RefParType *type, const REAL min, const REAL max)
void SetLimitsRelative (const string &parName, const REAL min, const REAL max)
virtual void SetMaxSinThetaOvLambda (const REAL max)
virtual void SetName (const string &name)
 Name of the object.
void SetParIsFixed (const RefParType *type, const bool fix)
 Fix/un-fix one family of parameters.
void SetParIsFixed (const string &parName, const bool fix)
 Fix/un-fix one parameter from its name.
void SetParIsFixed (const long parIndex, const bool fix)
 Fix/un-fix one parameter from its #.
void SetParIsUsed (const RefParType *type, const bool use)
 Set whether a family of parameters is used.
void SetParIsUsed (const string &parName, const bool use)
 Set whether a parameter is used.
void SetPowderPatternObs (const CrystVector_REAL &obs)
 Set observed powder pattern from vector array.
void SetPowderPatternPar (const REAL min, const REAL step, unsigned long nbPoint)
void SetPowderPatternX (const CrystVector_REAL &x)
void SetRadiation (const Radiation &radiation)
 Set the radiation.
void SetRadiationType (const RadiationType radiation)
 Set the radiation type.
void SetScaleFactor (const PowderPatternComponent &comp, REAL s)
 Access to the scale factor of components (will be 1 for background components).
void SetScaleFactor (const int i, REAL s)
 Access to the scale factor of components (will be 1 for background components).
void SetSigmaToSqrtIobs ()
 Set sigma=sqrt(Iobs).
void SetWavelength (const string &XRayTubeElementName, const REAL alpha12ratio=0.5)
 Set the wavelength of the experiment to that of an X-Ray tube.
void SetWavelength (const REAL lambda)
void SetWeightPolynomial (const REAL a, const REAL b, const REAL c, const REAL minRelatIobs=1e-3)
void SetWeightToInvSigmaSq (const REAL minRelatSigma=1e-3)
void SetWeightToUnit ()
 Set w = 1.
void SetXZero (const REAL newZero)
 Change Zero in x (2theta,tof).
REAL STOL2Pixel (const REAL stol) const
REAL STOL2X (const REAL stol) const
virtual void TagNewBestConfig () const
void UnFixAllPar ()
 UnFix All parameters.
virtual void UpdateDisplay () const
REAL X2Pixel (const REAL x) const
REAL X2PixelCorr (const REAL x) const
REAL X2STOL (const REAL x) const
REAL X2XCorr (const REAL x) const
virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 Input From stream.
virtual void XMLOutput (ostream &os, int indent=0) const
 Output to stream in well-formed XML.

Protected Member Functions

void AddOption (RefObjOpt *opt)
void AddSubRefObj (RefinableObj &)
void CalcNbPointUsed () const
void CalcPowderPattern () const
 Calc the powder pattern.
void CalcPowderPatternIntegrated () const
 Calc the integrated powder pattern.
long FindPar (const REAL *) const
 Find a refinable parameter from the adress of its value.
long FindPar (const string &name) const
 Find a refinable parameter with a given name.
map< unsigned long, pair
< CrystVector_REAL, string >
>::iterator 
FindParamSet (unsigned long id) const
 Find a parameter set with a given id (and check if it is there).
virtual void Init ()
 Init parameters and options.
virtual void InitOptions ()
 Initialize options.
void PrepareIntegratedRfactor () const
 Prepare the calculation of the integrated R-factors.
void RemoveSubRefObj (RefinableObj &)

Protected Attributes

CrystVector_REAL mChi2Cumul
 The cumulative Chi^2 (integrated or not, depending on the option).
ObjRegistry< RefinableObjmClientObjRegistry
RefinableObjClock mClockMaster
RefinableObjClock mClockNbPointUsed
 Clock recording the last time the number of points used (PowderPattern::mNbPointUsed) was changed.
RefinableObjClock mClockPowderPatternCalc
 When was the powder pattern last computed ?
RefinableObjClock mClockPowderPatternIntegratedCalc
 When was the powder pattern (integrated) last computed ?
RefinableObjClock mClockPowderPatternPar
 When were the pattern parameters (2theta or time-of-flight range) changed ?
RefinableObjClock mClockPowderPatternRadiation
 When were the radiation parameter (radiation type, wavelength) changed ?
RefinableObjClock mClockPowderPatternXCorr
 Corrections to 2Theta.
RefinableObjClock mClockScaleFactor
 Last modification of the scale factor.
bool mDeleteRefParInDestructor
CrystVector_REAL mExcludedRegionMaxX
 Max coordinate for 2theta for all excluded regions.
CrystVector_REAL mExcludedRegionMinX
 Min coordinate for for all excluded regions.
bool mIsbeingRefined
 Is the object being refined ?
bool mIsXAscending
 Is the mX vector sorted in ascending order ? (true for 2theta, false for TOF).
CrystVector_REAL mLSQDeriv
REAL mMaxSinThetaOvLambda
string mName
 Name for this RefinableObject. Should be unique, at least in the same scope.+.
unsigned long mNbIntegrationUsed
 Number of integration intervals actually used, due to the maximum value of sin(theta)/lambda.
unsigned long mNbPoint
 Number of points in the pattern.
unsigned long mNbPointUsed
 Number of points actually used, due to the maximum value of sin(theta)/lambda.
long mNbRefParNotFixed
 Total of not-fixed parameters.
ObjRegistry< RefObjOptmOptionRegistry
CrystVector_REAL mPowderPatternBackgroundCalc
CrystVector_REAL mPowderPatternBackgroundIntegratedCalc
CrystVector_REAL mPowderPatternCalc
CrystVector_REAL mPowderPatternIntegratedCalc
 The calculated powder pattern, integrated.
CrystVector_REAL mPowderPatternObs
 The observed powder pattern.
CrystVector_REAL mPowderPatternObsSigma
 The sigma of the observed pattern.
CrystVector_REAL mPowderPatternUsedCalc
 The calculated powder pattern. Cropped to the maximum sin(theta)/lambda for LSQ.
CrystVector_REAL mPowderPatternUsedObs
 The calculated powder pattern. Cropped to the maximum sin(theta)/lambda for LSQ.
CrystVector_REAL mPowderPatternUsedWeight
 The weight for each point of the pattern. Cropped to the maximum sin(theta)/lambda for LSQ.
CrystVector_REAL mPowderPatternVariance
CrystVector_REAL mPowderPatternVarianceIntegrated
CrystVector_REAL mPowderPatternWeight
 The weight for each point of the pattern.
Radiation mRadiation
 The Radiation corresponding to this experiment.
bool mRandomMoveIsDone
RefinableObjClock mRefParListClock
 Last time the RefinableParList was modified (a parameter added or removed).
CrystVector_long mRefparNotFixedIndex
 Index of not-fixed parameters.
ObjRegistry< RefinableObjmSubObjRegistry
 Registry of RefinableObject needed for this object (owned by this object or not).
vector< RefinablePar * > mvpRefPar
 Vector of pointers to the refinable parameters.
vector< Restraint * > mvpRestraint
map< unsigned long, pair
< CrystVector_REAL, string > > 
mvpSavedValuesSet
CrystVector_REAL mX
REAL mXZero

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index