Commits

Ville Suoranta authored 09899e7025f Merge
Merge pull request #378 in CASA/casa6 from CAS-13270 to master

* commit 'c64451fed8081b0fb010352b2434b719da8e9c11': CAS-13270: Add gencal caltype='tsys' tests CAS-13270: Reject NaN Tsys values

casa5/code/synthesis/MeasurementComponents/TsysGainCal.cc

Modified
260 260 for (uInt iant=0;iant<ants.nelements();++iant) {
261 261 Int thisant=ants(iant);
262 262 blc(2)=trc(2)=thisant; // the MS antenna index (not loop index)
263 263 Array<Float> currtsys(tsys.xyPlane(iant));
264 264 solveAllRPar()(blc,trc).nonDegenerate(2)=currtsys;
265 265 solveAllParOK()(blc,trc)=true;
266 266
267 267 // Increment tsys counter
268 268 ++tsyscount(ispw,thisant);
269 269
270 - negTsys(ispw,thisant)+=ntrue(currtsys<FLT_MIN);
270 + negTsys(ispw,thisant)+=nfalse(currtsys>=FLT_MIN);
271 271
272 272 // Issue warnings for completely bogus Tsys spectra (per pol)
273 273 for (Int ipol=0;ipol<npol;++ipol) {
274 - if (nfalse(Matrix<Float>(currtsys).row(ipol)<FLT_MIN)==0)
274 + if (ntrue(Matrix<Float>(currtsys).row(ipol)>=FLT_MIN)==0)
275 275 logSink() << " Tsys data for ant id="
276 276 << thisant << " (pol=" << ipol<< ")"
277 277 << " in spw " << ispw
278 278 << " at t=" << MVTime(refTime()/C::day).string(MVTime::YMD,7)
279 279 << " are all negative or zero will be entirely flagged."
280 280 << LogIO::WARN << LogIO::POST;
281 281 }
282 282 }
283 283 // Flag any Tsys<=0.0
284 284
285 - LogicalArray mask((solveAllRPar()<FLT_MIN));
286 - MaskedArray<Bool> negs(solveAllParOK(),mask);
285 + LogicalArray mask((solveAllRPar()>=FLT_MIN));
286 + MaskedArray<Bool> negs(solveAllParOK(),!mask);
287 287 negs=false;
288 288
289 289 Bool uniform=True;
290 290 if (specify.isDefined("uniform"))
291 291 uniform=specify.asBool("uniform");
292 292
293 293 if (uniform)
294 294 keepNCT();
295 295 else
296 296 keepNCT(ants);

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

Add shortcut