Skip to content

Fixes to sgr coordinates example - #5541

Merged
mhvk merged 9 commits into
astropy:masterfrom
adrn:coordinates/fix-sgr-example
Dec 5, 2016
Merged

mhvk merged 9 commits into
astropy:masterfrom
adrn:coordinates/fix-sgr-example

Conversation

@adrn

@adrn adrn commented Dec 2, 2016

Copy link
Copy Markdown
Member

This is a replacement for #5210 that changes the transformation to the Sagittarius plane coordinate from a function transform to a matrix transform. This simplifies the transform code and makes it more consistent with the other implemented transformations.

cc @eteq @mhvk

@astrofrog astrofrog added this to the v1.3.0 milestone Dec 2, 2016
@pllim pllim added Affects-dev PRs and issues that do not impact an existing Astropy release coordinates Docs labels Dec 2, 2016
@astrofrog

Copy link
Copy Markdown
Member

@adrn - can you rebase to get the proper CircleCI configuration?

@astrofrog astrofrog assigned eteq and mhvk and unassigned eteq Dec 2, 2016
@adrn
adrn force-pushed the coordinates/fix-sgr-example branch from 1c8316f to b0a6a44 Compare December 2, 2016 18:11
@eteq

eteq commented Dec 2, 2016

Copy link
Copy Markdown
Member

Nice! Glad I looked over the recent PR's before I started trying to fix up #5210 😉 will review shortly.

@adrn

adrn commented Dec 3, 2016

Copy link
Copy Markdown
Member Author

@astrofrog Rebased - build failure is just a canceled OSX build

# This is done at the module level, since it will be used by both the
# transformation from Sgr to Galactic as well as the inverse from Galactic to
# Sgr. Now we can define our first transformation function:
# This rotation matrix is defines at the module level, since it will be used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

defines -> defined

# Sgr. Now we can define our first transformation function:
# This rotation matrix is defines at the module level, since it will be used
# by both the transformation from Sgr to Galactic as well as the inverse from
# Galactic to Sgr. Now we can define our first transformation function:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about:

# Since we already constructed our matrix above, and the inverse of a
# rotation matrix is just its, transpose, the required transformation  functions
# are very simple.

# code <http://www.astro.virginia.edu/~srm4n/Sgr/code.html>`_. Note that in this
# case, both coordinate systems are heliocentric, so we can simply copy any
# distance from the `~astropy.coordinates.Galactic` object.
# we simply construct a rotation matrix using the Euler angles (and the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is no longer true, maybe move the comment to where the actual matrix is constructed?


fig,axes = plt.subplots(2, 1, figsize=(6,12),
subplot_kw={'projection': 'aitoff'})
fig, axes = plt.subplots(2, 1, figsize=(8, 10),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now that we have WCSAxes inside astropy, should it be used here? It seems a perfect place for a nice example...
(But don't do it if it takes too much time.)

@eteq eteq Dec 5, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think not, because the whole point of the example is to demonstrate the use of a custom coordinate system, which WCSAxes I believe does not support (because it's not in the FITS-WCS standard). And to try to get it to would require a lot more code that I think would distract from the point of this example?

But it's probably a good idea to have another example of how you might do this in WCSAxes...?

@adrn

adrn commented Dec 3, 2016

Copy link
Copy Markdown
Member Author

@mhvk Good ideas -- I'll get these changes in by tonight.

@eteq

eteq commented Dec 5, 2016

Copy link
Copy Markdown
Member

👍 from me, modulo a few minor changes I made directly in the branch, @adrn - have a look (and @mhvk?), and if those look good I think this is set to merge, right?

@adrn

adrn commented Dec 5, 2016

Copy link
Copy Markdown
Member Author

👍

@mhvk

mhvk commented Dec 5, 2016

Copy link
Copy Markdown
Contributor

This looks good, so I'll merge. I do note that one could use units a bit more throughout, but that might as well be done later (see #5555).

@mhvk
mhvk merged commit 487c4ca into astropy:master Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release coordinates Docs no-changelog-entry-needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants