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

#include <SmoothnessConstraint.h>

Inheritance diagram for dp3::ddecal::SmoothnessConstraint:
dp3::ddecal::Constraint

Public Member Functions

 SmoothnessConstraint (double bandwidth_hz, double bandwidth_ref_frequency_hz, double spectral_exponent, bool kernel_truncation)
 
void Apply (SolutionSpan &solutions, double time) override
 
const std::vector< double > & GetAntennaFactors () const
 
const std::vector< double > & GetDdSmoothingFactors () const
 
void Initialize (size_t nAntennas, const std::vector< uint32_t > &solutions_per_direction, const std::vector< double > &frequencies) override
 
void SetAntennaFactors (std::vector< double > &&antenna_factors)
 
void SetDdSmoothingFactors (std::vector< double > dd_smoothing_factors)
 
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)
 
virtual std::vector< ConstraintResultGetResult () const
 
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

◆ SmoothnessConstraint()

dp3::ddecal::SmoothnessConstraint::SmoothnessConstraint ( double  bandwidth_hz,
double  bandwidth_ref_frequency_hz,
double  spectral_exponent,
bool  kernel_truncation 
)
Parameters
bandwidth_hzSize of the kernel (smoothing strength)
bandwidth_ref_frequency_hzReference frequency for the kernel size, may be zero to have a constant kernel size over frequency.
See also
KernelSmoother documentation.

Member Function Documentation

◆ Apply()

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

◆ GetAntennaFactors()

const std::vector<double>& dp3::ddecal::SmoothnessConstraint::GetAntennaFactors ( ) const
inline

◆ GetDdSmoothingFactors()

const std::vector<double>& dp3::ddecal::SmoothnessConstraint::GetDdSmoothingFactors ( ) const
inline

◆ Initialize()

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

◆ SetAntennaFactors()

void dp3::ddecal::SmoothnessConstraint::SetAntennaFactors ( std::vector< double > &&  antenna_factors)
inline

Set antenna smoothness factors that can control the amount of smoothing per antenna. One option is e.g. to let this depend on the distance to the array centre.

Note
Because distance is the common use-case for these factors, the factors work opposite of the dd smoothing factors: higher values cause less smoothing.
Parameters
antenna_factorsvector where each element is a smoothing correction factor for each antenna. A higher correction factor will perform stronger smoothing in frequency direction.

◆ SetDdSmoothingFactors()

void dp3::ddecal::SmoothnessConstraint::SetDdSmoothingFactors ( std::vector< double >  dd_smoothing_factors)

Sets an extra (cummulative) smoothing factor for directions (and dd solution intervals).

Note
that these factors have opposite meaning of those for SetAntennaFactors().
Parameters
dd_smoothing_factorsshould be of size NSubSolutions(), i.e. it should have a factor for each direction and the possible subsolutions per direction. The otherwise specified smoothing kernel size is multiplied with these factors, which means that higher values will cause stronger smoothing. If empty, all factors are assumed to be one.

◆ SetSubSolutionWeights()

void dp3::ddecal::SmoothnessConstraint::SetSubSolutionWeights ( const std::vector< std::vector< double >> &  solution_weights)
inlineoverridevirtual

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::SmoothnessConstraint::SetWeights ( const std::vector< double > &  weights)
inlineoverride

Set the weights to be used during smoothing.

Parameters
weightsAn array of n_antenna x n_channel_blocks.

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