|
DP3
|
This class is the base class for classes that implement a constraint on calibration solutions. Constraints are used to increase the converge of calibration by applying these inside the solving step. More...
#include <Constraint.h>
Public Types | |
| typedef std::complex< double > | dcomplex |
Public Member Functions | |
| virtual | ~Constraint ()=default |
| virtual void | Apply (SolutionSpan &solutions, double time)=0 |
| void | ApplyReferenceAntenna (SolutionSpan &solutions) |
| virtual std::vector< ConstraintResult > | GetResult () const |
| uint32_t | GetSubSolutions (size_t direction) const |
| virtual void | GetTimings ([[maybe_unused]] std::ostream &os, [[maybe_unused]] double duration) const |
| virtual void | Initialize (size_t n_antennas, const std::vector< uint32_t > &solutions_per_direction, const std::vector< double > &frequencies) |
| 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) |
Static Public Member Functions | |
| static bool | isfinite (const dcomplex &value) |
This class is the base class for classes that implement a constraint on calibration solutions. Constraints are used to increase the converge of calibration by applying these inside the solving step.
The MultiDirSolver class uses this class for constrained calibration.
| typedef std::complex<double> dp3::ddecal::Constraint::dcomplex |
|
virtualdefault |
|
pure virtual |
This method applies the constraints to the solutions.
| solutions | A 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. |
| time | Central time of interval. |
Implemented in dp3::ddecal::TecOffsetDelayConstraint, dp3::ddecal::ApproximateTECConstraint, dp3::ddecal::TecConstraint, dp3::ddecal::SmoothnessConstraint, dp3::ddecal::RotationConstraint, dp3::ddecal::RotationAndDiagonalConstraint, dp3::ddecal::PolarizationLeakageConstraint, dp3::ddecal::FaradayConstraint, dp3::ddecal::AntennaIntervalConstraint, dp3::ddecal::AntennaConstraint, and dp3::ddecal::AmplitudeOnlyConstraint.
| void dp3::ddecal::Constraint::ApplyReferenceAntenna | ( | SolutionSpan & | solutions | ) |
Pick a suitable reference antenna that is >20% unflagged, and references the phases and amplitudes of all solutions to this antenna.
|
inlinevirtual |
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.
Reimplemented in dp3::ddecal::TecOffsetDelayConstraint, dp3::ddecal::ApproximateTECConstraint, dp3::ddecal::TecConstraint, dp3::ddecal::RotationConstraint, dp3::ddecal::RotationAndDiagonalConstraint, and dp3::ddecal::FaradayConstraint.
|
inline |
|
inlinevirtual |
|
inlinevirtual |
Perform common constraint initialization. Should be overridden when something more than assigning dimensions is needed (e.g. resizing vectors).
| frequencies | For each channel block, the mean frequency. |
Reimplemented in dp3::ddecal::TecOffsetDelayConstraint, dp3::ddecal::TecConstraint, dp3::ddecal::SmoothnessConstraint, dp3::ddecal::ScreenConstraint, dp3::ddecal::RotationConstraint, dp3::ddecal::RotationAndDiagonalConstraint, dp3::ddecal::FaradayConstraint, and dp3::ddecal::AntennaIntervalConstraint.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
Number of subsolutions over all directions, taking into account that a direction maybe have multiple intervals. This is the sum over solutions_per_direction_.
|
inlinevirtual |
Function that initializes the constraint for the next calibration iteration. It should be called each time all antenna solutions have been calculated, but before the constraint has been applied to all those antenna solutions.
Unlike Apply(), this method is not thread safe.
| hasReachedPrecision | This can be used to specify whether the previous solution "step" is smaller than the requested precision, i.e. calibration with the constraint has converged. This allows a constraint to apply its constraint in steps: apply a better-converging constraint as long as the solutions are far from the correct answer, then switch to a different constraint when hasReachedPrecision=true. |
|
inlinevirtual |
Whether the constraint has been satisfied. The calibration process will continue at least as long as Satisfied()=false, and performs at least one more iteration after Satisfied()=true. Together with SetPrecisionReached(), this can make the algorithm change the constraining method based on amount of convergence.
Reimplemented in dp3::ddecal::ApproximateTECConstraint.
|
inlinevirtual |
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 in dp3::ddecal::SmoothnessConstraint, and dp3::ddecal::FaradayConstraint.
|
inlinevirtual |
Set weights. The vector should contain the flattened version of an array of size n_antennas * n_channel_blocks, where the channel index varies fastest.