diff --git a/steps/InputStep.cc b/steps/InputStep.cc index 7b69ac1b86c53cde93cb6db9db2ff1c5be4e95f7..3c5e99129517e73ed93dced17d8604cbcfd9dd87 100644 --- a/steps/InputStep.cc +++ b/steps/InputStep.cc @@ -34,68 +34,6 @@ InputStep::~InputStep() {} std::string InputStep::msName() const { return std::string(); } -const Cube<bool>& InputStep::fetchFullResFlags(const base::DPBuffer& bufin, - base::DPBuffer& bufout, - common::NSTimer& timer, - bool merge) { - // If already defined in the buffer, return those fullRes flags. - if (!bufin.getFullResFlags().empty()) { - return bufin.getFullResFlags(); - } - // No fullRes flags in buffer, so get them from the input. - timer.stop(); - bool fnd = getFullResFlags(bufin.getRowNrs(), bufout); - timer.start(); - Cube<bool>& fullResFlags = bufout.getFullResFlags(); - if (!fnd) { - // No fullRes flags in input; form them from the flags in the buffer. - // Only use the XX flags; no averaging done, thus navgtime=1. - // (If any averaging was done, the flags would be in the buffer). - IPosition shp(bufin.getFlags().shape()); - if (fullResFlags.shape()[0] != shp[1] || fullResFlags.shape()[1] != 1 || - fullResFlags.shape()[2] != shp[2]) - throw std::runtime_error("Invalid shape of full res flags"); - casacore::objcopy(fullResFlags.data(), bufin.getFlags().data(), - fullResFlags.size(), 1, shp[0]); // only copy XX. - return fullResFlags; - } - // There are fullRes flags. - // If needed, merge them with the buffer's flags. - if (merge) { - DPBuffer::mergeFullResFlags(fullResFlags, bufin.getFlags()); - } - return fullResFlags; -} - -const Cube<float>& InputStep::fetchWeights(const DPBuffer& bufin, - DPBuffer& bufout, - common::NSTimer& timer) { - // If already defined in the buffer, return those weights. - if (!bufin.getWeights().empty()) { - return bufin.getWeights(); - } - // No weights in buffer, so get them from the input. - // It might need the data and flags in the buffer. - timer.stop(); - getWeights(bufin.getRowNrs(), bufout); - timer.start(); - return bufout.getWeights(); -} - -const Matrix<double>& InputStep::fetchUVW(const DPBuffer& bufin, - DPBuffer& bufout, - common::NSTimer& timer) { - // If already defined in the buffer, return those UVW. - if (!bufin.getUVW().empty()) { - return bufin.getUVW(); - } - // No UVW in buffer, so get them from the input. - timer.stop(); - getUVW(bufin.getRowNrs(), bufin.getTime(), bufout); - timer.start(); - return bufout.getUVW(); -} - void InputStep::getUVW(const RefRows&, double, DPBuffer&) { throw std::runtime_error("InputStep::getUVW not implemented"); } diff --git a/steps/InputStep.h b/steps/InputStep.h index 6822d34466f29167bea9b5350ed8c87aaaa40224..b1f4df08cd0955eff3942d0fe0df043208e0b1d5 100644 --- a/steps/InputStep.h +++ b/steps/InputStep.h @@ -33,14 +33,6 @@ namespace steps { /// data from a MeasurementSet. However, it is also possible to have /// input steps generating data on the fly as done in test programs /// like tAverager.cc. -/// -/// A particular task of the class is to fetch the input for various -/// data items like weight, uvw, etc.. This is done by testing if the -/// item's data array is in the DPBuffer. If so, it will be returned. -/// Otherwise the appropriate 'get' function will be called to read the -/// data array from the input. -/// The derived classes should implement those 'get' functions, unless -/// they are sure the data arrays are always put in the buffer. class InputStep : public Step { public: @@ -87,38 +79,6 @@ class InputStep : public Step { virtual double firstTime() const; virtual double lastTime() const; - /// Fetch the FullRes flags. - /// If defined in the buffer, they are taken from there. - /// Otherwise there are read from the input. - /// If not defined in the input, they are filled using the flags in the - /// buffer assuming that no averaging has been done so far. - /// If desired, they can be merged with the buffer's FLAG which means - /// that if an averaged channel is flagged, the corresponding FullRes - /// flags are set. - /// It does a stop/start of the timer when actually reading the data. - const casacore::Cube<bool>& fetchFullResFlags(const base::DPBuffer& bufin, - base::DPBuffer& bufout, - common::NSTimer& timer, - bool merge = false); - - /// Fetch the weights. - /// If defined in the buffer, they are taken from there. - /// Otherwise there are read from the input. - /// If they have to be read and if autoweighting is in effect, the buffer - /// must contain DATA to calculate the weights. - /// <br>It does a stop/start of the timer when actually reading the data. - const casacore::Cube<float>& fetchWeights(const base::DPBuffer& bufin, - base::DPBuffer& bufout, - common::NSTimer& timer); - - /// Fetch the UVW. - /// If defined in the buffer, they are taken from there. - /// Otherwise there are read from the input. - /// <br>It does a stop/start of the timer when actually reading the data. - const casacore::Matrix<double>& fetchUVW(const base::DPBuffer& bufin, - base::DPBuffer& bufout, - common::NSTimer& timer); - /// Check if a measurement set contains Baseline Dependent Averaged data. /// @param ms A casacore measurement set. /// @return true if the measurement set has BDA data, false if it is regular. diff --git a/steps/test/unit/mock/mockpystep.py b/steps/test/unit/mock/mockpystep.py index 52a14ff776aa171ca30b596f2643df36143bdc52..18274049e88e2016a8d9021a113c9d09e8c0d99c 100644 --- a/steps/test/unit/mock/mockpystep.py +++ b/steps/test/unit/mock/mockpystep.py @@ -15,8 +15,6 @@ class MockPyStep(Step): def __init__(self, parset, prefix): """ Set up the step (constructor). Read the parset here. - Set fetch_weights to True if the weights need to be read. - Similarly for fetch_uvw. Args: parset: Parameter set for the entire pipeline