Codebase list aplpy / 9d5498f
Update upstream source from tag 'upstream/2.0' Update to upstream version '2.0' with Debian dir f10f81134eed1768c8d759c665efcb64cc908289 Ole Streicher 5 years ago
106 changed file(s) with 548 addition(s) and 216 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 2.1
1 Name: aplpy
2 Version: 2.0rc2
1 Name: APLpy
2 Version: 2.0
33 Summary: The Astronomical Plotting Library in Python
44 Home-page: http://aplpy.github.io
55 Author: Thomas Robitaille and Eli Bressert
66 Author-email: thomas.robitaille@gmail.com, elibre@users.sourceforge.net
77 License: MIT
8 Description: The Astronomical Plotting Library in Python
8 Description: |Build Status| |CircleCI| |codecov| |Documentation Status|
9
10 About
11 -----
12
13 APLpy (the Astronomical Plotting Library in Python) is a Python module
14 aimed at producing publication-quality plots of astronomical imaging
15 data in FITS format.
16
17 PyPI: https://pypi.python.org/pypi/APLpy
18
19 Website: http://aplpy.github.io
20
21 Documentation: http://aplpy.readthedocs.io
22
23 APLpy is released under an MIT open-source license.
24
25 Installing
26 ----------
27
28 The following dependencies are required:
29
30 - `Numpy <http://www.numpy.org>`__ 1.11 or later
31 - `Matplotlib <http://www.matplotlib.org>`__ 2.0 or later
32 - `Astropy <http://www.astropy.org>`__ 3.1 or later
33 - `reproject <http://reproject.readthedocs.org>`__ 0.4 or later
34
35 and the following are optional:
36
37 - `PyAVM <http://astrofrog.github.io/pyavm/>`__ 0.9.4 or later
38 - `pyregion <http://pyregion.readthedocs.org/>`__ 2.0 or later
39 - `pillow <https://pypi.org/project/Pillow/>`__ 4.0 or later
40 - `scikit-image <https://pypi.org/project/scikit-image/>`__ 0.14 or
41 later
42
43 You can install APLpy with:
44
45 ::
46
47 pip install aplpy
48
49 If you want to install all optional dependencies, you can do:
50
51 ::
52
53 pip install aplpy[all]
54
55 .. |Build Status| image:: https://travis-ci.org/aplpy/aplpy.svg?branch=master
56 :target: https://travis-ci.org/aplpy/aplpy
57 .. |CircleCI| image:: https://circleci.com/gh/aplpy/aplpy/tree/master.svg?style=svg
58 :target: https://circleci.com/gh/aplpy/aplpy/tree/master
59 .. |codecov| image:: https://codecov.io/gh/aplpy/aplpy/branch/master/graph/badge.svg
60 :target: https://codecov.io/gh/aplpy/aplpy
61 .. |Documentation Status| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat
62 :target: https://aplpy.readthedocs.io/en/latest/
63
964 Platform: UNKNOWN
1065 Requires-Python: >=3.5
66 Provides-Extra: all
1167 Provides-Extra: docs
12 Provides-Extra: all
1368 Provides-Extra: test
+0
-45
README.md less more
0 [![Build Status](https://travis-ci.org/aplpy/aplpy.svg?branch=master)](https://travis-ci.org/aplpy/aplpy)
1 [![CircleCI](https://circleci.com/gh/aplpy/aplpy/tree/master.svg?style=svg)](https://circleci.com/gh/aplpy/aplpy/tree/master)
2 [![codecov](https://codecov.io/gh/aplpy/aplpy/branch/master/graph/badge.svg)](https://codecov.io/gh/aplpy/aplpy)
3 [![Documentation Status](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](https://aplpy.readthedocs.io/en/latest/)
4
5
6 About
7 -----
8
9 APLpy (the Astronomical Plotting Library in Python) is a
10 Python module aimed at producing publication-quality plots
11 of astronomical imaging data in FITS format.
12
13 PyPI: https://pypi.python.org/pypi/APLpy
14
15 Website: http://aplpy.github.io
16
17 Documentation: http://aplpy.readthedocs.io
18
19 APLpy is released under an MIT open-source license.
20
21 Installing
22 ----------
23
24 The following dependencies are required:
25
26 * [Numpy](http://www.numpy.org) 1.11 or later
27 * [Matplotlib](http://www.matplotlib.org) 2.0 or later
28 * [Astropy](http://www.astropy.org) 3.1 or later
29 * [reproject](http://reproject.readthedocs.org) 0.4 or later
30
31 and the following are optional:
32
33 * [PyAVM](http://astrofrog.github.io/pyavm/) 0.9.4 or later
34 * [pyregion](http://pyregion.readthedocs.org/) 2.0 or later
35 * [pillow](https://pypi.org/project/Pillow/) 4.0 or later
36 * [scikit-image](https://pypi.org/project/scikit-image/) 0.14 or later
37
38 You can install APLpy with:
39
40 pip install aplpy
41
42 If you want to install all optional dependencies, you can do:
43
44 pip install aplpy[all]
0 |Build Status| |CircleCI| |codecov| |Documentation Status|
1
2 About
3 -----
4
5 APLpy (the Astronomical Plotting Library in Python) is a Python module
6 aimed at producing publication-quality plots of astronomical imaging
7 data in FITS format.
8
9 PyPI: https://pypi.python.org/pypi/APLpy
10
11 Website: http://aplpy.github.io
12
13 Documentation: http://aplpy.readthedocs.io
14
15 APLpy is released under an MIT open-source license.
16
17 Installing
18 ----------
19
20 The following dependencies are required:
21
22 - `Numpy <http://www.numpy.org>`__ 1.11 or later
23 - `Matplotlib <http://www.matplotlib.org>`__ 2.0 or later
24 - `Astropy <http://www.astropy.org>`__ 3.1 or later
25 - `reproject <http://reproject.readthedocs.org>`__ 0.4 or later
26
27 and the following are optional:
28
29 - `PyAVM <http://astrofrog.github.io/pyavm/>`__ 0.9.4 or later
30 - `pyregion <http://pyregion.readthedocs.org/>`__ 2.0 or later
31 - `pillow <https://pypi.org/project/Pillow/>`__ 4.0 or later
32 - `scikit-image <https://pypi.org/project/scikit-image/>`__ 0.14 or
33 later
34
35 You can install APLpy with:
36
37 ::
38
39 pip install aplpy
40
41 If you want to install all optional dependencies, you can do:
42
43 ::
44
45 pip install aplpy[all]
46
47 .. |Build Status| image:: https://travis-ci.org/aplpy/aplpy.svg?branch=master
48 :target: https://travis-ci.org/aplpy/aplpy
49 .. |CircleCI| image:: https://circleci.com/gh/aplpy/aplpy/tree/master.svg?style=svg
50 :target: https://circleci.com/gh/aplpy/aplpy/tree/master
51 .. |codecov| image:: https://codecov.io/gh/aplpy/aplpy/branch/master/graph/badge.svg
52 :target: https://codecov.io/gh/aplpy/aplpy
53 .. |Documentation Status| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat
54 :target: https://aplpy.readthedocs.io/en/latest/
1313 import numpy as np
1414
1515 from astropy import log
16 from astropy.extern import six
1716 from astropy.wcs import WCS
1817 from astropy.wcs.utils import proj_plane_pixel_scales
1918 from astropy.io import fits
150149 else:
151150 self.grid_type = 'lines'
152151
153 if (isinstance(data, six.string_types) and
152 if (isinstance(data, str) and
154153 data.split('.')[-1].lower() in ['png', 'jpg', 'tif']):
155154
156155 try:
300299 def _get_hdu(self, data, hdu, north, convention=None,
301300 dimensions=[0, 1], slices=[]):
302301
303 if isinstance(data, six.string_types):
302 if isinstance(data, str):
304303
305304 filename = data
306305
723722 smooth=smooth,
724723 kernel=kernel))
725724 else:
725 extent = -0.5, self._wcs.nx - 0.5, -0.5, self._wcs.ny - 0.5
726726 convolved_data = convolve_util.convolve(self._data, smooth=smooth, kernel=kernel)
727727 self.image = self.ax.imshow(convolved_data, cmap=cmap,
728728 interpolation=interpolation,
729729 origin='lower', norm=normalizer,
730 aspect=aspect)
730 aspect=aspect, extent=extent)
731731
732732 xmin, xmax = self.ax.get_xbound()
733733 if xmin == 0.0:
17141714 called. This defaults to `True` if and only if APLpy is being used
17151715 from IPython and the Matplotlib backend is interactive.
17161716 """
1717 self._figure._auto_refresh = refresh
17181717 if refresh is None:
17191718 if matplotlib.is_interactive():
17201719 try:
17271726 refresh = False
17281727 elif not isinstance(refresh, bool):
17291728 raise TypeError("refresh argument should be boolean or `None`")
1729 self._figure._auto_refresh = refresh
17301730
17311731 def refresh(self, force=True):
17321732 """
17801780 explicitly. Should be one of 'eps', 'ps', 'pdf', 'svg', 'png'.
17811781 """
17821782
1783 if isinstance(filename, six.string_types) and format is None:
1783 if isinstance(filename, str) and format is None:
17841784 format = os.path.splitext(filename)[1].lower()[1:]
17851785
17861786 if dpi is None and format in ['eps', 'ps', 'pdf']:
17931793 dpi = nx / width
17941794 log.info("Auto-setting resolution to %g dpi" % dpi)
17951795
1796 artists = []
17971796 if adjust_bbox:
17981797 self._figure.savefig(filename, dpi=dpi, transparent=transparent,
17991798 bbox_inches='tight', format=format)
99
1010 from astropy import units as u
1111 from astropy.wcs.utils import proj_plane_pixel_scales
12 from astropy.extern import six
1312
1413 from .decorators import auto_refresh
1514
9897 except Exception:
9998 pass
10099
101 if isinstance(corner, six.string_types):
100 if isinstance(corner, str):
102101 corner = corners[corner]
103102
104103 self._scalebar = AnchoredSizeBar(self._ax.transData, length, label,
377376 See the matplotlib documentation for more details.
378377 """
379378
380 if isinstance(major, six.string_types):
379 if isinstance(major, str):
381380 major = self._header[major]
382381
383 if isinstance(minor, six.string_types):
382 if isinstance(minor, str):
384383 minor = self._header[minor]
385384
386 if isinstance(angle, six.string_types):
385 if isinstance(angle, str):
387386 angle = self._header[angle]
388387
389388 if isinstance(major, u.Quantity):
425424 except Exception:
426425 pass
427426
428 if isinstance(corner, six.string_types):
427 if isinstance(corner, str):
429428 corner = corners[corner]
430429
431430 self._beam = AnchoredEllipse(self._ax.transData, width=minor,
00 from __future__ import absolute_import, print_function, division
11
2 from astropy.extern import six
32 from astropy import log
43 from astropy import wcs
54
9089 raise ImportError("The pyregion package is required to load region files")
9190
9291 # read region file
93 if isinstance(region_file, six.string_types):
92 if isinstance(region_file, str):
9493 rr = pyregion.open(region_file)
9594 elif isinstance(region_file, pyregion.ShapeList):
9695 rr = region_file
44 import warnings
55
66 import numpy as np
7 from astropy.extern import six
87 from astropy import log
98 from astropy.io import fits
109 from astropy.coordinates import ICRS
128127 except ImportError:
129128 raise ImportError("The Python Imaging Library (PIL) is required to make an RGB image")
130129
131 if isinstance(data, six.string_types):
130 if isinstance(data, str):
132131
133132 image = fits.getdata(data)
134133 image_r = image[indices[0], :, :]
237236 to the same projection.
238237
239238 Two files are produced by this function. The first is a three-dimensional
240 FITS cube with a filename give by `output`, where the third dimension
239 FITS cube with a filename give by ``output``, where the third dimension
241240 contains the different channels. The second is a two-dimensional FITS
242 image with a filename given by `output` with a `_2d` suffix. This file
241 image with a filename given by ``output`` with a `_2d` suffix. This file
243242 contains the mean of the different channels, and is required as input to
244243 FITSFigure if show_rgb is subsequently used to show a color image
245244 generated from the FITS cube (to provide the correct WCS information to
00 from __future__ import absolute_import, print_function, division
11
2 import pytest
23 import numpy as np
4
5 try:
6 import skimage # noqa
7 except ImportError:
8 SKIMAGE_INSTALLED = False
9 else:
10 SKIMAGE_INSTALLED = True
311
412 from .. import FITSFigure
513
614
15 @pytest.mark.skipif("not SKIMAGE_INSTALLED")
716 def test_numpy_downsample():
817 data = np.arange(256).reshape((16, 16))
918 f = FITSFigure(data, downsample=2)
232232 f.tick_labels.hide()
233233 f.ticks.hide()
234234 return f._figure
235
236 @pytest.mark.remote_data
237 @pytest.mark.mpl_image_compare(style={}, savefig_kwargs={'adjust_bbox': False}, baseline_dir=baseline_dir, tolerance=5)
238 def test_downsample(self):
239 data = np.arange(256).reshape((16, 16))
240 f = FITSFigure(data, downsample=2)
241 f.show_grayscale()
242 return f._figure
11
22 import os
33 import sys
4 from astropy.extern import six
54
65 from io import BytesIO as StringIO
76
1514
1615
1716 def is_format(filename, format):
18 if isinstance(filename, six.string_types):
17 if isinstance(filename, str):
1918 f = open(filename, 'rb')
2019 else:
2120 f = filename
0 # Autogenerated by Astropy-affiliated package aplpy's setup.py on 2018-12-31 21:31:30 UTC
0 # Autogenerated by Astropy-affiliated package aplpy's setup.py on 2019-02-17 11:50:54 UTC
11 from __future__ import unicode_literals
22 import datetime
33
186186
187187
188188 _packagename = "aplpy"
189 _last_generated_version = "2.0rc2"
190 _last_githash = "80493a087c524582c35f4f9159da6ee515d170a3"
189 _last_generated_version = "2.0"
190 _last_githash = "a3f9352a73debc7a0f9be1205c4c028873529f96"
191191
192192 # Determine where the source code for this module
193193 # lives. If __file__ is not a filesystem path then
210210 version_info = (major, minor, bugfix)
211211
212212 release = True
213 timestamp = datetime.datetime(2018, 12, 31, 21, 31, 30)
213 timestamp = datetime.datetime(2019, 2, 17, 11, 50, 54)
214214 debug = False
215215
216 astropy_helpers_version = "2.0"
216 astropy_helpers_version = "3.1"
217217
218218 try:
219219 from ._compiler import compiler
astropy_helpers/astropy_helpers/__init__.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/__init__.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/__init__.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/distutils_helpers.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/distutils_helpers.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/distutils_helpers.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/git_helpers.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/git_helpers.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/git_helpers.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/openmp_helpers.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/setup_helpers.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/setup_helpers.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/setup_helpers.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/utils.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/utils.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/utils.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/version.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/version.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/version.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/version_helpers.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/version_helpers.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/__pycache__/version_helpers.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__init__.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/__init__.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/__init__.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/_dummy.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_ext.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_ext.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_ext.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_py.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_py.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_py.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_sphinx.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/build_sphinx.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/install.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/install.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/install.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/install_lib.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/install_lib.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/install_lib.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/register.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/register.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/register.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/setup_package.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/test.cpython-35.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/test.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/__pycache__/test.cpython-37.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/build_ext.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/build_py.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/install.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/install_lib.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/register.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/commands/test.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/distutils_helpers.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/__pycache__/setup_package.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/automodapi/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/automodapi/__pycache__/autodoc_enhancements.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/automodapi/__pycache__/automodapi.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/automodapi/__pycache__/automodsumm.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/automodapi/__pycache__/smart_resolver.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/automodapi/__pycache__/utils.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/numpydoc/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/numpydoc/__pycache__/docscrape.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/numpydoc/__pycache__/docscrape_sphinx.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/extern/numpydoc/__pycache__/numpydoc.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/git_helpers.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/setup_helpers.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/__pycache__/conf.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/__pycache__/setup_package.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/ext/__pycache__/__init__.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/ext/__pycache__/changelog_links.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/ext/__pycache__/doctest.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/sphinx/ext/__pycache__/tocdepthfix.cpython-36.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/utils.pyc less more
Binary diff not shown
0 # Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2017-07-29 16:14:44.427577
0 # Autogenerated by Astropy-affiliated package astropy_helpers's setup.py on 2019-02-17 11:49:47 UTC
11 from __future__ import unicode_literals
22 import datetime
33
4 version = "2.0"
5 githash = "ed2e7897862ae9e979b336df670d7a5541cdd8f0"
4 version = "3.1"
5 githash = "9f82aac6c2141b425e2d639560f7260189d90b54"
66
77
8 major = 2
9 minor = 0
8 major = 3
9 minor = 1
1010 bugfix = 0
1111
12 version_info = (major, minor, bugfix)
13
1214 release = True
13 timestamp = datetime.datetime(2017, 7, 29, 16, 14, 44, 427577)
15 timestamp = datetime.datetime(2019, 2, 17, 11, 49, 47)
1416 debug = False
17
18 astropy_helpers_version = ""
1519
1620 try:
1721 from ._compiler import compiler
astropy_helpers/astropy_helpers/version.pyc less more
Binary diff not shown
astropy_helpers/astropy_helpers/version_helpers.pyc less more
Binary diff not shown
0 Metadata-Version: 1.1
0 Metadata-Version: 1.2
11 Name: astropy-helpers
2 Version: 2.0
2 Version: 3.1
33 Summary: Utilities for building and installing Astropy, Astropy affiliated packages, and their respective documentation.
44 Home-page: https://github.com/astropy/astropy-helpers
55 Author: The Astropy Developers
88 Description: astropy-helpers
99 ===============
1010
11 * Stable versions: https://pypi.org/project/astropy-helpers/
12 * Development version, issue tracker: https://github.com/astropy/astropy-helpers
11 .. image:: https://travis-ci.org/astropy/astropy-helpers.svg
12 :target: https://travis-ci.org/astropy/astropy-helpers
13
14 .. image:: https://ci.appveyor.com/api/projects/status/rt9161t9mhx02xp7/branch/master?svg=true
15 :target: https://ci.appveyor.com/project/Astropy/astropy-helpers
16
17 .. image:: https://codecov.io/gh/astropy/astropy-helpers/branch/master/graph/badge.svg
18 :target: https://codecov.io/gh/astropy/astropy-helpers
19
20 **Warning:** Please note that version ``v3.0`` and later of ``astropy-helpers``
21 requires Python 3.5 or later. If you wish to maintain Python 2 support
22 for your package that uses ``astropy-helpers``, then do not upgrade the
23 helpers to ``v3.0+``. We will still provide Python 2.7 compatible
24 releases on the ``v2.0.x`` branch during the lifetime of the ``astropy``
25 core package LTS of ``v2.0.x``.
26
27 About
28 -----
1329
1430 This project provides a Python package, ``astropy_helpers``, which includes
1531 many build, installation, and documentation-related tools used by the Astropy
1632 project, but packaged separately for use by other projects that wish to
1733 leverage this work. The motivation behind this package and details of its
18 implementation are in the accepted
34 implementation are in the accepted
1935 `Astropy Proposal for Enhancement (APE) 4 <https://github.com/astropy/astropy-APEs/blob/master/APE4.rst>`_.
20
21 The ``astropy_helpers.extern`` sub-module includes modules developed elsewhere
22 that are bundled here for convenience. At the moment, this consists of the
23 following two sphinx extensions:
24
25 * `numpydoc <https://github.com/numpy/numpydoc>`_, a Sphinx extension
26 developed as part of the Numpy project. This is used to parse docstrings
27 in Numpy format
28
29 * `sphinx-automodapi <https://github.com/astropy/sphinx-automodapi>`_, a Sphinx
30 developed as part of the Astropy project. This used to be developed directly
31 in ``astropy-helpers`` but is now a standalone package.
32
33 Issues with these sub-modules should be reported in their respective repositories,
34 and we will regularly update the bundled versions to reflect the latest released
35 versions.
3636
3737 ``astropy_helpers`` includes a special "bootstrap" module called
3838 ``ah_bootstrap.py`` which is intended to be used by a project's setup.py in
3939 order to ensure that the ``astropy_helpers`` package is available for
40 build/installation. This is similar to the ``ez_setup.py`` module that is
41 shipped with some projects to bootstrap `setuptools
42 <https://bitbucket.org/pypa/setuptools>`_.
43
44 As described in APE4, the version numbers for ``astropy_helpers`` follow the
45 corresponding major/minor version of the `astropy core package
46 <http://www.astropy.org/>`_, but with an independent sequence of micro (bugfix)
47 version numbers. Hence, the initial release is 0.4, in parallel with Astropy
48 v0.4, which will be the first version of Astropy to use ``astropy-helpers``.
40 build/installation.
41
42 As described in `APE4 <https://github.com/astropy/astropy-APEs/blob/master/APE4.rst>`_, the version
43 numbers for ``astropy_helpers`` follow the corresponding major/minor version of
44 the `astropy core package <http://www.astropy.org/>`_, but with an independent
45 sequence of micro (bugfix) version numbers. Hence, the initial release is 0.4,
46 in parallel with Astropy v0.4, which will be the first version of Astropy to
47 use ``astropy-helpers``.
4948
5049 For examples of how to implement ``astropy-helpers`` in a project,
51 see the ``setup.py`` and ``setup.cfg`` files of the
50 see the ``setup.py`` and ``setup.cfg`` files of the
5251 `Affiliated package template <https://github.com/astropy/package-template>`_.
5352
54 .. image:: https://travis-ci.org/astropy/astropy-helpers.svg
55 :target: https://travis-ci.org/astropy/astropy-helpers
56
57 .. image:: https://coveralls.io/repos/astropy/astropy-helpers/badge.svg
58 :target: https://coveralls.io/r/astropy/astropy-helpers
53 What does astropy-helpers provide?
54 ----------------------------------
55
56 Astropy-helpers' big-picture purpose is to provide customization to Python's
57 packaging infrastructure process in ways that the Astropy Project has found to
58 help simplifying the developint and releasing packages. This is primarily
59 build around ``setup.py`` commands, as outlined below, as well as code to help
60 manage version numbers and better control the build process of larger packages.
61
62 Custom setup.py commands
63 ^^^^^^^^^^^^^^^^^^^^^^^^
64
65 The main part of astropy-helpers is to provide customized setuptools commands.
66 For example, in a package that uses astropy-helpers, the following command
67 will be available::
68
69 python setup.py build_docs
70
71 and this command is implemented in astropy-helpers. To use the custom
72 commands described here, add::
73
74 from astropy_helpers.setup_helpers import register_commands
75
76 to your ``setup.py`` file, then do::
77
78 cmdclassd = register_commands(NAME, VERSION, RELEASE)
79
80 where ``NAME`` is the name of your package, ``VERSION`` is the full version
81 string, and ``RELEASE`` is a boolean value indicating whether the version is
82 a stable released version (``True``) or a developer version (``False``).
83 Finally, pass ``cmdclassd`` to the ``setup`` function::
84
85 setup(...,
86 cmdclass=cmdclassd)
87
88 The commands we provide or customize are:
89
90 **python setup.py test**
91
92 This command will automatically build the package, install it to a temporary
93 directory, and run the tests using `pytest <http://pytest.org/>`_ on this
94 installed version. Note that the bulk of this command is actually defined
95 in ``astropy.tests.command.AstropyTest``, because that allows the test
96 machinery to operate outside a setuptools command. This, here we
97 simply define the custom
98 setuptools command.
99
100 **python setup.py sdist**
101
102 We redefine ``sdist`` to use the version from distutils rather than from
103 setuptools, as the setuptools version requires duplication of information
104 in ``MANIFEST.in``.
105
106 **python setup.py build_docs**
107
108 This command will automatically build the package, then run sphinx to build
109 the documentation. This makes development much easier because it ensures
110 sphinx extensions that use the package's code to make documentation are
111 actually using the in-development version of the code. Sphinx itself
112 provides a custom setuptools command, which we
113 expand with the following options:
114
115 * ``-w``: set the return code to 1 if there are any warnings during the build
116 process.
117
118 * ``-l``: completely clean previous builds, including files generated by
119 the sphinx-automodapi package (which creates API pages for different
120 functions/classes).
121
122 * ``-n``: disable the intersphinx option.
123
124 * ``-o``: open the documentation in a browser if a build finishes successfully.
125
126 In addition, ``build_docs`` will automatically download and temporarily install
127 sphinx-astropy (which is a meta-package that
128 provides standardized configuration and documentation dependencies for astropy
129 packages) if it isn't already installed. Temporary installation means that the
130 package will be installed into an ``.eggs`` directory in the current working
131 directory, and it will only be available for the duration of the call to
132 ``build_docs``.
133
134 **python setup.py build_ext**
135
136 This is also used when running ``build`` or ``install``. We add several features
137 compared to the default ``build_ext`` command:
138
139 * For packages with C/Cython extensions, we create a ``packagename._compiler``
140 submodule that contains information about the compilers used.
141
142 * Packages that need to build C extensions using the Numpy C API, we allow
143 those packages to define the include path as ``'numpy'`` as opposed to having
144 to import Numpy and call ``get_include``. The goal is to solve the issue that
145 if one has to import Numpy to define extensions, then Numpy has to be
146 installed/available before the package is installed, which means that one
147 needs to install Numpy in a separate installation step.
148
149 * We detect broken compilers and replace them with other compilers on-the-fly
150 unless the compiler is explicitly specified with the ``CC`` environment
151 variable.
152
153 * If Cython is not installed, then we automatically check for generated C files
154 (which are normally present in the stable releases) and give a nice error
155 if these are not found.
156
157 Version helpers
158 ^^^^^^^^^^^^^^^^
159
160 Another piece of functionality we provide in astropy-helpers is the ability
161 to generate a ``packagename.version`` file that includes functions that
162 automatically set the version string for developer versions, to e.g.
163 ``3.2.dev22213`` so that each developer version has a unique number (although
164 note that branches an equal number of commits away from the master branch will
165 share the same version number). To use this, import::
166
167 from astropy_helpers.git_helpers import get_git_devstr
168
169 in your ``setup.py`` file, and you will then be able to use::
170
171 VERSION += get_git_devstr()
172
173 where ``VERSION`` is a version string without any developer version suffix.
174
175 We then also provide a function that generates a ``version.py`` file inside your
176 package (which can then be imported as ``packagename.version``) that contains
177 variables such as ``major``, ``minor``, and ``bugfix``, as well as
178 ``version_info`` (a tuple of the previous three values), a ``release`` flag that
179 indicates whether we are using a stable release, and several other complementary
180 variables. To use this, import::
181
182 from astropy_helpers.version_helpers import generate_version_py
183
184 in your ``setup.py`` file, and call::
185
186 generate_version_py(NAME, VERSION, RELEASE, uses_git=not RELEASE)
187
188 where ``NAME`` is the name of your package, ``VERSION`` is the full version string
189 (including any developer suffix), ``RELEASE`` indicates whether the version is a
190 stable or developer version, and ``uses_git`` indicates whether we are in a git
191 repository (using ``not RELEASE`` is sensible since git is not available in a
192 stable release).
193
194 Collecting package information
195 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
196
197 The ``setup`` function from setuptools can take a number of options that indicate
198 for example what extensions to build, and what package data to include. However,
199 for large packages this can become cumbersome. We therefore provide a mechanism
200 for defining extensions and package data inside individual sub-packages. To do
201 this, you can create ``setup_package.py`` files anywhere in your package, and
202 these files can include one or more of the following functions:
203
204 * ``get_package_data``:
205 This function, if defined, should return a dictionary mapping the name of
206 the subpackage(s) that need package data to a list of data file paths
207 (possibly including wildcards) relative to the path of the package's source
208 code. e.g. if the source distribution has a needed data file
209 ``astropy/wcs/tests/data/3d_cd.hdr``, this function should return
210 ``{'astropy.wcs.tests':['data/3d_cd.hdr']}``. See the ``package_data``
211 option of the :func:`distutils.core.setup` function.
212
213 It is recommended that all such data be in a directory named ``data`` inside
214 the package within which it is supposed to be used. This package data
215 should be accessed via the ``astropy.utils.data.get_pkg_data_filename`` and
216 ``astropy.utils.data.get_pkg_data_fileobj`` functions.
217
218 * ``get_extensions``:
219 This provides information for building C or Cython extensions. If defined,
220 it should return a list of ``distutils.core.Extension`` objects.
221
222 * ``get_build_options``:
223 This function allows a package to add extra build options. It
224 should return a list of tuples, where each element has:
225
226 - *name*: The name of the option as it would appear on the
227 commandline or in the ``setup.cfg`` file.
228
229 - *doc*: A short doc string for the option, displayed by
230 ``setup.py build --help``.
231
232 - *is_bool* (optional): When `True`, the option is a boolean
233 option and doesn't have an associated value.
234
235 Once an option has been added, its value can be looked up using
236 ``astropy_helpers.setup_helpers.get_distutils_build_option``.
237
238 * ``get_external_libraries``:
239 This function declares that the package uses libraries that are
240 included in the astropy distribution that may also be distributed
241 elsewhere on the users system. It should return a list of library
242 names. For each library, a new build option is created,
243 ``'--use-system-X'`` which allows the user to request to use the
244 system's copy of the library. The package would typically call
245 ``astropy_helpers.setup_helpers.use_system_library`` from its
246 ``get_extensions`` function to determine if the package should use
247 the system library or the included one.
248
249 * ``get_entry_points()``:
250 This function can returns a dict formatted as required by
251 the ``entry_points`` argument to ``setup()``.
252
253 With these files in place, you can then add the following to your ``setup.py``
254 file::
255
256 from astropy_helpers.setup_helpers import get_package_info
257
258 ...
259
260 package_info = get_package_info()
261
262 ...
263
264 setup(..., **package_info)
265
266 OpenMP helpers
267 ^^^^^^^^^^^^^^
268
269 We provide a helper function ``add_openmp_flags_if_available`` that can be used
270 to automatically add OpenMP flags for C/Cython extensions, based on whether
271 OpenMP is available and produces executable code. To use this, edit the
272 ``setup_package.py`` file where you define a C extension, import the helper
273 function::
274
275 from astropy_helpers.openmp_helpers import add_openmp_flags_if_available
276
277 then once you have defined the extension and before returning it, use it as::
278
279 extension = Extension(...)
280
281 add_openmp_flags_if_available(extension)
282
283 return [extension]
284
285 Using astropy-helpers
286 ---------------------
287
288 The easiest way to get set up with astropy-helpers in a new package is to use
289 the `package-template <http://docs.astropy.org/projects/package-template>`_
290 that we provide. This template is specifically designed for use with the helpers,
291 so using it avoids some of the tedium of setting up the heleprs.
292
293 However, we now go through the steps of adding astropy-helpers
294 as a submodule to a package in case you wish to do so manually. First, add
295 astropy-helpers as a submodule at the root of your repository::
296
297 git submodule add git://github.com/astropy/astropy-helpers astropy_helpers
298
299 Then go inside the submodule and check out a stable version of astropy-helpers.
300 You can see the available versions by running::
301
302 $ cd astropy_helpers
303 $ git tag
304 ...
305 v2.0.6
306 v2.0.7
307 ...
308 v3.0.1
309 v3.0.2
310
311 If you want to support Python 2, pick the latest v2.0.x version (in the above
312 case ``v2.0.7``) and if you don't need to support Python 2, just pick the latest
313 stable version (in the above case ``v3.0.2``). Check out this version with e.g.::
314
315 $ git checkout v3.0.2
316
317 Then go back up to the root of your repository and copy the ``ah_bootstrap.py``
318 file from the submodule to the root of your repository::
319
320 $ cd ..
321 $ cp astropy_helpers/ah_bootstrap.py .
322
323 Finally, add::
324
325 import ah_bootstrap
326
327 at the top of your ``setup.py`` file. This will ensure that ``astropy_helpers``
328 is now available to use in your ``setup.py`` file. Finally, add then commit your
329 changes::
330
331 git add astropy_helpers ah_bootstrap.py setup.py
332 git commit -m "Added astropy-helpers"
333
334 Updating astropy-helpers
335 ------------------------
336
337 If you would like the Astropy team to automatically open pull requests to update
338 astropy-helpers in your package, then see the instructions `here
339 <https://github.com/astropy/astropy-procedures/blob/master/update-packages/README.md>`_.
340
341 To instead update astropy-helpers manually, go inside the submodule and do::
342
343 cd astropy_helpers
344 git fetch origin
345
346 Then checkout the version you want to use, e.g.::
347
348 git checkout v3.0.3
349
350 Go back up to the root of the repository and update the ``ah_bootstap.py`` file
351 too, then add your changes::
352
353 cp astropy_helpers/ah_bootstrap.py .
354 git add astropy_helpers ah_bootstrap.py
355 git commit ...
59356
60357 Platform: UNKNOWN
61358 Classifier: Development Status :: 5 - Production/Stable
70367 Classifier: Topic :: Software Development :: Build Tools
71368 Classifier: Topic :: Software Development :: Libraries :: Python Modules
72369 Classifier: Topic :: System :: Archiving :: Packaging
370 Requires-Python: >=3.5
22 MANIFEST.in
33 README.rst
44 ah_bootstrap.py
5 ez_setup.py
65 setup.cfg
76 setup.py
87 astropy_helpers/__init__.py
8 astropy_helpers/conftest.py
99 astropy_helpers/distutils_helpers.py
1010 astropy_helpers/git_helpers.py
11 astropy_helpers/openmp_helpers.py
1112 astropy_helpers/setup_helpers.py
12 astropy_helpers/test_helpers.py
1313 astropy_helpers/utils.py
1414 astropy_helpers/version.py
1515 astropy_helpers/version_helpers.py
2020 astropy_helpers.egg-info/top_level.txt
2121 astropy_helpers/commands/__init__.py
2222 astropy_helpers/commands/_dummy.py
23 astropy_helpers/commands/_test_compat.py
2423 astropy_helpers/commands/build_ext.py
25 astropy_helpers/commands/build_py.py
2624 astropy_helpers/commands/build_sphinx.py
27 astropy_helpers/commands/install.py
28 astropy_helpers/commands/install_lib.py
29 astropy_helpers/commands/register.py
3025 astropy_helpers/commands/setup_package.py
3126 astropy_helpers/commands/test.py
3227 astropy_helpers/commands/src/compiler.c
33 astropy_helpers/compat/__init__.py
34 astropy_helpers/extern/__init__.py
35 astropy_helpers/extern/setup_package.py
36 astropy_helpers/extern/automodapi/__init__.py
37 astropy_helpers/extern/automodapi/autodoc_enhancements.py
38 astropy_helpers/extern/automodapi/automodapi.py
39 astropy_helpers/extern/automodapi/automodsumm.py
40 astropy_helpers/extern/automodapi/smart_resolver.py
41 astropy_helpers/extern/automodapi/utils.py
42 astropy_helpers/extern/automodapi/templates/autosummary_core/base.rst
43 astropy_helpers/extern/automodapi/templates/autosummary_core/class.rst
44 astropy_helpers/extern/automodapi/templates/autosummary_core/module.rst
45 astropy_helpers/extern/numpydoc/__init__.py
46 astropy_helpers/extern/numpydoc/docscrape.py
47 astropy_helpers/extern/numpydoc/docscrape_sphinx.py
48 astropy_helpers/extern/numpydoc/linkcode.py
49 astropy_helpers/extern/numpydoc/numpydoc.py
5028 astropy_helpers/sphinx/__init__.py
5129 astropy_helpers/sphinx/conf.py
52 astropy_helpers/sphinx/setup_package.py
53 astropy_helpers/sphinx/ext/__init__.py
54 astropy_helpers/sphinx/ext/changelog_links.py
55 astropy_helpers/sphinx/ext/doctest.py
56 astropy_helpers/sphinx/ext/edit_on_github.py
57 astropy_helpers/sphinx/ext/tocdepthfix.py
58 astropy_helpers/sphinx/ext/tests/__init__.py
59 astropy_helpers/sphinx/local/python2_local_links.inv
60 astropy_helpers/sphinx/local/python3_local_links.inv
61 astropy_helpers/sphinx/themes/bootstrap-astropy/globaltoc.html
62 astropy_helpers/sphinx/themes/bootstrap-astropy/layout.html
63 astropy_helpers/sphinx/themes/bootstrap-astropy/localtoc.html
64 astropy_helpers/sphinx/themes/bootstrap-astropy/searchbox.html
65 astropy_helpers/sphinx/themes/bootstrap-astropy/theme.conf
66 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout.svg
67 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_linkout_20.png
68 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.ico
69 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo.svg
70 astropy_helpers/sphinx/themes/bootstrap-astropy/static/astropy_logo_32.png
71 astropy_helpers/sphinx/themes/bootstrap-astropy/static/bootstrap-astropy.css
72 astropy_helpers/sphinx/themes/bootstrap-astropy/static/copybutton.js
73 astropy_helpers/sphinx/themes/bootstrap-astropy/static/sidebar.js
74 licenses/LICENSE_COPYBUTTON.rst
75 licenses/LICENSE_NUMPYDOC.rst
30 licenses/LICENSE_ASTROSCRAPPY.rst
148148
149149 edit_on_github_source_root = ""
150150 edit_on_github_doc_root = "docs"
151
152 # Use nitpicky mode to avoid broken links in docs
153 nitpicky = True
154 nitpick_ignore = [('py:class', 'aplpy.layers.Layers'),
155 ('py:class', 'aplpy.regions.Regions')]
1111 latitudes, and arbitrary scalar values, APLpy keeps track of the axis
1212 coordinate 'type' for each axis, and will try and guess these based on the
1313 header. However, it is possible to explicitly specify the coordinate type with
14 the :meth:`~aplpy.aplpy.FITSFigure.set_xaxis_coord_type` and :meth:`~aplpy.aplpy.FITSFigure.set_yaxis_coord_type` methods in the
15 :class:`~aplpy.aplpy.FITSFigure` object::
14 the :meth:`~aplpy.FITSFigure.set_xaxis_coord_type` and :meth:`~aplpy.FITSFigure.set_yaxis_coord_type` methods in the
15 :class:`~aplpy.FITSFigure` object::
1616
1717 f = FITSFigure('2MASS_k.fits')
1818 f.set_xaxis_coord_type('scalar')
5757
5858 When plotting images in sky coordinates, APLpy makes pixel square by default,
5959 but it is possible to change this, which can be useful for non-sky
60 coordinates. When calling :meth:`~aplpy.aplpy.FITSFigure.show_grayscale` or
61 :meth:`~aplpy.aplpy.FITSFigure.show_colorscale`, simply add ``aspect='auto'``
60 coordinates. When calling :meth:`~aplpy.FITSFigure.show_grayscale` or
61 :meth:`~aplpy.FITSFigure.show_colorscale`, simply add ``aspect='auto'``
6262 which will override the ``aspect='equal'`` default.
1010 f = aplpy.FITSFigure('example.jpg')
1111 f.show_rgb()
1212
13 Note that no filename is required for :meth:`~aplpy.aplpy.FITSFigure.show_rgb`
13 Note that no filename is required for :meth:`~aplpy.FITSFigure.show_rgb`
1414 in this case.
1515
16 If PyAVM is installed, :func:`~aplpy.rgb.make_rgb_image` can embed AVM
16 If PyAVM is installed, :func:`~aplpy.make_rgb_image` can embed AVM
1717 meta-data into RGB images it creates, although only JPEG and PNG files support
1818 this::
1919
2828 f.show_rgb()
2929
3030 In other words, this means that when creating an RGB image with APLpy, it is
31 no longer necessary to initialize :class:`~aplpy.aplpy.FITSFigure` with a FITS
32 file and then use :meth:`~aplpy.aplpy.FITSFigure.show_rgb` with the RGB image
33 filename - instead, :class:`~aplpy.aplpy.FITSFigure` can be directly
31 no longer necessary to initialize :class:`~aplpy.FITSFigure` with a FITS
32 file and then use :meth:`~aplpy.FITSFigure.show_rgb` with the RGB image
33 filename - instead, :class:`~aplpy.FITSFigure` can be directly
3434 initialized with the AVM-tagged image.
3535
3636 To disable the embedding of AVM tags, you can use the ``embed_avm_tags=False``
37 option for :func:`~aplpy.rgb.make_rgb_image`.
37 option for :func:`~aplpy.make_rgb_image`.
3838
3939 These features require `PyAVM 0.9.1 <http://astrofrog.github.io/pyavm/>`_
4040 or later. Please report any issues you encounter `here
00 Creating subplots
11 -----------------
22
3 By default, :class:`~aplpy.aplpy.FITSFigure` creates a figure with a single
3 By default, :class:`~aplpy.FITSFigure` creates a figure with a single
44 subplot that occupies the entire figure. However, APLpy can be used to place a
55 subplot in an existing matplotlib figure instance. To do this,
6 :class:`~aplpy.aplpy.FITSFigure` should be called with the ``figure=``
6 :class:`~aplpy.FITSFigure` should be called with the ``figure=``
77 argument as follows::
88
99 import aplpy
88 this page, these are given in the form of example values. In
99 addition, not all of the optional keywords are mentioned here.
1010 For more information on a specific command and all the options
11 available, type ``help`` followed by the method name, e.g. ``help
12 fig.show_grayscale``. When multiple optional arguments are given,
13 this does not mean that all of them have to be specified, but
11 available, use the ``help()`` function, e.g.
12 ``help(fig.show_grayscale)``. When multiple optional arguments are
13 given, this does not mean that all of them have to be specified, but
1414 just shows all the options available.
1515
1616 Introduction
144144 fig.add_colorbar()
145145 fig.remove_colorbar()
146146
147 Once :meth:`~aplpy.aplpy.FITSFigure.add_colorbar` has been called, the ``fig.colorbar`` object is created and the following methods are then available:
147 Once :meth:`~aplpy.FITSFigure.add_colorbar` has been called, the ``fig.colorbar`` object is created and the following methods are then available:
148148
149149 * Show and hide the colorbar::
150150
195195 fig.add_grid()
196196 fig.remove_grid()
197197
198 Once :meth:`~aplpy.aplpy.FITSFigure.add_grid` has been called, the ``fig.grid`` object is created and the following methods are then available:
198 Once :meth:`~aplpy.FITSFigure.add_grid` has been called, the ``fig.grid`` object is created and the following methods are then available:
199199
200200 * Show and hide the grid::
201201
228228 fig.add_scalebar()
229229 fig.remove_scalebar()
230230
231 Once :meth:`~aplpy.aplpy.FITSFigure.add_scalebar` has been called, the ``fig.scalebar`` object is created and the following methods are then available:
231 Once :meth:`~aplpy.FITSFigure.add_scalebar` has been called, the ``fig.scalebar`` object is created and the following methods are then available:
232232
233233 * Show and hide the scalebar::
234234
290290 fig.add_beam()
291291 fig.remove_beam()
292292
293 Once :meth:`~aplpy.aplpy.FITSFigure.add_beam` has been called, the ``fig.beam`` object is created and the following methods are then available:
293 Once :meth:`~aplpy.FITSFigure.add_beam` has been called, the ``fig.beam`` object is created and the following methods are then available:
294294
295295 * Show and hide the beam::
296296
1919
2020 import aplpy
2121
22 To start off, use the :class:`~aplpy.aplpy.FITSfigure` class to create a
22 To start off, use the :class:`~aplpy.FITSFigure` class to create a
2323 canvas to where your data will be plotted::
2424
2525 gc = aplpy.FITSFigure('fits/2MASS_k.fits')
4848 gc.show_colorscale(cmap='gist_heat')
4949
5050 to show the image showing a 'heat' map. You can find more information in the
51 :meth:`~aplpy.aplpy.FITSFigure.show_grayscale` and
52 :meth:`~aplpy.aplpy.FITSFigure.show_colorscale` documentation. For
51 :meth:`~aplpy.FITSFigure.show_grayscale` and
52 :meth:`~aplpy.FITSFigure.show_colorscale` documentation. For
5353 example, you can control the minimum and maximum pixel values to show and the
5454 stretch function to use.
5555
7373
7474 gc.show_contour('fits/mips_24micron.fits', colors='white')
7575
76 There are a number of arguments that can be passed to :meth:`~aplpy.aplpy.FITSFigure.show_contour` to
76 There are a number of arguments that can be passed to :meth:`~aplpy.FITSFigure.show_contour` to
7777 control the appearance of the contours as well as the number of levels to
78 show. For more information, see the see the :meth:`~aplpy.aplpy.FITSFigure.show_contour` documentation.
78 show. For more information, see the see the :meth:`~aplpy.FITSFigure.show_contour` documentation.
7979
8080 Display a coordinate grid using::
8181
9090 or numpy arrays that are already defined::
9191
9292 import numpy
93 data = numpy.loadtxt('data/yso_wcs_only.txt')
94 ra, dec = data[:, 0], data[:, 1]
93 ra, dec = numpy.loadtxt('data/yso_wcs_only.txt', unpack=True)
9594 gc.show_markers(ra, dec, edgecolor='green', facecolor='none',
9695 marker='o', s=10, alpha=0.5)
9796
98 For more information, see the :meth:`~aplpy.aplpy.FITSFigure.show_markers`
97 For more information, see the :meth:`~aplpy.FITSFigure.show_markers`
9998 documentation.
10099
101100 It's often the case that you might want to change the look of a contour or
102 markers, but if you run :meth:`~aplpy.aplpy.FITSFigure.show_contour` or :meth:`~aplpy.aplpy.FITSFigure.show_markers` a second time, it
101 markers, but if you run :meth:`~aplpy.FITSFigure.show_contour` or :meth:`~aplpy.FITSFigure.show_markers` a second time, it
103102 will overplot rather than replacing. To solve this problem APLpy has 'layers'
104103 which can be manipulated in a basic way. Type::
105104
112111 -> contour_set_1
113112 -> marker_set_1
114113
115 You can use :meth:`~aplpy.aplpy.FITSFigure.remove_layer`, :meth:`~aplpy.aplpy.FITSFigure.hide_layer`, and :meth:`~aplpy.aplpy.FITSFigure.show_layer` to manipulate
114 You can use :meth:`~aplpy.FITSFigure.remove_layer`, :meth:`~aplpy.FITSFigure.hide_layer`, and :meth:`~aplpy.FITSFigure.show_layer` to manipulate
116115 the layers, and you can also specify the ``layer=name`` argument to
117 :meth:`~aplpy.aplpy.FITSFigure.show_contour` or :meth:`~aplpy.aplpy.FITSFigure.show_markers`. Using the latter forces APLpy to name
116 :meth:`~aplpy.FITSFigure.show_contour` or :meth:`~aplpy.FITSFigure.show_markers`. Using the latter forces APLpy to name
118117 the layer you are creating with the name provided, and can also be used to
119118 replace an existing layer. For example, let's change the color of the markers
120119 from green to red::
123122 facecolor='none', marker='o', s=10, alpha=0.5)
124123
125124 Note the presence of the ``layer='marker_set_1'`` which means that the
126 current markers plot will be replaced. To view active layers, you can use the :meth:`~aplpy.aplpy.FITSFigure.list_layers` documentation.
125 current markers plot will be replaced. To view active layers, you can use the :meth:`~aplpy.FITSFigure.list_layers` documentation.
127126
128127 To wrap up this tutorial, we will save the plot to a file. Type the following::
129128
148147
149148 gc.show_contour('fits/mips_24micron.fits', colors='white')
150149
151 data = numpy.loadtxt('data/yso_wcs_only.txt')
152 ra, dec = data[:, 0], data[:, 1]
150 ra, dec = numpy.loadtxt('data/yso_wcs_only.txt', unpack=True)
153151
154152 gc.show_markers(ra, dec, layer='marker_set_1', edgecolor='red',
155153 facecolor='none', marker='o', s=10, alpha=0.5)
55
66 APLpy supports extracting a slice from n-dimensional FITS cubes, and
77 re-ordering dimensions. The two key arguments to
8 :class:`~aplpy.aplpy.FITSFigure` to control this are ``dimensions`` and
9 ``slices``. These arguments can also be passed to :meth:`~aplpy.aplpy.FITSFigure.show_contour`.
8 :class:`~aplpy.FITSFigure` to control this are ``dimensions`` and
9 ``slices``. These arguments can also be passed to :meth:`~aplpy.FITSFigure.show_contour`.
1010
1111 The ``dimensions`` argument is used to specify which dimensions should be used
1212 for the x- and y-axis respectively (zero based). The default values are ``[0,
4343
4444 When plotting images in sky coordinates, APLpy makes pixel square by default,
4545 but it is possible to change this. When calling
46 :meth:`~aplpy.aplpy.FITSFigure.show_grayscale` or
47 :meth:`~aplpy.aplpy.FITSFigure.show_colorscale`, simply add ``aspect='auto'``
46 :meth:`~aplpy.FITSFigure.show_grayscale` or
47 :meth:`~aplpy.FITSFigure.show_colorscale`, simply add ``aspect='auto'``
4848 which will override the ``aspect='equal'`` default. The ``aspect='auto'`` is
4949 demonstrated below.
5050
9999 :no-main-docstr:
100100 :no-heading:
101101 :no-inheritance-diagram:
102 :inherited-members:
99 If you are starting from three images with different projections/resolutions,
1010 the first step is to reproject these to a common projection/resolution. The
1111 following code shows how this can be done using the
12 :func:`~aplpy.rgb.make_rgb_cube` function::
12 :func:`~aplpy.make_rgb_cube` function::
1313
1414 aplpy.make_rgb_cube(['2mass_k.fits', '2mass_h.fits',
1515 '2mass_j.fits'], '2mass_cube.fits')
2323 Producing an RGB image from images in a common projection
2424 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2525
26 The :func:`~aplpy.rgb.make_rgb_image` function can be used to produce an RGB
26 The :func:`~aplpy.make_rgb_image` function can be used to produce an RGB
2727 image from either three FITS files in the exact same projection, or a FITS cube
2828 containing the three channels (such as that output by
29 :func:`~aplpy.rgb.make_rgb_cube`). The following example illustrates how to do
29 :func:`~aplpy.make_rgb_cube`). The following example illustrates how to do
3030 this::
3131
3232 aplpy.make_rgb_image('2mass_cube.fits','2mass_rgb.png')
5858
5959 On the other hand, if you are not able to use PyAVM, or need to use a format
6060 other than JPEG or PNG, then you need to instantiate the
61 :class:`~aplpy.aplpy.FITSFigure` class with a FITS file with exactly the same
62 dimensions and WCS as the RGB image. The :func:`~aplpy.rgb.make_rgb_cube`
61 :class:`~aplpy.FITSFigure` class with a FITS file with exactly the same
62 dimensions and WCS as the RGB image. The :func:`~aplpy.make_rgb_cube`
6363 function will in fact produce a file with the same name as the main output, but
6464 including a ``_2d`` suffix, and this can be used to instantiate
65 :class:`~aplpy.aplpy.FITSFigure`::
65 :class:`~aplpy.FITSFigure`::
6666
6767 # Reproject the images to a common projection - this will also
6868 # produce 2mass_cube_2d.fits
+0
-5
docs/rtd-pip-requirements less more
0 numpy
1 Cython
2 astropy
3 matplotlib
4 sphinx-astropy
2121 [metadata]
2222 package_name = aplpy
2323 description = The Astronomical Plotting Library in Python
24 long_description = The Astronomical Plotting Library in Python
2524 author = Thomas Robitaille and Eli Bressert
2625 author_email = thomas.robitaille@gmail.com, elibre@users.sourceforge.net
2726 license = MIT
3029 github_project = aplpy/aplpy
3130 install_requires = numpy, astropy>=3.1, matplotlib>=2.0, reproject>=0.4
3231 # version should be PEP440 compatible (https://www.python.org/dev/peps/pep-0440/)
33 version = 2.0rc2
32 version = 2.0
3433
3534 [options.extras_require]
3635 docs = sphinx-astropy
121121 # ``setup``, since these are now deprecated. See this link for more details:
122122 # https://groups.google.com/forum/#!topic/astropy-dev/urYO8ckB2uM
123123
124 setup(name=PACKAGENAME,
124 setup(name='APLpy',
125125 version=VERSION,
126126 description=DESCRIPTION,
127127 scripts=scripts,