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-11162: Replace all use of Coord and subclasses with SpherePoint #81
Conversation
also use averageSpherePoint instead of averageCoord
tests/test_fitTanSipWcsHighOrder.py
Outdated
self.tanWcs = afwGeom.makeSkyWcs(metadata) | ||
self.tanWcs = afwGeom.makeSkyWcs(crpix=self.crPix, | ||
crval=afwGeom.SpherePoint(215.5, 53.0, afwGeom.degrees), | ||
cdMatrix=afwGeom.makeCdMatrix(scale=5.1e-5*afwGeom.degrees, |
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.
Is there a need to simplify the cdMatrix here?
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 don't understand the question. The primary changes is to use makeSkyWcs(crpix, ...)
instead of makeSkyWcs(metadata)
, saving the hassle of creating a bunch of FITS-WCS metadata. makeSkyWcs(crpix, ...)
requires a CD matrix and makeCdMatrix
is the easiest way I know of to make one.
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.
Yeah, sorry I wasn't explicit. Your new cdMatrix has only a scale and rotation. The previous cdMatrix looks like it is more complicated with some shear.
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.
Good point. I missed the difference between CD2_1 and CD1_2. I'll restore the original values. I've never seen a CD matrix like that before. I wonder if it was intentional.
np.random.uniform(low=bbox.getMinX(), high=bbox.getMaxX()), | ||
np.random.uniform(low=bbox.getMinY(), high=bbox.getMaxY()) | ||
np.random.uniform(low=bbox.getMinY(), high=bbox.getMaxY()), |
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.
Is this trailing comma needed?
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 is not necessary but it is good Python style because it allows reordering elements and removing elements safely. (A trailing comma on the last entry is necessary only when the tuple has 1 element.)
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.
Looks good, a few minor comments.
Create WCS using crpix, etc. instead of setting FITS metadata. The result is shorter and easier to read. Note that the initial WCS data is for ICRS instead of FK5, but this has no effect on the tests.
1c519b1
to
4169de5
Compare
No description provided.