25 #include "boost/make_shared.hpp"
31 namespace except = lsst::pex::exceptions;
49 auto modifyable =
false;
52 if (metadata->exists(
"CTYPE1") && metadata->exists(
"CTYPE2")) {
53 ctype1 = metadata->getAsString(
"CTYPE1");
54 ctype2 = metadata->getAsString(
"CTYPE2");
66 auto log = Log(Log::getDefaultLog(),
"makeWcs");
68 if (ctype1.substr(5, 3) ==
"TAN" &&
69 (metadata->exists(
"PV1_5") || metadata->exists(
"PV2_1"))) {
77 ctype1.replace(5, 3,
"TPV");
78 metadata->set<std::string>(
"CTYPE1",
ctype1);
80 ctype2.replace(5, 3,
"TPV");
81 metadata->set<std::string>(
"CTYPE2",
ctype2);
85 if (ctype1.substr(5, 3) ==
"TAN") {
87 }
else if (ctype1.substr(5, 3) ==
"TPV") {
95 metadata->set<std::string>(
"CTYPE1",
"RA---TAN");
96 metadata->set<std::string>(
"CTYPE2",
"DEC--TAN");
97 metadata->set<
bool>(
"TPV_WCS",
true);
104 for (
int i = 0; i != 2; ++i) {
105 for (
int j = 1; j <= 39; ++j) {
107 sprintf(pvName,
"PV%d_%d", i, j);
108 if (metadata->exists(pvName)) {
109 metadata->remove(pvName);
121 std::string key =
"LTV1";
122 if (metadata->exists(key)) {
123 wcs->shiftReferencePixel(-metadata->getAsDouble(key), 0);
127 if (metadata->exists(key) ) {
128 wcs->shiftReferencePixel(0, -metadata->getAsDouble(key));
150 CD << CD11, CD12, CD21, CD22;
boost::shared_ptr< Wcs > Ptr
table::PointKey< double > crval
Implementation of the WCS standard for a any projection.
table::Key< std::string > ctype2
a place to record messages and descriptions of the state of processing.
table::Key< table::Array< Kernel::Pixel > > image
Wcs::Ptr makeWcs(boost::shared_ptr< lsst::daf::base::PropertySet > const &fitsMetadata, bool stripMetadata=false)
Implementation of the WCS standard for the special case of the Gnomonic (tangent plane) projection...
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Class for storing generic metadata.
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
virtual Ptr deepCopy(void) const
int stripWcsKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > const &metadata, boost::shared_ptr< Wcs const > const &wcs)
daf::base::PropertySet & _metadata
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
table::Key< std::string > ctype1
table::PointKey< double > crpix