Commits

David Mehringer authored e415b33265a
add support for user to specify min number of points
No tags

code/mstransform/MSTransform/StatWt.cc

Modified
80 80 _chanBinWidthInt.reset(new uInt(w));
81 81 _chanBinWidthQ.reset();
82 82 }
83 83
84 84 void StatWt::setChanBinWidth(const casacore::Quantity& w) {
85 85 QuantumHolder qh(w);
86 86 _chanBinWidthQ.reset(new Record(qh.toRecord()));
87 87 _chanBinWidthInt.reset();
88 88 }
89 89
90 +void StatWt::setMinSample(casacore::uInt m) {
91 + _minSample = m;
92 +}
90 93
91 94 void StatWt::writeWeights() const {
92 95 vi::IteratingParameters ipar(_timeBinWidth);
93 96 vi::VisIterImpl2LayerFactory data(_ms, ipar, True);
94 97 Record config;
95 98 if (_chanBinWidthInt) {
96 99 config.define("chanbin", *_chanBinWidthInt);
97 100 }
98 101 else if (_chanBinWidthQ) {
99 102 config.defineRecord("chanbin", *_chanBinWidthQ);
100 103 }
104 + config.define("minsamp", _minSample);
101 105 vi::StatWtTVILayerFactory statWtLayerFactory(config);
102 106 Vector<vi::ViiLayerFactory*> facts(2);
103 107 facts[0] = &data;
104 108 facts[1] = &statWtLayerFactory;
105 109 vi::VisibilityIterator2 vi(facts);
106 110 vi::VisBuffer2 *vb = vi.getVisBuffer();
107 111 Slice defaultSlice;
108 112 Vector<Int> vr(1);
109 113 static const String WEIGHT = "WEIGHT";
110 114 static const String WEIGHT_SPECTRUM = "WEIGHT_SPECTRUM";

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut