DP3
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dp3::ddecal::TecConstraint Class Reference

#include <TecConstraint.h>

Inheritance diagram for dp3::ddecal::TecConstraint:
dp3::ddecal::Constraint dp3::ddecal::ApproximateTECConstraint

Public Types

enum class  Mode { kTecAndCommonScalar , kTecOnly }
 
- Public Types inherited from dp3::ddecal::Constraint
typedef std::complex< double > dcomplex
 

Public Member Functions

 TecConstraint (Mode mode)
 
void Apply (SolutionSpan &solutions, double time) override
 
std::vector< ConstraintResultGetResult () const override
 
void Initialize (size_t nAntennas, const std::vector< uint32_t > &solutions_per_direction, const std::vector< double > &frequencies) override
 
void setDoPhaseReference (bool doPhaseReference)
 
void SetWeights (const std::vector< double > &weights) final 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 SetSubSolutionWeights (const std::vector< std::vector< double >> &solution_weights)
 
virtual void SetWeights ([[maybe_unused]] const std::vector< double > &weights)
 

Protected Member Functions

virtual void initializeChild ()
 

Protected Attributes

bool do_phase_reference_
 
Mode mode_
 
std::vector< PhaseFitterphase_fitters_
 
std::vector< ConstraintResultresults_
 
std::vector< double > weights_
 

Additional Inherited Members

- Static Public Member Functions inherited from dp3::ddecal::Constraint
static bool isfinite (const dcomplex &value)
 

Member Enumeration Documentation

◆ Mode

Enumerator
kTecAndCommonScalar 

Solve for both a (differential) TEC and an XX/YY-common scalar

kTecOnly 

Solve only for a (differential) TEC value

Constructor & Destructor Documentation

◆ TecConstraint()

dp3::ddecal::TecConstraint::TecConstraint ( Mode  mode)

Member Function Documentation

◆ Apply()

void dp3::ddecal::TecConstraint::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.

Reimplemented in dp3::ddecal::ApproximateTECConstraint.

◆ GetResult()

std::vector<ConstraintResult> dp3::ddecal::TecConstraint::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.

Reimplemented in dp3::ddecal::ApproximateTECConstraint.

◆ Initialize()

void dp3::ddecal::TecConstraint::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.

◆ initializeChild()

virtual void dp3::ddecal::TecConstraint::initializeChild ( )
inlineprotectedvirtual

◆ setDoPhaseReference()

void dp3::ddecal::TecConstraint::setDoPhaseReference ( bool  doPhaseReference)
inline

Setter for doPhaseReference

◆ SetWeights()

void dp3::ddecal::TecConstraint::SetWeights ( const std::vector< double > &  weights)
finaloverride

Propagate weights to the phase fitters

Member Data Documentation

◆ do_phase_reference_

bool dp3::ddecal::TecConstraint::do_phase_reference_
protected

◆ mode_

Mode dp3::ddecal::TecConstraint::mode_
protected

◆ phase_fitters_

std::vector<PhaseFitter> dp3::ddecal::TecConstraint::phase_fitters_
protected

◆ results_

std::vector<ConstraintResult> dp3::ddecal::TecConstraint::results_
protected

◆ weights_

std::vector<double> dp3::ddecal::TecConstraint::weights_
protected

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