Skip to content

Commit

Permalink
Merge pull request #1341 from casacore/msfitsreceptorangles
Browse files Browse the repository at this point in the history
Make export to UVFits work with non-constant receptor angles
  • Loading branch information
dpetry committed Apr 2, 2024
2 parents c6c5513 + cb6ae15 commit 7ebb89f
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions msfits/MSFits/MSFitsOutput.cc
Expand Up @@ -1850,11 +1850,11 @@ Bool MSFitsOutput::_writeAN(std::shared_ptr<FitsOutput> output, const Measuremen
// inicates that row applies for all spectral windows
if (
Int(antnum) == inantid(i)
&& (
spwids(i) == -1
|| uSpws.find(spwids(i)) != uSpws.end()
)
) {
&& (
spwids(i) == -1
|| uSpws.find(spwids(i)) != uSpws.end()
)
) {
found = True;
Vector<String> poltypes = inpoltype(i);
Vector<Quantity> ra;
Expand All @@ -1871,10 +1871,19 @@ Bool MSFitsOutput::_writeAN(std::shared_ptr<FitsOutput> output, const Measuremen
antToRA[antnum] = ra;
}
else {
_checkReceptorAngles(ra, antToRA[antnum], antnum);
try {
_checkReceptorAngles(ra, antToRA[antnum], antnum);
}
catch (const std::exception& x) {
os << LogOrigin("MSFitsOutput", __func__)
<< LogIO::WARN << "Receptor Angles in FEED table are not constant for antenna " << antnum
<< ". Will try to ignore this. If this data is not yet calibrated, a future calibration of the uvfits data may fail: "
<< x.what() << LogIO::POST;
}
}
}
}

if (!found) {
os << LogIO::SEVERE
<< "Could not find polarization types for antenna "
Expand Down

0 comments on commit 7ebb89f

Please sign in to comment.