Skip to content

Commit

Permalink
Fix transpose problem of FITS PC matrix found in CAS-9993
Browse files Browse the repository at this point in the history
  • Loading branch information
dpetry committed Jun 30, 2017
1 parent 3664f3e commit 4915e1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion coordinates/Coordinates/FITSCoordinateUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,14 @@ namespace casacore { //# NAMESPACE CASACORE - BEGIN
while (cunit(i).length() < 8) cunit(i) += " ";
}
//
pc = cSys.linearTransform();
Matrix<Double> imageLT = cSys.linearTransform();
pc = imageLT;
// need to transpose to conform with FITSKeywordUtil
for(uInt i=0; i<imageLT.nrow(); i++){
for(uInt j=0; j<imageLT.ncolumn(); j++){
pc(i,j) = imageLT(j,i);
}
}

return True;
}
Expand Down
2 changes: 1 addition & 1 deletion fits/FITS/FITSKeywordUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ Bool FITSKeywordUtil::addKeywords(FitsKeywordList &out,
Int ii = k % nrow + 1;
Int jj = k / nrow + 1;
ostringstream ostr;
if(nrow>9){
if(nrow>9){ // i.e. the indices have more than one digit
ostr << setfill('0') << setw(2) << ii
<< "_"
<< setfill('0') << setw(2) << jj;
Expand Down

0 comments on commit 4915e1c

Please sign in to comment.