Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/ModelMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "tip/IFileSvc.h"
#include "tip/Image.h"
#include "tip/Table.h"
#include "tip/Header.h"

#include "st_facilities/FitsUtil.h"

Expand Down Expand Up @@ -174,8 +175,16 @@ void ModelMap::writeOutputMap_wcs(const std::string & outfile,
if ( itr->getName().find("NAXIS") != std::string::npos ) {
continue;
}
output_header.append(*itr);
// append any new keywords and any new HISTORY or COMMENT keywords (some of these might end up duplicated)
// or update the value for any existing kewords. - TS 03/21/25
auto kwItr = output_header.find(itr->getName());
if (kwItr == output_header.end() || "COMMENT" == kwItr->getName() || "HISTORY" == kwItr->getName()){
output_header.append(*itr);
} else {
kwItr->setValue(itr->getValue());
}
}

if (outtype == "CMAP") {
output_header.erase("CTYPE3");
output_header.erase("CRPIX3");
Expand Down
Loading