Skip to content

Commit c5ea86c

Browse files
committed
PowderPatternDiffraction: add GetFhklObsSq() and HasFhklObsSq()
1 parent a3957d7 commit c5ea86c

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

ObjCryst/ObjCryst/PowderPattern.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,19 @@ unsigned int PowderPatternDiffraction::GetProfileFitNetNbObs()const
12981298
return nb;
12991299
}
13001300

1301+
bool PowderPatternDiffraction::HasFhklObsSq() const
1302+
{
1303+
if(mpLeBailData==NULL) return false;
1304+
return mpLeBailData->GetFhklObsSq().size() > 0;
1305+
}
1306+
1307+
const CrystVector_REAL& PowderPatternDiffraction::GetFhklObsSq() const
1308+
{
1309+
if(mpLeBailData==NULL)
1310+
throw ObjCrystException("PowderPatternDiffraction::GetFhklObsSq(): no extracted intensities available");
1311+
return mpLeBailData->GetFhklObsSq();
1312+
}
1313+
13011314
void PowderPatternDiffraction::CalcPowderPattern() const
13021315
{
13031316
this->GetNbReflBelowMaxSinThetaOvLambda();

ObjCryst/ObjCryst/PowderPattern.h

+10
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,16 @@ class PowderPatternDiffraction : virtual public PowderPatternComponent,public Sc
420420
* No over paremeters (profile, background) are taken into account
421421
*/
422422
unsigned int GetProfileFitNetNbObs()const;
423+
/// Return true if there are extracted (le Bail) squared structure factors, false otherwise
424+
bool HasFhklObsSq() const;
425+
/** Get the extracted structure factors modulus (squared), e.g. using the Le Bail method.
426+
*
427+
* Note that the number of reflections listed is limited to the evaluated ones,
428+
*which is usually smaller than the H,K and L arrays.
429+
*
430+
* Raises an exception if this is not available.
431+
*/
432+
const CrystVector_REAL& GetFhklObsSq() const;
423433
protected:
424434
virtual void CalcPowderPattern() const;
425435
virtual void CalcPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);

0 commit comments

Comments
 (0)