Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-10105: Avoid loss of precision in Wcs persistence. #212

Merged
merged 1 commit into from Apr 5, 2017

Conversation

TallJimbo
Copy link
Member

The old implementation round-tripped CRVAL through radians because it used Angle, which resulted in a loss of precision and inexactly persisted WCSs.

Copy link
Contributor

@parejkoj parejkoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Had two commentary-comments, but they don't require code changes.

with lsst.utils.tests.getTempFilePath(".fits") as fileName:
wcs1.writeFits(fileName)
wcs2 = lsst.afw.image.Wcs.readFits(fileName)
self.assertEqual(wcs1, wcs2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Exact equality here is probably good.

@@ -1082,7 +1082,8 @@ void Wcs::write(OutputArchiveHandle & handle) const {
WcsPersistenceHelper const & keys = WcsPersistenceHelper::get();
afw::table::BaseCatalog catalog = handle.makeCatalog(keys.schema);
PTR(afw::table::BaseRecord) record = catalog.addNew();
record->set(keys.crval, getSkyOrigin()->getPosition(afw::geom::degrees));
record->set(keys.crval.getX(), _wcsInfo[0].crval[0]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's sad that we can't use our Sky methods, but I guess it makes sense to do it this way in the internals.

The old implementation round-tripped CRVAL through radians because it
used Angle, which resulted in a loss of precision and inexactly
persisted WCSs.
@TallJimbo TallJimbo merged commit b7cf976 into master Apr 5, 2017
@ktlim ktlim deleted the tickets/DM-10105 branch August 25, 2018 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants