Source
1762
1762
casa_param(4*icor + 2, iant) = gsl_vector_get(res, iparam+2);
1763
1763
casa_param(4*icor + 3, iant) = 0.0;
1764
1764
for (size_t i=0; i!=3; i++) {
1765
1765
casa_snr(4*icor + i, iant) = gsl_vector_get(snr_vector, iparam+0);
1766
1766
}
1767
1767
} else { // gsl solver failed; flag data
1768
1768
logSink << "Least-squares solver failed to converge; flagging" << endl;
1769
1769
casa_flags(4*icor + 0, iant) = false;
1770
1770
casa_flags(4*icor + 1, iant) = false;
1771
1771
casa_flags(4*icor + 2, iant) = false;
1772
+
casa_flags(4*icor + 3, iant) = false;
1772
1773
}
1773
1774
}
1774
1775
1775
1776
logSink << "Least squares complete for correlation " << icor
1776
1777
<< " after " << gsl_multilarge_nlinear_niter(w) << " iterations." << LogIO::POST;
1777
1778
1778
1779
// << "reason for stopping: " << ((info == 1) ? "small step size" : "small gradient") << endl
1779
1780
// << "initial |f(x)| = " << chi0 << endl
1780
1781
// << "final |f(x)| = " << chi1 << endl
1781
1782
// << "final step taken = " << diffsize
2214
2215
Matrix<Float> sRP(solveRPar().nonDegenerate(1));
2215
2216
Matrix<Bool> sPok(solveParOK().nonDegenerate(1));
2216
2217
Matrix<Float> sSNR(solveParSNR().nonDegenerate(1));
2217
2218
logSink() << "sPok " << sPok.shape() << LogIO::POST;
2218
2219
2219
2220
// Map from MS antenna number to index
2220
2221
// transcribe fft results to sRP
2221
2222
Int ncol = drf.param().ncolumn();
2222
2223
Int nrow = drf.param().nrow();
2223
2224
2224
-
std::cerr << "nrow " << nrow << ", ncol " << ncol << endl;
2225
-
std::cerr << "drf.flag() " << drf.flag() << endl;
2226
2225
for (Int i=0; i!=ncol; i++) {
2227
2226
for (Int j=0; j!=nrow; j++) {
2228
2227
Int oj = (j>=3) ? j+1 : j;
2229
2228
sRP(IPosition(2, oj, i)) = drf.param()(IPosition(2, j, i));
2230
2229
sPok(IPosition(2, oj, i)) = !(drf.flag()(IPosition(2, j, i)));
2231
2230
}
2232
2231
// Our estimate for dispersion is zero, unconditionally, and we stand by it.
2233
2232
sPok(IPosition(2, 3, i)) = true;
2234
2233
if (nrow > 3)
2235
2234
sPok(IPosition(2, 7, i)) = true;