Commits

George Moellenbrock authored 13295ed5f7c
Fixing CAS-12237, to CLPatchPanel.cc, added trap for absent antenna in caltable (SD context).
No tags

code/synthesis/CalTables/CLPatchPanel.cc

Modified
878 878 // (For now, we will do all MS ants)
879 879 Vector<Int> reqMSant(nMSAnt_);
880 880 indgen(reqMSant);
881 881 //cout << "reqMSant = " << reqMSant << endl;
882 882
883 883 // SLICE CalTable by OBS, FIELD, SPW, ANT, and map to
884 884 // the corresponding MS indicies
885 885
886 886 // WE DO TIME-ISH (OBS,FLD) AXES IN OUTER LOOPS
887 887
888 + // CalTable name might be needed below
889 + String ctname=Path(ct_.getPartNames()[0]).baseName().before(".tempMemCalTable");
890 +
888 891 NewCalTable obsselCT(ct_);
889 892 // The net CT obs required for the MS obs according to the obsmap
890 893 // We will create separate interpolator groups for each
891 894 Vector<Int> reqCTobs=cls.obsmap.ctids(reqMSobs);
892 895 //cout << "reqCTobs = " << reqCTobs << endl;
893 896 // For each required CT obs (and thus the MS obs ids requiring it)
894 897 for (uInt iCTobs=0;iCTobs<reqCTobs.nelements();++iCTobs) {
895 898 Int& thisCTobs=reqCTobs(iCTobs);
896 899
897 900 // The MS OBSs (subset of reqMSobs) to be calibrated by thisCTobs
979 982 CTCalPatchKey iclTres(icls,thisCTobs,thisCTfld,thisMSspw,-1);
980 983 clTres_[iclTres]=CLPPResult(nPar_,nFPar_,nChanIn_[thisCTspw],nMSElem_);
981 984
982 985 NewCalTable antselCT(spwselCT);
983 986 for (uInt iMSant=0;iMSant<reqMSant.nelements();++iMSant) {
984 987 Int& thisMSant=reqMSant(iMSant);
985 988 Int thisCTant=cls.antmap(thisMSant);
986 989 if (thisCTant<0) thisCTant=thisMSant;
987 990
988 991 // Apply thisCTant selection to CT
989 - this->selectOnCT(antselCT,spwselCT,"","","",String::toString(thisCTant));
992 + try {
993 + this->selectOnCT(antselCT,spwselCT,"","","",String::toString(thisCTant));
994 + }
995 + catch ( MSSelectionNullSelection x ) {
996 + // Log a warning about the missing antenna
997 + logsink_ << LogIO::WARN << " Found no calibration for MS ant Id=" << thisMSant << " (CT ant Id=" << thisCTant << ")"
998 + << " in MS spw Id=" << thisMSspw << " (CT spw Id=" << thisCTspw << ") (" << ctname << ")"
999 + << LogIO::POST;
1000 + // Step to next antenna
1001 + continue;
1002 + }
990 1003
991 - // (if null, warn and continue, or throw?)
992 -
993 1004 // Make the Cal Interpolator (icls is the CL slice index):
994 1005 CTCalPatchKey ici0(icls,thisCTobs,thisCTfld,thisCTspw,thisCTant); // all CT indices
995 1006 CTCalPatchKey ici1(icls,thisCTobs,thisCTfld,thisMSspw,thisMSant); // spw,ant are MS indices
996 1007 // (NB: Must use thisMSspw,thisMSant above to avoid duplication in resolved spwmap,antmap)
997 1008
998 1009 if (ci_.count(ici1)<1) {
999 1010 ciname_[ici1]=ici0.print()+" rows="+String::toString(antselCT.nrow());
1000 1011 Array<Float> r(clTres_[iclTres].result(thisMSant));
1001 1012 Array<Bool> rf(clTres_[iclTres].resultFlag(thisMSant));
1002 1013 ci_[ici1]=(*cttifactoryptr_)(antselCT,cls.tinterp,r,rf);

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

Add shortcut