This repository has been archived by the owner on Jun 16, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from astrofrog/tidying-up
Various fixes ahead of release
- Loading branch information
Showing
15 changed files
with
215 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Reference/API | ||
============= | ||
|
||
.. automodapi:: wcsaxes | ||
:no-inheritance-diagram: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
============================= | ||
Overlaying coordinate systems | ||
============================= | ||
|
||
For the example in the following page we start from the example introduced in | ||
:doc:`getting_started`. | ||
|
||
.. plot:: | ||
:context: reset | ||
:nofigs: | ||
|
||
from astropy.wcs import WCS | ||
from wcsaxes import datasets | ||
hdu = datasets.msx_hdu() | ||
wcs = WCS(hdu.header) | ||
|
||
import matplotlib.pyplot as plt | ||
fig = plt.figure() | ||
|
||
from wcsaxes import WCSAxes | ||
|
||
ax = WCSAxes(fig, [0.25, 0.25, 0.6, 0.6], wcs=wcs) | ||
fig.add_axes(ax) # note that the axes have to be added to the figure | ||
|
||
ax.imshow(hdu.data, vmin=-2.e-5, vmax=2.e-4, cmap=plt.cm.gist_heat, | ||
origin='lower') | ||
|
||
The coordinates shown by default in a plot will be those derived from the WCS | ||
or transformation passed to the :class:`wcsaxes.wcsaxes.WCSAxes` class. | ||
However, it is possible to overlay different coordinate systems using the | ||
:meth:`wcsaxes.wcsaxes.WCSAxes.get_coords_overlay` method: | ||
|
||
.. plot:: | ||
:context: | ||
:include-source: | ||
:align: center | ||
|
||
overlay = ax.get_coords_overlay('fk5') | ||
|
||
The object returned is a :class:`~wcsaxes.coordinates_map.CoordinatesMap`, the | ||
same type of object as ``ax.coord``. It can therefore be used in the same way | ||
as ``ax.coord`` to set the ticks, tick labels, and axis labels properties: | ||
|
||
.. plot:: | ||
:context: | ||
:include-source: | ||
:align: center | ||
|
||
ax.coords['glon'].set_ticks(color='white') | ||
ax.coords['glat'].set_ticks(color='white') | ||
|
||
ax.coords['glon'].set_axislabel('Galactic Longitude') | ||
ax.coords['glat'].set_axislabel('Galactic Latitude') | ||
|
||
ax.coords.grid(color='yellow', linestyle='solid', alpha=0.5) | ||
|
||
overlay['ra'].set_ticks(color='white') | ||
overlay['dec'].set_ticks(color='white') | ||
|
||
overlay['ra'].set_axislabel('Right Ascension') | ||
overlay['dec'].set_axislabel('Declination') | ||
|
||
overlay.grid(color='white', linestyle='solid', alpha=0.5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.