Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
5f9d6ff6
Commit
5f9d6ff6
authored
4 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
Mises without "von"
parent
d1fc35ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Core/Correlations/IPeakShape.cpp
+17
-17
17 additions, 17 deletions
Core/Correlations/IPeakShape.cpp
Core/Correlations/IPeakShape.h
+19
-12
19 additions, 12 deletions
Core/Correlations/IPeakShape.h
with
36 additions
and
29 deletions
Core/Correlations/IPeakShape.cpp
+
17
−
17
View file @
5f9d6ff6
...
...
@@ -48,7 +48,7 @@ double FisherPrefactor(double kappa)
}
}
double
Von
MisesPrefactor
(
double
kappa
)
double
MisesPrefactor
(
double
kappa
)
{
if
(
kappa
<=
0.0
)
{
return
1.0
/
(
2.0
*
M_PI
);
...
...
@@ -202,10 +202,10 @@ double LorentzFisherPeakShape::evaluate(const kvector_t q, const kvector_t q_lat
}
// ************************************************************************** //
// class
Von
MisesFisherGaussPeakShape
// class MisesFisherGaussPeakShape
// ************************************************************************** //
Von
MisesFisherGaussPeakShape
::
Von
MisesFisherGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
MisesFisherGaussPeakShape
::
MisesFisherGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
kvector_t
zenith
,
double
kappa_1
,
double
kappa_2
)
:
m_max_intensity
(
max_intensity
),
m_radial_size
(
radial_size
),
m_zenith
(
zenith
.
unit
()),
...
...
@@ -213,15 +213,15 @@ VonMisesFisherGaussPeakShape::VonMisesFisherGaussPeakShape(double max_intensity,
{
}
Von
MisesFisherGaussPeakShape
::~
Von
MisesFisherGaussPeakShape
()
=
default
;
MisesFisherGaussPeakShape
::~
MisesFisherGaussPeakShape
()
=
default
;
Von
MisesFisherGaussPeakShape
*
Von
MisesFisherGaussPeakShape
::
clone
()
const
MisesFisherGaussPeakShape
*
MisesFisherGaussPeakShape
::
clone
()
const
{
return
new
Von
MisesFisherGaussPeakShape
(
m_max_intensity
,
m_radial_size
,
m_zenith
,
m_kappa_1
,
return
new
MisesFisherGaussPeakShape
(
m_max_intensity
,
m_radial_size
,
m_zenith
,
m_kappa_1
,
m_kappa_2
);
}
double
Von
MisesFisherGaussPeakShape
::
evaluate
(
const
kvector_t
q
,
double
MisesFisherGaussPeakShape
::
evaluate
(
const
kvector_t
q
,
const
kvector_t
q_lattice_point
)
const
{
// radial part
...
...
@@ -247,13 +247,13 @@ double VonMisesFisherGaussPeakShape::evaluate(const kvector_t q,
m_phi
=
std
::
acos
(
q_ortho
.
unit
().
dot
(
m_ux
));
m_theta
=
std
::
acos
(
q
.
unit
().
dot
(
m_zenith
));
double
pre_1
=
FisherPrefactor
(
m_kappa_1
);
double
pre_2
=
Von
MisesPrefactor
(
m_kappa_2
);
double
pre_2
=
MisesPrefactor
(
m_kappa_2
);
double
integral
=
m_integrator
.
integrate
([
&
](
double
phi
)
->
double
{
return
integrand
(
phi
);
},
0.0
,
M_TWOPI
);
return
m_max_intensity
*
radial_part
*
pre_1
*
pre_2
*
integral
;
}
double
Von
MisesFisherGaussPeakShape
::
integrand
(
double
phi
)
const
double
MisesFisherGaussPeakShape
::
integrand
(
double
phi
)
const
{
kvector_t
u_q
=
std
::
sin
(
m_theta
)
*
std
::
cos
(
phi
)
*
m_ux
+
std
::
sin
(
m_theta
)
*
std
::
sin
(
phi
)
*
m_uy
+
std
::
cos
(
m_theta
)
*
m_zenith
;
...
...
@@ -263,24 +263,24 @@ double VonMisesFisherGaussPeakShape::integrand(double phi) const
}
// ************************************************************************** //
// class
Von
MisesGaussPeakShape
// class MisesGaussPeakShape
// ************************************************************************** //
Von
MisesGaussPeakShape
::
Von
MisesGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
MisesGaussPeakShape
::
MisesGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
kvector_t
zenith
,
double
kappa
)
:
m_max_intensity
(
max_intensity
),
m_radial_size
(
radial_size
),
m_zenith
(
zenith
.
unit
()),
m_kappa
(
kappa
)
{
}
Von
MisesGaussPeakShape
::~
Von
MisesGaussPeakShape
()
=
default
;
MisesGaussPeakShape
::~
MisesGaussPeakShape
()
=
default
;
Von
MisesGaussPeakShape
*
Von
MisesGaussPeakShape
::
clone
()
const
MisesGaussPeakShape
*
MisesGaussPeakShape
::
clone
()
const
{
return
new
Von
MisesGaussPeakShape
(
m_max_intensity
,
m_radial_size
,
m_zenith
,
m_kappa
);
return
new
MisesGaussPeakShape
(
m_max_intensity
,
m_radial_size
,
m_zenith
,
m_kappa
);
}
double
Von
MisesGaussPeakShape
::
evaluate
(
const
kvector_t
q
,
const
kvector_t
q_lattice_point
)
const
double
MisesGaussPeakShape
::
evaluate
(
const
kvector_t
q
,
const
kvector_t
q_lattice_point
)
const
{
m_uy
=
m_zenith
.
cross
(
q_lattice_point
);
kvector_t
zxq
=
m_zenith
.
cross
(
q
);
...
...
@@ -295,13 +295,13 @@ double VonMisesGaussPeakShape::evaluate(const kvector_t q, const kvector_t q_lat
kvector_t
q_ortho
=
q
-
q
.
dot
(
m_zenith
)
*
m_zenith
;
m_phi
=
std
::
acos
(
q_ortho
.
unit
().
dot
(
m_ux
));
m_theta
=
std
::
acos
(
q
.
unit
().
dot
(
m_zenith
));
double
pre
=
Von
MisesPrefactor
(
m_kappa
);
double
pre
=
MisesPrefactor
(
m_kappa
);
double
integral
=
m_integrator
.
integrate
([
&
](
double
phi
)
->
double
{
return
integrand
(
phi
);
},
0.0
,
M_TWOPI
);
return
m_max_intensity
*
pre
*
integral
;
}
double
Von
MisesGaussPeakShape
::
integrand
(
double
phi
)
const
double
MisesGaussPeakShape
::
integrand
(
double
phi
)
const
{
kvector_t
q_rot
=
m_qr
*
(
std
::
sin
(
m_theta
)
*
std
::
cos
(
phi
)
*
m_ux
...
...
This diff is collapsed.
Click to expand it.
Core/Correlations/IPeakShape.h
+
19
−
12
View file @
5f9d6ff6
...
...
@@ -19,6 +19,7 @@
#include
"Core/Tools/Integrator.h"
#include
"Core/Vector/Vectors3D.h"
//! Pure virtual interface class that defines the peak shape of a Bragg peak.
//!
//! @ingroup samples_internal
...
...
@@ -38,6 +39,7 @@ public:
virtual
bool
angularDisorder
()
const
{
return
false
;
}
};
//! Class that implements an isotropic Gaussian peak shape of a Bragg peak.
//!
//! @ingroup samples_internal
...
...
@@ -60,6 +62,7 @@ private:
double
m_domainsize
;
};
//! Class that implements an isotropic Lorentzian peak shape of a Bragg peak.
//!
//! @ingroup samples_internal
...
...
@@ -82,8 +85,9 @@ private:
double
m_domainsize
;
};
//! Class that implements a peak shape that is Gaussian in the radial direction and
//! uses the
von
Mises-Fisher distribution in the angular direction.
//! uses the Mises-Fisher distribution in the angular direction.
//!
//! @ingroup samples_internal
...
...
@@ -107,8 +111,9 @@ private:
double
m_kappa
;
};
//! Class that implements a peak shape that is Lorentzian in the radial direction and
//! uses the
von
Mises-Fisher distribution in the angular direction.
//! uses the Mises-Fisher distribution in the angular direction.
//!
//! @ingroup samples_internal
...
...
@@ -132,20 +137,21 @@ private:
double
m_kappa
;
};
//! Class that implements a peak shape that is Gaussian in the radial direction and a
//! convolution of a
von
Mises-Fisher distribution with a
von
Mises distribution on the
//! convolution of a Mises-Fisher distribution with a Mises distribution on the
//! two-sphere
//!
//! @ingroup samples_internal
class
BA_CORE_API_
Von
MisesFisherGaussPeakShape
:
public
IPeakShape
class
BA_CORE_API_
MisesFisherGaussPeakShape
:
public
IPeakShape
{
public:
Von
MisesFisherGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
kvector_t
zenith
,
MisesFisherGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
kvector_t
zenith
,
double
kappa_1
,
double
kappa_2
);
~
Von
MisesFisherGaussPeakShape
()
override
;
~
MisesFisherGaussPeakShape
()
override
;
Von
MisesFisherGaussPeakShape
*
clone
()
const
override
;
MisesFisherGaussPeakShape
*
clone
()
const
override
;
void
accept
(
INodeVisitor
*
visitor
)
const
override
{
visitor
->
visit
(
this
);
}
...
...
@@ -164,19 +170,20 @@ private:
mutable
RealIntegrator
m_integrator
;
};
//! Class that implements a peak shape that is a convolution of a von Mises-Fisher distribution
//! Class that implements a peak shape that is a convolution of a Mises-Fisher distribution
//! with a 3d Gaussian
//!
//! @ingroup samples_internal
class
BA_CORE_API_
Von
MisesGaussPeakShape
:
public
IPeakShape
class
BA_CORE_API_
MisesGaussPeakShape
:
public
IPeakShape
{
public:
Von
MisesGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
kvector_t
zenith
,
MisesGaussPeakShape
(
double
max_intensity
,
double
radial_size
,
kvector_t
zenith
,
double
kappa
);
~
Von
MisesGaussPeakShape
()
override
;
~
MisesGaussPeakShape
()
override
;
Von
MisesGaussPeakShape
*
clone
()
const
override
;
MisesGaussPeakShape
*
clone
()
const
override
;
void
accept
(
INodeVisitor
*
visitor
)
const
override
{
visitor
->
visit
(
this
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment