Skip to content

Commit

Permalink
Fix errors in obs_lsst tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed May 5, 2023
1 parent 8cd116c commit f2bb445
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/geom/detail/frameSetUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ std::shared_ptr<ast::FrameSet> readFitsWcs(daf::base::PropertySet& metadata, boo
}

void stripWcsMetadata(daf::base::PropertySet &metadata) {
std::vector<double> crpixGrid(2);
try {
crpixGrid[0] = metadata.getAsDouble("CRPIX1");
crpixGrid[1] = metadata.getAsDouble("CRPIX2");
} catch (lsst::pex::exceptions::NotFoundError& e) {
// std::string used because e.what() returns a C string and two C strings cannot be added
throw LSST_EXCEPT(lsst::pex::exceptions::TypeError,
e.what() + std::string("; cannot read metadata as a SkyWcs"));
}

// Exclude WCS A keywords because LSST uses them to store XY0
auto wcsANames = createTrivialWcsMetadata("A", lsst::geom::Point2I(0, 0))->names();
std::set<std::string> excludeNames(wcsANames.begin(), wcsANames.end());
Expand Down

0 comments on commit f2bb445

Please sign in to comment.