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-41345: handle non-finite positions when calculating covariance #718

Merged
merged 3 commits into from
Nov 2, 2023

Conversation

parejkoj
Copy link
Contributor

No description provided.

Copy link
Contributor

@cmsaunders cmsaunders 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 to me. Thanks for cleaning up the rest of the function--I obviously forgot to run anything to check formatting on DM-15180!

Eigen::Matrix2d localMatrix = measurementToLocalGnomonic->getJacobian(center);
Eigen::Matrix2f d = localMatrix.cast < float > () * scale * (lsst::geom::PI / 180.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how those spaces got merged! Oops.

Eigen::Matrix2f calculateCoordCovariance(geom::SkyWcs const& wcs, lsst::geom::Point2D center, Eigen::Matrix2f err) {
Eigen::Matrix2f calculateCoordCovariance(geom::SkyWcs const &wcs, lsst::geom::Point2D center,
Eigen::Matrix2f err) {
if (!std::isfinite(center.getX()) || !std::isfinite(center.getY())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be the end result anyway, but I agree it's better to just skip going forward in this situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, if the center is non-finite, the computed skyCenter will be NaN and the call to geom::makeSkyWcs will raise because it's not a valid WCS.

If either position is NaN, the `makeSkyWcs` call further down will fail
because `skyCenter` is also NaN.
@parejkoj parejkoj merged commit 98a6847 into main Nov 2, 2023
2 checks passed
@parejkoj parejkoj deleted the tickets/DM-41345 branch November 2, 2023 20:21
arunkannawadi pushed a commit that referenced this pull request Dec 6, 2023
DM-41345: handle non-finite positions when calculating covariance
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.

2 participants