DP3
Public Member Functions | Static Public Member Functions | List of all members
dp3::steps::ApplyCal Class Reference

DP3 step class to ApplyCal visibilities from a source model. More...

#include <ApplyCal.h>

Inheritance diagram for dp3::steps::ApplyCal:
dp3::steps::Step

Public Member Functions

 ApplyCal ()=default
 
 ApplyCal (const common::ParameterSet &, const std::string &prefix, bool substep=false, std::string predictDirection="")
 
 ~ApplyCal () override=default
 
void finish () override
 Finish the processing of this step and subsequent steps. More...
 
common::Fields getProvidedFields () const override
 
common::Fields getRequiredFields () const override
 Get the fields required by the current step. More...
 
bool process (std::unique_ptr< base::DPBuffer > buffer) override
 
void setNextStep (Step::ShPtr nextStep) override
 
void show (std::ostream &) const override
 
void showTimings (std::ostream &, double duration) const override
 
- Public Member Functions inherited from dp3::steps::Step
 Step ()
 
virtual ~Step ()
 
virtual bool accepts (MsType dt) const
 Boolean if this step can process this type of data. More...
 
const base::DPInfogetInfoIn () const
 Get access to the info of the input. More...
 
const base::DPInfogetInfoOut () const
 Get access to the info of the output. More...
 
const Step::ShPtrgetNextStep () const
 Get the next step. More...
 
StepgetPrevStep () const
 Get the previous step. More...
 
virtual MsType outputs () const
 Return which datatype this step outputs. More...
 
virtual bool process (std::unique_ptr< base::BdaBuffer >)
 
void setInfo (const base::DPInfo &)
 
void setPrevStep (Step *prevStep)
 Set the previous step. More...
 
virtual void showCounts (std::ostream &) const
 
virtual void updateInfo (const base::DPInfo &)
 

Static Public Member Functions

static void ApplyDiag (const aocommon::MC2x2FDiag &gain_a, const aocommon::MC2x2FDiag &gain_b, base::DPBuffer &buffer, unsigned int baseline, unsigned int channel, bool update_weights, base::FlagCounter &flag_counter, const std::string &direction="")
 Apply a diagonal Jones matrix to the 2x2 visibilities matrix: A.V.B^H. More...
 
static void ApplyFull (const aocommon::MC2x2F &gain_a, const aocommon::MC2x2F &gain_b, base::DPBuffer &buffer, unsigned int baseline, unsigned int channel, bool update_weights, base::FlagCounter &flag_counter, const std::string &direction="")
 
static void ApplyScalar (const std::complex< float > &gain_a, const std::complex< float > &gain_b, base::DPBuffer &buffer, unsigned int baseline, unsigned int channel, bool update_weights, base::FlagCounter &flag_counter)
 
static void ApplyWeights (const aocommon::MC2x2F &gain_a, const aocommon::MC2x2F &gain_b, float *weight)
 
template<typename NumType >
static void invert (std::complex< NumType > *v)
 Invert a 2x2 matrix in place. More...
 
- Static Public Member Functions inherited from dp3::steps::Step
static void SetThreadingIsInitialized ()
 

Additional Inherited Members

- Public Types inherited from dp3::steps::Step
enum class  MsType { kRegular , kBda }
 To check compatibility between steps before running. More...
 
typedef std::shared_ptr< StepShPtr
 
- Static Public Attributes inherited from dp3::steps::Step
static constexpr dp3::common::Fields kDataField
 
static constexpr dp3::common::Fields kFlagsField
 
static constexpr dp3::common::Fields kUvwField
 
static constexpr dp3::common::Fields kWeightsField
 
- Protected Member Functions inherited from dp3::steps::Step
virtual void addToMS (const std::string &msName)
 
base::DPInfoGetWritableInfoOut ()
 

Detailed Description

DP3 step class to ApplyCal visibilities from a source model.

This class is a Step class to apply multiple ParmDB or H5Parm solutions to data.

Constructor & Destructor Documentation

◆ ApplyCal() [1/2]

dp3::steps::ApplyCal::ApplyCal ( const common::ParameterSet ,
const std::string &  prefix,
bool  substep = false,
std::string  predictDirection = "" 
)

Construct the object. Parameters are obtained from the parset using the given prefix.

◆ ApplyCal() [2/2]

dp3::steps::ApplyCal::ApplyCal ( )
default

◆ ~ApplyCal()

dp3::steps::ApplyCal::~ApplyCal ( )
overridedefault

Member Function Documentation

◆ ApplyDiag()

static void dp3::steps::ApplyCal::ApplyDiag ( const aocommon::MC2x2FDiag &  gain_a,
const aocommon::MC2x2FDiag &  gain_b,
base::DPBuffer buffer,
unsigned int  baseline,
unsigned int  channel,
bool  update_weights,
base::FlagCounter flag_counter,
const std::string &  direction = "" 
)
static

Apply a diagonal Jones matrix to the 2x2 visibilities matrix: A.V.B^H.

◆ ApplyFull()

static void dp3::steps::ApplyCal::ApplyFull ( const aocommon::MC2x2F &  gain_a,
const aocommon::MC2x2F &  gain_b,
base::DPBuffer buffer,
unsigned int  baseline,
unsigned int  channel,
bool  update_weights,
base::FlagCounter flag_counter,
const std::string &  direction = "" 
)
static

Apply a full Jones matrix to a 2x2 visibilities matrix: A.V.B^H

Parameters
bufferApplyFull updates the visibilities, flags and weights in this buffer.
baselineThe baseline index for the visibility.
channelThe channel index for the visibility.

◆ ApplyScalar()

static void dp3::steps::ApplyCal::ApplyScalar ( const std::complex< float > &  gain_a,
const std::complex< float > &  gain_b,
base::DPBuffer buffer,
unsigned int  baseline,
unsigned int  channel,
bool  update_weights,
base::FlagCounter flag_counter 
)
static

Apply a diagonal Jones matrix to the 2x2 visibilities matrix: A.V.B^H, where the solution is equal for both polarizations

◆ ApplyWeights()

static void dp3::steps::ApplyCal::ApplyWeights ( const aocommon::MC2x2F &  gain_a,
const aocommon::MC2x2F &  gain_b,
float *  weight 
)
static

Do the same as the combination of BBS + python script covariance2weight.py (cookbook), except it stores weights per freq. The diagonal of covariance matrix is transferred to the weights. Note that the real covariance (mixing of noise terms after which they are not independent anymore) is not stored. The input covariance matrix C is assumed to be diagonal with elements w_i (the weights), the result the diagonal of (gainA kronecker gainB^H).C.(gainA kronecker gainB^H)^H

◆ finish()

void dp3::steps::ApplyCal::finish ( )
overridevirtual

Finish the processing of this step and subsequent steps.

Implements dp3::steps::Step.

◆ getProvidedFields()

common::Fields dp3::steps::ApplyCal::getProvidedFields ( ) const
inlineoverridevirtual

Get the fields provided (modified and/or created) by the current step. The returned fields thus should not include (required) fields that are forwarded without modifications.

Implements dp3::steps::Step.

◆ getRequiredFields()

common::Fields dp3::steps::ApplyCal::getRequiredFields ( ) const
inlineoverridevirtual

Get the fields required by the current step.

Implements dp3::steps::Step.

◆ invert()

template<typename NumType >
static void dp3::steps::ApplyCal::invert ( std::complex< NumType > *  v)
static

Invert a 2x2 matrix in place.

◆ process()

bool dp3::steps::ApplyCal::process ( std::unique_ptr< base::DPBuffer buffer)
overridevirtual

Process the data. It keeps the data. When processed, it invokes the process function of the next step.

Reimplemented from dp3::steps::Step.

◆ setNextStep()

void dp3::steps::ApplyCal::setNextStep ( Step::ShPtr  nextStep)
overridevirtual

Set the next step. It squeezes in the actual OneApplyCal steps between this ApplyCal step and the next step.

Reimplemented from dp3::steps::Step.

◆ show()

void dp3::steps::ApplyCal::show ( std::ostream &  ) const
overridevirtual

Show the step. When ApplyCal is a step in the main chain, this does nothing; the nextStep mechanism in DPRun will call show on the actual OneApplyCals.

Implements dp3::steps::Step.

◆ showTimings()

void dp3::steps::ApplyCal::showTimings ( std::ostream &  ,
double  duration 
) const
overridevirtual

Show the timings. When ApplyCal is a step in the main chain, this does nothing; the nextStep mechanism in DPRun will call show on the actual OneApplyCals.

Reimplemented from dp3::steps::Step.


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