#include <DipolePhaseFunction.hpp>
Public Member Functions | |
void | initialize (Random *random, bool includePolarization=false) |
void | peeloffScattering (double &I, double &Q, double &U, double &V, Direction bfk, Direction bfkobs, Direction bfky, const StokesVector *sv) const |
Direction | performScattering (Direction bfk, StokesVector *sv) const |
Private Member Functions | |
void | applyMueller (double theta, StokesVector *sv) const |
std::pair< double, double > | generateAnglesFromPhaseFunction (const StokesVector *sv) const |
double | generateCosineFromPhaseFunction () const |
double | phaseFunctionValue (double theta, double phi, const StokesVector *sv) const |
double | phaseFunctionValueForCosine (double costheta) const |
Private Attributes | |
bool | _includePolarization |
Array | _phi1v |
Array | _phicv |
Array | _phisv |
Array | _phiv |
Random * | _random |
The DipolePhaseFunction helper class represents the dipole scattering phase function, with optional support for polarization by scattering. For example, in a wide wavelength range, scattering of photons by electrons can be described by elastic and wavelength-independent Thomson scattering, which is in turn described using the dipole phase function. The corresponding Mueller matrix elements (and hence the phase function) can be expressed analytically as a function of just the scattering angle; see Bohren & Huffman (1998) or Wolf 2003 (Computer Physics Communications, 150, 99–115).
The implementation of this class is based on the analysis presented by Peest at al. 2017 (A&A, 601, A92).
|
private |
This function applies the Mueller matrix transformation for the specified scattering angle
For scattering by spherical particles, the Mueller matrix has only four independent coefficients. For dipole scattering, these can be analytically expressed as
|
private |
This function generates random scattering angles
For dipole scattering, we sample from the phase function listed for the phaseFunctionValue() function using the conditional probability technique. We reduce the phase function to the marginal distribution by integrating over
With the substitution
The corresponding cumulative distribution is
The equation
Once we have selected a random scattering angle
This can be done by numerically solving the equation
for
|
private |
This function generates a random scattering angle cosine sampled from the phase function
The phase function for unpolarized radiation is obtained from the general polarized case described for the phaseFunctionValue() function by setting the linear polarization degree
We can thus use the same procedure for sampling
void DipolePhaseFunction::initialize | ( | Random * | random, |
bool | includePolarization = false |
||
) |
This function caches a pointer to the simulation's random number generator and, if polarization is included, pre-calculates some data used for sampling from the corresponding phase function. The function must be called during setup (i.e. in single-thread mode). If includePolarization is omitted or set to false, calling the functions implementing the polarized phase function will cause undefined behavior.
void DipolePhaseFunction::peeloffScattering | ( | double & | I, |
double & | Q, | ||
double & | U, | ||
double & | V, | ||
Direction | bfk, | ||
Direction | bfkobs, | ||
Direction | bfky, | ||
const StokesVector * | sv | ||
) | const |
This function calculates the contribution of a dipole scattering event to the peel-off photon luminosity and polarization state for the given geometry and polarization state. The contributions to the Stokes vector components are stored in the I, Q, U, V arguments, which are guaranteed to be initialized to zero by the caller.
Direction DipolePhaseFunction::performScattering | ( | Direction | bfk, |
StokesVector * | sv | ||
) | const |
Given the incoming photon packet direction and polarization state, this function calculates and returns a randomly sampled new propagation direction for a dipole scattering event, and if applicable (depending in the polarization flag passed to the constructor), updates the polarization state of the photon packet along the way.
|
private |
This function returns the value of the scattering phase function
For dipole scattering, we can substitute the analytical expressions for the Mueller coefficients into the phase function, which leads to
where
|
private |
This function returns the value of the scattering phase function
The phase function for unpolarized radiation is obtained from the general polarized case described for the phaseFunctionValue() function by setting the linear polarization degree