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-11162: Replace all use of Coord and subclasses with SpherePoint #81

Merged
merged 2 commits into from Mar 23, 2018

Conversation

r-owen
Copy link
Contributor

@r-owen r-owen commented Mar 16, 2018

No description provided.

also use averageSpherePoint instead of averageCoord
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,

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?

Copy link
Contributor Author

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.

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.

Copy link
Contributor Author

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()),

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?

Copy link
Contributor Author

@r-owen r-owen Mar 22, 2018

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.)

Copy link

@rearmstr rearmstr 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, 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.
@r-owen r-owen merged commit 4169de5 into master Mar 23, 2018
@ktlim ktlim deleted the tickets/DM-11162 branch August 25, 2018 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants