-
Notifications
You must be signed in to change notification settings - Fork 21
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
tickets/DM-2931: truncation in Wcs persistence #30
Changes from all commits
76314ce
80e607d
d573fed
8cda15e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1102,13 +1102,22 @@ void Wcs::write(OutputArchiveHandle & handle) const { | |
handle.saveCatalog(catalog); | ||
} | ||
|
||
bool Wcs::isPersistable() const { | ||
bool Wcs::_mayBePersistable() const { | ||
if (_wcsInfo[0].naxis != 2) return false; | ||
if (std::strcmp(_wcsInfo[0].cunit[0], "deg") != 0) return false; | ||
if (std::strcmp(_wcsInfo[0].cunit[1], "deg") != 0) return false; | ||
|
||
return true; | ||
} | ||
|
||
bool Wcs::isPersistable() const { | ||
if (!_mayBePersistable()) { | ||
return false; | ||
} | ||
// The current table persistence only works for TAN and TAN-SIP projections | ||
return false; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wrote it that way as a template for derived classes. It doesn't cost enough to matter. |
||
Wcs::Wcs(afw::table::BaseRecord const & record) : | ||
daf::base::Citizen(typeid(this)), | ||
_wcsInfo(NULL), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the warning message below this block is incorrect: we should say we're just using the Wcs we got from the header.
By the way, I just refreshed my memory on when that warning is supposed to appear: it's when we couldn't load the object because it's defined in an extension package that's not setup. If the WCS wasn't saved in the tables at all, we'll just get a null pointer back, and the block above is in play. If the WCS was saved but it's been corrupted, we'll get an exception that propagates all the way up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the comment
I also note that we could check for wcsId == 0, but doing that would break the symmetry with e.g. Psf handing and I didn't want to fix all of them on this ticket.