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

#include <BdaDdeCal.h>

Inheritance diagram for dp3::steps::BdaDdeCal:
dp3::steps::Step

Public Member Functions

 BdaDdeCal (const common::ParameterSet &parset, const std::string &prefix)
 
bool accepts (MsType dt) const override
 Boolean if this step can process this type of data. More...
 
void finish () override
 Finish the processing of this step and subsequent steps. More...
 
size_t GetChanBlockIndex (size_t channel, size_t n_channels, size_t n_channel_blocks) const
 
common::Fields getProvidedFields () const override
 
common::Fields getRequiredFields () const override
 Get the fields required by the current step. More...
 
MsType outputs () const override
 Return which datatype this step outputs. More...
 
bool process (std::unique_ptr< base::BdaBuffer >) override
 
void show (std::ostream &) const override
 Show the step parameters. More...
 
void showTimings (std::ostream &, double duration) const override
 
void updateInfo (const base::DPInfo &) override
 
- Public Member Functions inherited from dp3::steps::Step
 Step ()
 
virtual ~Step ()
 
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 bool process (std::unique_ptr< base::DPBuffer > buffer)
 
void setInfo (const base::DPInfo &)
 
virtual void setNextStep (Step::ShPtr nextStep)
 Set the next step. More...
 
void setPrevStep (Step *prevStep)
 Set the previous step. More...
 
virtual void showCounts (std::ostream &) const
 

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 Member Functions inherited from dp3::steps::Step
static void SetThreadingIsInitialized ()
 
- 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

Direction-dependent calibration steps that supports Baseline Dependent Averaging.

BdaDdeCal internally has multiple substeps: For each direction, it creates a series of steps. Each series starts with a Predict step. After the Predict step, some optional steps may run. Finally, each series ends with a BDAResultStep, which will contain the predicted visibilities for a direction.

Workflow for BdaDdeCal:

  1. BdaDdeCal receives a BdaBuffer using its process() function. This buffer must contain visibilities and weights. It may also contain predicted model data from earlier BdaDdeCal steps. Those earlier steps should have applied the solutions to the model data.
  2. BdaDdeCal forwards a metadata-only copy of the BdaBuffer to the Predict steps for all directions.
  3. BdaDdeCal adds the predicted visiblities to its main input BdaBuffer. 4.1. In only-predict mode, BdaDdeCal sums the predicted visibilities and sends them in a BdaBuffer to the next step. Processing is complete. 4.2. Otherwise, BdaDdeCal appends its main input BdaBuffer to a BdaSolverBuffer.
  4. BdaSolverBuffer weights all input and model visibilities.
  5. When the BdaSolverBuffer has a complete solution interval, BdaDdeCal runs the solver on this interval. The solver uses the weighted data.
  6. If needed, the BdaSolverBuffer applies the solutions to the unweighted model data in the current solution interval.
  7. When the BdaSolverBuffer has a complete BdaBuffer: 8.1. If subtracting is enabled, BdaDdeCal subtracts the model data (with the solutions applied) for all directions from the input data. 8.2. If keeping model data is disabled, BdaDdeCal removes the model data for all directions from the BdaBuffer. 8.3. BdaDdeCal passes the BdaBuffer to its next step. If keeping model data is enabled, this BdaBuffer includes the unweighted model data with the solutions applied.

If both subtracting and keeping model data are disabled, the unweighted model data is not needed anymore after weighting it. The BdaSolverBuffer therefore only stores the weighted model data in that case, saving memory.

The BdaBuffer structure/metadata remains equal for all BdaBuffers that are involved in one iteration.

The BdaSolverBuffer provides the functionality for solution intervals:

Constructor & Destructor Documentation

◆ BdaDdeCal()

dp3::steps::BdaDdeCal::BdaDdeCal ( const common::ParameterSet parset,
const std::string &  prefix 
)

Constructor.

Parameters
parsetA parameter set with settings for this class.
prefixPrefix for reading settings from the parameter set.

Member Function Documentation

◆ accepts()

bool dp3::steps::BdaDdeCal::accepts ( MsType  dt) const
inlineoverridevirtual

Boolean if this step can process this type of data.

Reimplemented from dp3::steps::Step.

◆ finish()

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

Finish the processing of this step and subsequent steps.

Implements dp3::steps::Step.

◆ GetChanBlockIndex()

size_t dp3::steps::BdaDdeCal::GetChanBlockIndex ( size_t  channel,
size_t  n_channels,
size_t  n_channel_blocks 
) const

Get the channel block index for a given channel.

Returns
Index of the channel block.

◆ getProvidedFields()

common::Fields dp3::steps::BdaDdeCal::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::BdaDdeCal::getRequiredFields ( ) const
overridevirtual

Get the fields required by the current step.

Implements dp3::steps::Step.

◆ outputs()

MsType dp3::steps::BdaDdeCal::outputs ( ) const
inlineoverridevirtual

Return which datatype this step outputs.

Reimplemented from dp3::steps::Step.

◆ process()

bool dp3::steps::BdaDdeCal::process ( std::unique_ptr< base::BdaBuffer )
overridevirtual

Process the BDA data. When processed, it invokes the process function of the next step. It should return False at the end.

Reimplemented from dp3::steps::Step.

◆ show()

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

Show the step parameters.

Implements dp3::steps::Step.

◆ showTimings()

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

Show the timings. The default implementation does nothing.

Reimplemented from dp3::steps::Step.

◆ updateInfo()

void dp3::steps::BdaDdeCal::updateInfo ( const base::DPInfo )
overridevirtual

Update the general info (called by setInfo). The default implementation copies the info.

Reimplemented from dp3::steps::Step.


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