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
Map ITRS frames to terrestrial WCS coordinates #6990
Conversation
Hi there @lpsinger 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
94771cd
to
04d6586
Compare
astropy/wcs/utils.py
Outdated
xcoord = 'TLON' | ||
ycoord = 'TLAT' | ||
wcs.wcs.radesys = 'ITRS' | ||
wcs.wcs.date_obs = frame.obstime |
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.
The attribute is wcs.wcs.dateobs
. I think this will fail with AttributeError
.
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.
Right you are! Fixed.
The image is neat! I left one inline comment. I wonder what woul dbe a test for this - perhaps roundtripping with a coordinates frame? |
04d6586
to
a77bd37
Compare
Would an image example in the |
@lpsinger Regarding the test, I was thinking about purely converting between coordinates.ITRS and wcs and back to ITRS. For example, looking at the code I'm not sure how this line will work
The WCS attribute expects a string and it is given the |
a77bd37
to
a46d081
Compare
OK, I added unit tests.
Good catch! Fixed. |
The CI failures seem to be unrelated to this patch. |
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. Thanks!
a46d081
to
e22f6df
Compare
@lpsinger Could you rebase again on astropy master. This will pick up some recent fixes to the astropy build and hopefully fix the tests errors (which are unrelated) but for some reason they don't go away. Sorry this is dragging for such a long time. |
e22f6df
to
b640493
Compare
Done. |
The CI failures still look unrelated. |
Yeah, this is the common failure now on master due to numpy 1.14. Thanks for rebasing. |
This needs one more rebase, sorry about that. |
This will make it possible to use WCSAxes to make figures that combine both celestial and terrestrial features. An example is plotting the coordinates of an astronomical transient over an all- sky satellite image to illustrate the position relative to the Earth at the time of the event. The ITRS frame is identified with WCSs that use the `TLON-` and `TLAT-` coordinate types. There are several examples of WCSs where this syntax is used to describe terrestrial coordinate systems: Section 7.4.1 of the WCS in FITS "Paper II", and the WCSTools docs: http://tdc-www.harvard.edu/software/wcstools/wcstools.multiwcs.html This is the technique that I am using to make images such as this one: http://ligo.org/detections/GW170817/images-GW170817/skymap+earth.jpg
b640493
to
bc553c2
Compare
Looks like the tests are passing now! 🎉 |
🎉 Thank you. Merging as coverage does not work and everything else is green. |
This will make it possible to use WCSAxes to make figures that combine both celestial and terrestrial features. An example is plotting the coordinates of an astronomical transient over an all- sky satellite image to illustrate the position relative to the Earth at the time of the event.
The ITRS frame is identified with WCSs that use the
TLON-
andTLAT-
coordinate types. There are several examples of WCSs where this syntax is used to describe terrestrial coordinate systems: Section 7.4.1 of the WCS in FITS "Paper II", and the WCSTools docs: http://tdc-www.harvard.edu/software/wcstools/wcstools.multiwcs.htmlThis is the technique that I am using to make images such as this one: http://ligo.org/detections/GW170817/images-GW170817/skymap+earth.jpg