Source
580
580
KrefFreqs_(ispw)=chanfreq(nch/2);
581
581
}
582
582
}
583
583
584
584
KrefFreqs_/=1.0e9; // in GHz
585
585
586
586
/// Re-assign KrefFreq_ according spwmap (if any)
587
587
if (spwMap().nelements()>0) {
588
588
Vector<Double> tmpfreqs;
589
589
tmpfreqs.assign(KrefFreqs_);
590
+
AlwaysAssert(spwMap().nelements()<=uInt(nSpw()),AipsError); // Should be guaranteed by now
590
591
for (uInt ispw=0;ispw<spwMap().nelements();++ispw)
591
592
if (spwMap()(ispw)>-1)
592
593
KrefFreqs_(ispw)=tmpfreqs(spwMap()(ispw));
593
594
}
594
595
595
596
596
597
}
597
598
void KJones::setApply() {
598
599
599
600
// Call parent to do conventional things
642
643
// Extract physical freq
643
644
KrefFreqs_.resize(nSpw());
644
645
for (Int ispw=0;ispw<nSpw();++ispw) {
645
646
const Vector<Double>& f(cpp_->freqIn(ispw));
646
647
Int nf=f.nelements();
647
648
KrefFreqs_[ispw]=f[nf/2]; // center (usually this will be same as [0])
648
649
}
649
650
}
650
651
KrefFreqs_/=1.0e9; // In GHz
651
652
653
+
// Manage spwmap in interim manner
654
+
spwMap().assign(callib.asRecord(0).asArrayInt("spwmap"));
655
+
656
+
// If more than one callib entry, currently have to assume spwmap uniformity
657
+
if (spwMap().nelements()>0 && callib.nfields()>3)
658
+
logSink() << LogIO::WARN << "Assuming uniform spwmap for frequency pivot point for all callib entries for caltable="
659
+
<< ct_->tableName()
660
+
<< ": spwmap = " << spwMap()
661
+
<< LogIO::POST;
662
+
663
+
// Catch spwmap that is too long
664
+
if (spwMap().nelements()>uInt(nSpw()))
665
+
throw(AipsError("Specified spwmap has more elements ("+String::toString(spwMap().nelements())+") than the number of spectral windows in the MS ("+String::toString(nSpw())+")."));
652
666
653
667
// Re-assign KrefFreq_ according spwmap (if any)
654
668
if (spwMap().nelements()>0) {
655
669
Vector<Double> tmpfreqs;
656
670
tmpfreqs.assign(KrefFreqs_);
671
+
AlwaysAssert(spwMap().nelements()<=uInt(nSpw()),AipsError); // Should be guaranteed by now
657
672
for (uInt ispw=0;ispw<spwMap().nelements();++ispw)
658
673
if (spwMap()(ispw)>-1)
659
674
KrefFreqs_(ispw)=tmpfreqs(spwMap()(ispw));
660
675
}
661
676
662
677
}
663
678
664
679
void KJones::setSolve(const Record& solve) {
665
680
666
681
// Call parent to do conventional things