DP3
Public Member Functions | List of all members
dp3::ddecal::FaradayConstraint Class Referencefinal

#include <FaradayConstraint.h>

Inheritance diagram for dp3::ddecal::FaradayConstraint:
dp3::ddecal::Constraint

Public Member Functions

 FaradayConstraint (base::CalType diagonal_solution_type, std::optional< double > max_rotation_value)
 
void Apply (SolutionSpan &solutions, double time) override
 
std::vector< ConstraintResultGetResult () const override
 
void Initialize (size_t n_antennas, const std::vector< uint32_t > &solutions_per_direction, const std::vector< double > &frequencies) override
 
void SetSubSolutionWeights (const std::vector< std::vector< double >> &sub_solution_weights) override
 
void SetWeights (const std::vector< double > &weights) override
 
- Public Member Functions inherited from dp3::ddecal::Constraint
virtual ~Constraint ()=default
 
void ApplyReferenceAntenna (SolutionSpan &solutions)
 
uint32_t GetSubSolutions (size_t direction) const
 
virtual void GetTimings ([[maybe_unused]] std::ostream &os, [[maybe_unused]] double duration) const
 
size_t NAntennas () const
 
size_t NChannelBlocks () const
 
size_t NDirections () const
 
size_t NSubSolutions () const
 
virtual void PrepareIteration ([[maybe_unused]] bool hasReachedPrecision, [[maybe_unused]] size_t iteration, [[maybe_unused]] bool finalIter)
 
virtual bool Satisfied () const
 
virtual void SetWeights ([[maybe_unused]] const std::vector< double > &weights)
 

Additional Inherited Members

- Public Types inherited from dp3::ddecal::Constraint
typedef std::complex< double > dcomplex
 
- Static Public Member Functions inherited from dp3::ddecal::Constraint
static bool isfinite (const dcomplex &value)
 

Constructor & Destructor Documentation

◆ FaradayConstraint()

dp3::ddecal::FaradayConstraint::FaradayConstraint ( base::CalType  diagonal_solution_type,
std::optional< double >  max_rotation_value 
)
inline

The diagonal solution type may be set to kRotational to fit differential Faraday rotation without a diagonal. @oaram max_rotation_value limits the search from -max_rotation_value to max_rotation_value. It is given in units of radians per meter.

Member Function Documentation

◆ Apply()

void dp3::ddecal::FaradayConstraint::Apply ( SolutionSpan solutions,
double  time 
)
overridevirtual

This method applies the constraints to the solutions.

Parameters
solutionsA 4D array with dimensions n_channel_blocks x n_antennas x n_sub_solutions x n_pol solutions. n_pol is the dimension with the fastest changing index. Using a span instead of a real tensor as argument type avoids the need for copying data in Python bindings.
timeCentral time of interval.

Implements dp3::ddecal::Constraint.

◆ GetResult()

std::vector<ConstraintResult> dp3::ddecal::FaradayConstraint::GetResult ( ) const
inlineoverridevirtual

Obtain results that are to be written to the solution file, instead of the actual solutions. Not all constraints use these; some constraints modify the solutions and the solutions are the result. Example of constraint the do produce results are the Faraday and TEC constraints.

Returns
Optionally, a vector with the last results. The vector is index by value type (e.g. Faraday rotation and scalar).

Reimplemented from dp3::ddecal::Constraint.

◆ Initialize()

void dp3::ddecal::FaradayConstraint::Initialize ( size_t  n_antennas,
const std::vector< uint32_t > &  solutions_per_direction,
const std::vector< double > &  frequencies 
)
overridevirtual

Perform common constraint initialization. Should be overridden when something more than assigning dimensions is needed (e.g. resizing vectors).

Parameters
frequenciesFor each channel block, the mean frequency.

Reimplemented from dp3::ddecal::Constraint.

◆ SetSubSolutionWeights()

void dp3::ddecal::FaradayConstraint::SetSubSolutionWeights ( const std::vector< std::vector< double >> &  solution_weights)
overridevirtual

Set direction dependent weights. It consists of n_sub_solutions vectors, each of which is an n_antennas * n_channel_blocks vector, where the channel index varies fastest.

If set, the normal weights are not used.

Reimplemented from dp3::ddecal::Constraint.

◆ SetWeights()

void dp3::ddecal::FaradayConstraint::SetWeights ( const std::vector< double > &  weights)
override

The documentation for this class was generated from the following file: