Inheritance diagram for ObjCryst::PowderPattern:
Public Methods | |
virtual const string & | GetClassName () const |
Name for this class ("RefinableObj", "Crystal",...). | |
void | AddPowderPatternComponent (PowderPatternComponent &) |
Add a component (phase, backround) to this pattern. | |
unsigned int | GetNbPowderPatternComponent () const |
Number of components. | |
const PowderPatternComponent & | GetPowderPatternComponent (const string &name) const |
Access to a component of the powder pattern. | |
const PowderPatternComponent & | GetPowderPatternComponent (const int) const |
Access to a component of the powder pattern. | |
PowderPatternComponent & | GetPowderPatternComponent (const string &name) |
Access to a component of the powder pattern. | |
PowderPatternComponent & | GetPowderPatternComponent (const int) |
Access to a component of the powder pattern. | |
void | SetPowderPatternPar (const REAL tthetaMin, const REAL tthetaStep, unsigned long nbPoint) |
\briefSet the powder pattern angular range & resolution parameter. | |
unsigned long | GetNbPoint () const |
Number of points ? | |
void | SetRadiation (const Radiation &radiation) |
Set the radiation. | |
const Radiation & | GetRadiation () const |
Neutron or x-ray experiment ? | |
void | SetRadiationType (const RadiationType radiation) |
Set the radiation type. | |
RadiationType | GetRadiationType () const |
Neutron or x-ray experiment ? | |
void | SetWavelength (const REAL lambda) |
Set the wavelength of the experiment (in Angstroems). | |
void | SetWavelength (const string &XRayTubeElementName, const REAL alpha12ratio=0.5) |
Set the wavelength of the experiment to that of an X-Ray tube. | |
void | SetEnergy (const REAL energy) |
Set the energy of the experiment [in keV, lambda(A)=12398/E(keV)]. | |
REAL | GetWavelength () const |
wavelength of the experiment (in Angstroems) | |
const CrystVector_REAL & | GetPowderPatternCalc () const |
Get the calculated 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. | |
REAL | Get2ThetaMin () const |
Get the Minimum 2theta. | |
REAL | Get2ThetaStep () const |
Get the step in 2theta. | |
REAL | Get2ThetaMax () const |
Get the maximum 2theta. | |
const RefinableObjClock & | GetClockPowderPatternCalc () const |
Last time the pattern was calculated. | |
const RefinableObjClock & | GetClockPowderPatternPar () const |
When were the pattern parameters (2theta range, step) changed ? | |
const RefinableObjClock & | GetClockPowderPatternRadiation () const |
When were the radiation parameter (radiation type, wavelength) changed ? | |
const RefinableObjClock & | GetClockPowderPattern2ThetaCorr () const |
When were the parameters for 2theta correction (zero, transparency, displacement) last changed ? | |
void | Set2ThetaZero (const REAL newZero) |
Change Zero in 2Theta. | |
void | Set2ThetaDisplacement (const REAL displacement) |
Change displacement correction ![]() | |
void | Set2ThetaTransparency (const REAL transparency) |
Change transparency correction ![]() | |
REAL | Get2ThetaCorr (const REAL ttheta) const |
Get the experimental 2theta from the theoretical value, taking into account all corrections (zero, transparency,..). | |
long | Get2ThetaCorrPixel (const REAL ttheta) const |
Get the pixel number on the experimental pattern, from the theoretical (uncorrected) value of 2theta, taking into account all corrections. | |
void | ImportPowderPatternFullprof (const string &fullprofFileName) |
Import fullprof-style diffraction data. | |
void | ImportPowderPatternPSI_DMC (const string &filename) |
Import powder pattern, format DMC from PSI. | |
void | ImportPowderPatternILL_D1A5 (const string &filename) |
Import powder pattern, format from ILL D1A/D2B (format without counter info). | |
void | ImportPowderPatternXdd (const string &fileName) |
Import *.xdd diffraction data (Topas,...). | |
void | ImportPowderPatternSietronicsCPI (const string &fileName) |
Import *.cpi Sietronics diffraction data. | |
void | ImportPowderPattern2ThetaObsSigma (const string &fileName, const int nbSkip=0) |
Import file with 3 columns 2Theta Iobs Sigma. | |
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 | ImportPowderPatternMultiDetectorLLBG42 (const string &fileName) |
diffraction data in a multi-detector format (fullprof format #6). | |
void | ImportPowderPattern2ThetaObs (const string &fileName, const int nbSkip=0) |
Import file with 2 columns 2Theta Iobs. | |
void | SetPowderPatternObs (const CrystVector_REAL &obs) |
Set observed powder pattern from vector array. | |
void | SavePowderPattern (const string &filename="powderPattern.out") const |
Save powder pattern to one file, text format, 3 columns theta Iobs Icalc. | |
void | PrintObsCalcData (ostream &os=cout) const |
Print to thee screen/console the observed and calculated pattern (long, mostly useful for debugging). | |
REAL | GetR () const |
Unweighted R-factor. | |
REAL | GetRw () const |
Get the weighted R-factor. | |
REAL | GetChi2 () const |
Return conventionnal Chi^2. | |
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 | SetSigmaToSqrtIobs () |
Set sigma=sqrt(Iobs). | |
void | SetWeightToInvSigmaSq (const REAL minRelatSigma=1e-3) |
Set w = 1/sigma^2. | |
void | SetWeightToSinTheta (const REAL power=1.) |
Set w = sin(theta). Not really usful, huh ? | |
void | SetWeightToUnit () |
Set w = 1. | |
void | SetWeightPolynomial (const REAL a, const REAL b, const REAL c, const REAL minRelatIobs=1e-3) |
Set w = 1/(a+ Iobs + b*Iobs^2+c*Iobs^3). | |
void | Add2ThetaExcludedRegion (const REAL min2Theta, const REAL max2theta) |
Add an Exclusion region, in 2theta, which will be ignored when computing R's XMLInput values must be, as always, in radians. | |
virtual void | BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false) |
This should be called by any optimization class at the begining of an optimization. | |
virtual void | GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst) |
Make a random move of the current configuration. | |
virtual REAL | GetLogLikelihood () const |
Get -log(likelihood) of the current configuration for the object. | |
virtual unsigned int | GetNbLSQFunction () const |
Number of LSQ functions. | |
virtual const CrystVector_REAL & | GetLSQCalc (const unsigned int) const |
Get the current calculated value for the LSQ function. | |
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. | |
virtual void | XMLOutput (ostream &os, int indent=0) const |
Output to stream in well-formed XML. | |
virtual void | XMLInput (istream &is, const XMLCrystTag &tag) |
Input From stream. | |
void | Prepare () |
Prepare everything (if necessary) for an optimization/calculation. | |
virtual void | GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const |
Get the gene group assigned to each parameter. | |
virtual void | SetMaxSinThetaOvLambda (const REAL max) |
Set the maximum value for sin(theta)/lambda. | |
REAL | GetMaxSinThetaOvLambda () const |
Get the maximum value for sin(theta)/lambda. | |
const CrystVector_long & | GetIntegratedProfileMin () const |
Get the list of first pixels for the integration intervals. | |
const CrystVector_long & | GetIntegratedProfileMax () const |
Get the list of last pixels for the integration intervals. | |
const RefinableObjClock & | GetIntegratedProfileLimitsClock () const |
When were the integration intervals last changed ? | |
Protected Methods | |
void | CalcPowderPattern () const |
Calc the powder pattern. | |
void | CalcPowderPatternIntegrated () const |
Calc the integrated powder pattern. | |
virtual void | Init () |
Init parameters and options. | |
void | PrepareIntegratedRfactor () const |
Prepare the calculation of the integrated R-factors. | |
void | CalcNbPointUsed () const |
Calculate the number of points of the pattern actually used, from the maximum value of sin(theta)/lambda. | |
virtual void | InitOptions () |
Initialize options. | |
Protected Attributes | |
CrystVector_REAL | mPowderPatternCalc |
The calculated powder pattern. | |
CrystVector_REAL | mPowderPatternIntegratedCalc |
The calculated powder pattern, integrated. | |
CrystVector_REAL | mPowderPatternBackgroundCalc |
The calculated powder pattern part which corresponds to 'background' (eg non-scalable components). | |
CrystVector_REAL | mPowderPatternBackgroundIntegratedCalc |
The calculated powder pattern part which corresponds to 'background' (eg non-scalable components), integrated. | |
CrystVector_REAL | mPowderPatternObs |
The observed powder pattern. | |
CrystVector_REAL | mPowderPatternObsSigma |
The sigma of the observed pattern. | |
CrystVector_REAL | mPowderPatternWeight |
The weight for each point of the pattern. | |
CrystVector_REAL | mPowderPatternVariance |
The complete variance associated to each point of the powder pattern, taking into account observation and model errors. | |
CrystVector_REAL | mPowderPatternVarianceIntegrated |
The complete variance associated to each point of the powder pattern, taking into account observation and model errors. | |
REAL | m2ThetaMin |
2theta min and step for the pattern | |
REAL | m2ThetaStep |
2theta min and step for the pattern | |
unsigned long | mNbPoint |
Number of points in the pattern. | |
REAL | mWavelength |
The wavelength of the experiment, in Angstroems. | |
Radiation | mRadiation |
The wavelength of the experiment, in Angstroems. | |
RefinableObjClock | mClockPowderPatternPar |
When were the pattern parameters (2theta range, step) changed ? | |
RefinableObjClock | mClockPowderPatternRadiation |
When were the radiation parameter (radiation type, wavelength) changed ? | |
RefinableObjClock | mClockPowderPatternCalc |
When was the powder pattern last computed ? | |
RefinableObjClock | mClockPowderPatternIntegratedCalc |
When was the powder pattern (integrated) last computed ? | |
RefinableObjClock | mClockPowderPattern2ThetaCorr |
Corrections to 2Theta. | |
RefinableObjClock | mClockScaleFactor |
Last modification of the scale factor. | |
CrystVector_REAL | mExcludedRegionMin2Theta |
Min value for 2theta for all excluded regions. | |
CrystVector_REAL | mExcludedRegionMax2Theta |
Max value for 2theta for all excluded regions. | |
REAL | m2ThetaZero |
Zero correction : ![]() | |
REAL | m2ThetaDisplacement |
Displacement correction : ![]() | |
REAL | m2ThetaTransparency |
Transparency correction : ![]() | |
ObjRegistry< PowderPatternComponent > | mPowderPatternComponentRegistry |
The components (crystalline phases, background,...) of the powder pattern. | |
CrystVector_REAL | mScaleFactor |
The scale factors for each component. | |
bool | mUseFastLessPreciseFunc |
Use faster, less precise functions ? | |
bool | mStatisticsExcludeBackground |
Should Statistics (R, Rw,..) exclude the background ? | |
CrystVector_int | mScalableComponentIndex |
CrystMatrix_REAL | mFitScaleFactorM |
Used to fit the components' scale factors. | |
CrystMatrix_REAL | mFitScaleFactorB |
Used to fit the components' scale factors. | |
CrystMatrix_REAL | mFitScaleFactorX |
Used to fit the components' scale factors. | |
RefObjOpt | mOptProfileIntegration |
Use Integrated profiles for Chi^2, R, Rwp... | |
REAL | mChi2LikeNorm |
This is the logarithm of the part of log(Likelihood) which corresponds to the normalization terms of gaussian distribution for each obs/calc point. | |
RefinableObjClock | mClockChi2 |
Clock the last time Chi^2 was computed. | |
REAL | mMaxSinThetaOvLambda |
Maximum sin(theta)/lambda for all calculations (10 by default). | |
unsigned long | mNbPointUsed |
Number of points actually used, due to the maximum value of sin(theta)/lambda. | |
unsigned long | mNbIntegrationUsed |
Number of integration intervals actually used, due to the maximum value of sin(theta)/lambda. | |
RefinableObjClock | mClockNbPointUsed |
Clock recording the last time the number of points used (PowderPattern::mNbPointUsed) was changed. |
This can also be used for simulation, using a fake Iobs. Supports multiple phases.
|
Add an Exclusion region, in 2theta, which will be ignored when computing R's XMLInput values must be, as always, in radians. Does not work yet with integrated R factors. Note that the pattern is still computed in these regions. They are only ignored by statistics functions (R, Rws). |
|
Add a component (phase, backround) to this pattern. It must have been allocated in the heap. The pattern parameters (2theta min, step, nbpoints, wavelength, radiation type) of the component are automatically changed to that of the PowderPattern object. |
|
This should be called by any optimization class at the begining of an optimization. This will also check that everything is ready, eg call the RefinableObj::Prepare() function. This also affects all sub-objects.
Reimplemented from ObjCryst::RefinableObj. |
|
Get the experimental 2theta from the theoretical value, taking into account all corrections (zero, transparency,..).
For internal use only.
|
|
Get the pixel number on the experimental pattern, from the theoretical (uncorrected) value of 2theta, taking into account all corrections. (zero, transparency,..). For internal use only.
|
|
Return conventionnal Chi^2.
|
|
Name for this class ("RefinableObj", "Crystal",...). This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry Reimplemented from ObjCryst::RefinableObj. |
|
Get the gene group assigned to each parameter. Each parameter (a gene in terms of genetic algorithms) can be assigned to a gene group. Thus when mating two configurations, genes will be exchanged by groups. By default (in the base RefinabeObj class), each parameter is alone in its group. Derived classes can group genes for a better s** life. The number identifying a gene group only has a meaning in a given object. It can also change on subsequent calls, and thus is not unique.
Reimplemented from ObjCryst::RefinableObj. |
|
Get -log(likelihood) of the current configuration for the object. By default (no likelihood evaluation available), this is equal to 0. This call should not be recursive, it is the task of the algorithm to get the sum of likelihoods for all objects invlolved.
Reimplemented from ObjCryst::RefinableObj. |
|
Unweighted R-factor.
|
|
Get the weighted R-factor.
|
|
Make a random move of the current configuration. This is for global optimization algorithms. the moves for each parameter are less than their global optimization step, multiplied by the mutation amplitude. \warning: this makes a random move for the parameter declared for this object, and it is the duty of the object to decide whether the included objects should be moved and how. (eg an algorithm should only call for a move with the top object, and this object decides how he and his sub-objects moves). By default (RefinableObj implementation) all included objects are moved recursively.
Reimplemented from ObjCryst::RefinableObj. |
|
Import file with 2 columns 2Theta Iobs.
|
|
Import file with 3 columns 2Theta Iobs Sigma.
|
|
Import fullprof-style diffraction data.
|
|
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). That's fullprof format #4.
|
|
diffraction data in a multi-detector format (fullprof format #6). First line is text. Third entry of second line is the 2theta step. Third line has the 2thetamin, fourth line has monitors and temperatures. Then each line has ten pairs (I2,I8)of NbCounters,intensity. Ends with negative entries.
|
|
Import *.cpi Sietronics diffraction data.
|
|
Import *.xdd diffraction data (Topas,...).
|
|
Prepare everything (if necessary) for an optimization/calculation.
For internal use only.
Reimplemented from ObjCryst::RefinableObj. |
|
Save powder pattern to one file, text format, 3 columns theta Iobs Icalc. If Iobs is missing, the column is omitted.
|
|
Set the maximum value for sin(theta)/lambda. All data (reflections,..) still exist but are ignored for all calculations. |
|
Set observed powder pattern from vector array. Note: powder pattern parameters must have been set before calling this function, for example by calling DiffractionDataPowder::InitPowderPatternPar(). |
|
\briefSet the powder pattern angular range & resolution parameter. this will affect all components (phases) of the pattern. Use this with caution, as the number of points must be correct with respect to the observed data (Iobs).
|
|
Set the wavelength of the experiment to that of an X-Ray tube.
NOTE : if the name of the wavelength is generic (eg"Cu"), then the program considers that there are both Alpha1 and Alpha2, and thus automatically changes the WavelengthType to WAVELENGTH_ALPHA12. If instead either alpha1 or alpha2 (eg "CuA1") is asked for, the WavelengthType is set to WAVELENGTH_MONOCHROMATIC. In both cases, the radiation type is set to X-Ray. |
|
Set w = 1/(a+ Iobs + b*Iobs^2+c*Iobs^3). To filter too small or null intensities: if Iobs < [minRelatIobs * max(Iobs)], then use Iobs=minRelatIobs * max(Iobs) to compute the weight. Typical values: a=2*min(Iobs) b=2/max(Iobs) c=0 |
|
Set w = 1/sigma^2. To filter too small or null intensities :If sigma< minRelatSigma* max(sigma), then w=1/(minRelatSigma* max(sigma))^2 |
|
Input From stream.
Reimplemented from ObjCryst::RefinableObj. |
|
Output to stream in well-formed XML.
Reimplemented from ObjCryst::RefinableObj. |
|
This is the logarithm of the part of log(Likelihood) which corresponds to the normalization terms of gaussian distribution for each obs/calc point. In practice, this is the sum of 1/2*log(2pi*sig(i)^2), although we discard the 2pi terms. |
|
Used to fit the components' scale factors.
For internal use only.
|
|
Used to fit the components' scale factors.
For internal use only.
|
|
Used to fit the components' scale factors.
For internal use only.
|
|
Maximum sin(theta)/lambda for all calculations (10 by default). This keeps all data in memory, but only the part which is below the max is calculated. |
|
The calculated powder pattern part which corresponds to 'background' (eg non-scalable components). It is already included in mPowderPatternCalc |
|
The calculated powder pattern. It is mutable since it is completely defined by other parameters (eg it is not an 'independent parameter') |
|
The complete variance associated to each point of the powder pattern, taking into account observation and model errors. Integrated. |
|
For internal use only. To compute scale factors, which are the components (phases) that can be scaled ? |
|
The scale factors for each component. For unscalable phases, this is set to 1 (constant). This is mutable because generally we use the 'best' scale factor, but it should not be... |
|
The wavelength of the experiment, in Angstroems.
|