13 #ifndef _OBJCRYST_DIFFDATA_SINGLECRYSTAL_H_
14 #define _OBJCRYST_DIFFDATA_SINGLECRYSTAL_H_
16 #include "ObjCryst/CrystVector/CrystVector.h"
18 #include "ObjCryst/ObjCryst/General.h"
20 #include "ObjCryst/ObjCryst/ScatteringPower.h"
21 #include "ObjCryst/ObjCryst/Crystal.h"
22 #include "ObjCryst/ObjCryst/ScatteringData.h"
81 const CrystVector_REAL&
GetIcalc()
const;
83 std::map<RefinablePar*, CrystVector_REAL> &
GetIcalc_FullDeriv(std::set<RefinablePar *> &vPar);
86 const CrystVector_REAL&
GetIobs()
const;
88 void SetIobs(
const CrystVector_REAL&);
91 const CrystVector_REAL&
GetSigma()
const;
93 void SetSigma(
const CrystVector_REAL&);
99 const CrystVector_REAL&
GetWeight()
const;
112 const CrystVector_long &k,
113 const CrystVector_long &l,
114 const CrystVector_REAL &iObs,
115 const CrystVector_REAL &sigma);
125 void ImportHklIobs(
const string &fileName,
const long nbRefl,
const int skipLines=0);
134 void ImportHklIobsSigma(
const string &fileName,
const long nbRefl,
const int skipLines=0);
177 virtual REAL
GetRw()
const;
183 virtual REAL
GetR()
const;
226 virtual void SetWeightToInvSigma2(
const REAL minRelatSigma=1e-4,
const REAL minIobsSigmaRatio=0);
243 virtual void SetUseOnlyLowAngleData(
const bool useOnlyLowAngle,
const REAL angle=0.);
253 virtual const CrystVector_REAL&
GetLSQCalc(
const unsigned int)
const;
254 virtual const CrystVector_REAL&
GetLSQObs(
const unsigned int)
const;
255 virtual const CrystVector_REAL&
GetLSQWeight(
const unsigned int)
const;
256 virtual std::map<RefinablePar*, CrystVector_REAL> &
GetLSQ_FullDeriv(
const unsigned int,std::set<RefinablePar *> &vPar);
257 virtual void XMLOutput(ostream &os,
int indent=0)
const;
284 void SetWavelength(
const string &XRayTubeElementName,
const REAL alpha2Alpha2ratio=0.5);
290 virtual void InitRefParList();
293 void CalcIcalc_FullDeriv(std::set<RefinablePar *> &vPar);
316 mutable std::map<RefinablePar*, CrystVector_REAL> mCalcIntensity_FullDeriv;
339 mutable std::map<RefinablePar*, CrystVector_REAL> mGroupIcalc_FullDeriv;
378 #endif //_OBJCRYST_DIFFDATA_SINGLECRYSTAL_H_
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
virtual REAL GetLogLikelihood() const
Get -log(likelihood) of the current configuration for the object.
const CrystVector_REAL & GetIcalc() const
returns the calculated diffracted intensity.
void ImportHklIobsSigmaJanaM91(const string &fileName)
Import h,k,l,I,Sigma from a Jana98 '*.m91' file.
const CrystVector_REAL & GetIobs() const
Return the array of observed intensities for all peaks.
RefObjOpt mGroupOption
Option for the type of grouping (0:no, 1:by theta values (twinning), 2:user-supplied groups) ...
const CrystVector_REAL & GetWeight() const
Return the weights (for each reflection) used for computing Rw.
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
virtual void PrintObsData() const
Print H, K, L Iobs sigma for all reflections.
REAL GetScaleFactor() const
Scale factor (applied to Icalc to match Iobs)
virtual const Radiation & GetRadiation() const
Get the radiation object for this data.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
virtual void SetSigmaToSqrtIobs()
Set sigma for all observed intensities to sqrt(obs)
virtual void FitScaleFactorForRw() const
Compute the best scale factor minimising Rw.
void ImportHklIobs(const string &fileName, const long nbRefl, const int skipLines=0)
Import h,k,l,I from a file.
void SetIobs(const CrystVector_REAL &)
Return the array of observed intensities for all peaks.
virtual CrystVector_long SortReflectionBySinThetaOverLambda(const REAL maxTheta=-1.)
void SetWeight(const CrystVector_REAL &)
Change the weights (for each reflection) used for computing Rw.
CrystVector_REAL mGroupIcalc
The calculated intensities summed on all reflections that are grouped.
void CalcIcalc() const
Calc intensities.
RefinableObjClock mClockScaleFactor
Last modification of the scale factor.
CrystVector_long mGroupIndex
The index of reflections which need to be summed.
virtual const CrystVector_REAL & GetLSQObs(const unsigned int) const
Get the observed values for the LSQ function.
virtual const CrystVector_REAL & GetLSQCalc(const unsigned int) const
Get the current calculated value for the LSQ function.
virtual unsigned int GetNbLSQFunction() const
Number of LSQ functions.
long mNbGroup
Number of groups.
Class to compute structure factors for a set of reflections and a Crystal.
Abstract base class for all objects in wxCryst.
CrystVector_REAL mObsSigma
Sigma for observed intensities (either individual reflections or spectrum)
ObjRegistry< DiffractionDataSingleCrystal > gDiffractionDataSingleCrystalRegistry("Global DiffractionDataSingleCrystal Registry")
Global registry for all PowderPattern objects.
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration.
CrystVector_REAL mGroupWeight
The weight on each reflection sum in case of grouped reflections.
virtual void SetRadiationType(const RadiationType radiation)
Set : neutron or x-ray experiment ? Wavelength ?
virtual const CrystVector_REAL & GetLSQWeight(const unsigned int) const
Get the weight values for the LSQ function.
DiffractionData object for Single Crystal analysis.
DiffractionDataSingleCrystal(const bool regist=true)
Default constructor.
CrystVector_REAL mCalcIntensity
Calculated intensities.
void SetHklIobs(const CrystVector_long &h, const CrystVector_long &k, const CrystVector_long &l, const CrystVector_REAL &iObs, const CrystVector_REAL &sigma)
input H,K,L, Iobs and Sigma
virtual void FitScaleFactorForR() const
Compute the best scale factor minimising R.
void SaveHKLIobsIcalc(const string &filename="hklIobsIcalc.out")
Save H,K,L Iobs Icalc to a file, text format, 3 columns theta Iobs Icalc.
void SetEnergy(const REAL)
Set the (monochromatic) energy of the beam.
virtual std::map< RefinablePar *, CrystVector_REAL > & GetLSQ_FullDeriv(const unsigned int, std::set< RefinablePar * > &vPar)
Get the first derivative for the LSQ function for each parameter supplied in a list.
void PrepareTwinningCalc() const
Determine the index of reflections to be summed because of twinning (GroupOption==1) The reflections ...
CrystVector_REAL mGroupIobs
The observed intensities summed on all reflections that are (or could be) overlapped dur to a twinnin...
WX Class for DiffractionDataSingleCrystal objects.
void ImportShelxHKLF4(const string &fileName)
Import h,k,l,I,Sigma from a file using shelx HKLF 4 format.
CrystVector_REAL mGroupSigma
The uncertainty on observed grouped intensities.
REAL mScaleFactor
Scale factor.
const CrystVector_REAL & GetSigma() const
Return the array of sigmas for observed intensities, for all peaks.
void ImportHklIobsGroup(const string &fileName, const unsigned int skipLines=0)
Import h,k,l and grouped intensities from a file.
virtual REAL GetR() const
Return the Crystal R-factor (unweighted)
virtual void SetWeightToInvSigma2(const REAL minRelatSigma=1e-4, const REAL minIobsSigmaRatio=0)
Set the weight for all observed intensities to 1/sigma^2.
virtual REAL GetBestRFactor() const
Compute the best scale factor to minimize R, apply this scale factor and return the R value obtained...
RefinableObjClock mClockIcalc
Last time Icalc was computed.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
CrystVector_REAL mObsIntensity
Observed intensity (after ABS and LP corrections)
RefinableObjClock mClockChi2
Clock the last time Chi^2 was computed.
void SetSigma(const CrystVector_REAL &)
Return the array of sigmas for observed intensities, for all peaks.
RadiationType
Type of radiation used.
void ImportHklIobsSigma(const string &fileName, const long nbRefl, const int skipLines=0)
Import h,k,l,I,Sigma from a file.
void SetIobsToIcalc()
Set Iobs to current values of Icalc. Mostly used for tests.
CrystVector_REAL mWeight
weight for computing R-Factor, for each observed value.
Crystal class: Unit cell, spacegroup, scatterers.
void InitOptions()
Init options (currently only twinning).
RefinableObjClock mClockPrepareTwinningCorr
Clock for twinning, when the preparation of twinning correction was last made.
virtual REAL GetRw() const
Return the Crystal R-factor (weighted)
class to input or output a well-formatted xml beginning or ending tag.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
class of refinable parameter types.
bool mHasObservedData
Are there observed intensities ?
Class to define the radiation (type, monochromaticity, wavelength(s)) of an experiment.
virtual DiffractionDataSingleCrystal * CreateCopy() const
So-called virtual copy constructor.
const RefParType * gpRefParTypeObjCryst
Top RefParType for the ObjCryst++ library.
virtual void PrintObsCalcData() const
Print H, K, L Iobs sigma Icalc for all reflections Iobs and sigma (if given) are scaled to Icalc (if ...
std::map< RefinablePar *, CrystVector_REAL > & GetIcalc_FullDeriv(std::set< RefinablePar * > &vPar)
virtual REAL GetChi2() const
Return conventionnal Chi^2.
long mNbGroupUsed
Number of groups below max[sin(theta)/lambda].
void ImportCIF(const string &fileName)
Import diffraction data from a CIF file.
void SetWavelength(const REAL)
Set the (monochromatic) wavelength of the beam.