Skip to content

Commit

Permalink
Simplify import in docs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeil committed Jul 20, 2017
1 parent 438bbe4 commit fe19120
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
6 changes: 3 additions & 3 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To make a sky image with the `hips` package, follow the following three steps:
1. Specify the sky image geometry you want by creating a `~hips.utils.WCSGeometry` object::

from astropy.coordinates import SkyCoord
from hips.utils import WCSGeometry
from hips import WCSGeometry

geometry = WCSGeometry.create(
skydir=SkyCoord(0, 0, unit='deg', frame='galactic'),
Expand All @@ -31,15 +31,15 @@ To make a sky image with the `hips` package, follow the following three steps:

A good address that lists available HiPS data is http://aladin.u-strasbg.fr/hips/list ::

from hips.tiles import HipsSurveyProperties
from hips import HipsSurveyProperties
url = 'http://alasky.unistra.fr/DSS/DSS2Merged/properties'
hips_survey = HipsSurveyProperties.fetch(url)


3. Call the `~hips.make_sky_image` function to fetch the HiPS data
and draw it, returning the sky image pixel data as a Numpy array::

from hips.draw import make_sky_image
from hips import make_sky_image

data = make_sky_image(geometry, hips_survey, 'fits')

Expand Down
4 changes: 1 addition & 3 deletions docs/plot_fits.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Basic example how to plot a sky image with the hips package"""
from astropy.coordinates import SkyCoord
from hips import HipsSurveyProperties
from hips import make_sky_image
from hips.utils import WCSGeometry
from hips import WCSGeometry, HipsSurveyProperties, make_sky_image

# Compute the sky image
url = 'http://alasky.unistra.fr/DSS/DSS2Merged/properties'
Expand Down
4 changes: 1 addition & 3 deletions docs/plot_jpg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Basic example how to plot a sky image with the hips package"""
from astropy.coordinates import SkyCoord
from hips import HipsSurveyProperties
from hips import make_sky_image
from hips.utils import WCSGeometry
from hips import WCSGeometry, HipsSurveyProperties, make_sky_image

# Compute the sky image
url = 'http://alasky.u-strasbg.fr/Fermi/Color/properties'
Expand Down
10 changes: 5 additions & 5 deletions hips/draw/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ class SimpleTilePainter:
Examples
--------
>>> from hips.utils import WCSGeometry
>>> from hips.draw import SimpleTilePainter
>>> from hips.tiles import HipsSurveyProperties
>>> from astropy.coordinates import SkyCoord
>>> url = 'http://alasky.unistra.fr/DSS/DSS2Merged/properties'
>>> hips_survey = HipsSurveyProperties.fetch(url)
>>> from hips import WCSGeometry
>>> from hips import HipsSurveyProperties
>>> from hips import SimpleTilePainter
>>> geometry = WCSGeometry.create(
... skydir=SkyCoord(0, 0, unit='deg', frame='icrs'),
... width=2000, height=1000, fov='3 deg',
... coordsys='icrs', projection='AIT',
... )
>>> url = 'http://alasky.unistra.fr/DSS/DSS2Merged/properties'
>>> hips_survey = HipsSurveyProperties.fetch(url)
>>> painter = SimpleTilePainter(geometry, hips_survey, 'fits')
>>> painter.draw_hips_order
7
Expand Down
4 changes: 2 additions & 2 deletions hips/tiles/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HipsTileMeta:
Examples
--------
>>> from hips.tiles import HipsTileMeta
>>> from hips import HipsTileMeta
>>> tile_meta = HipsTileMeta(order=3, ipix=450, file_format='fits', frame='icrs')
>>> tile_meta
HipsTileMeta(order=3, ipix=450, file_format='fits', frame='icrs')
Expand Down Expand Up @@ -104,7 +104,7 @@ class HipsTile:
Fetch a HiPS tile:
>>> from hips.tiles import HipsTile, HipsTileMeta
>>> from hips import HipsTile, HipsTileMeta
>>> meta = HipsTileMeta(order=6, ipix=30889, file_format='fits')
>>> url = 'http://alasky.unistra.fr/2MASS/H/Norder6/Dir30000/Npix30889.fits'
>>> tile = HipsTile.fetch(meta, url)
Expand Down
2 changes: 1 addition & 1 deletion hips/utils/healpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def healpix_pixels_in_sky_image(geometry: WCSGeometry, order: int, healpix_frame
Examples
--------
>>> from astropy.coordinates import SkyCoord
>>> from hips.utils import WCSGeometry
>>> from hips import WCSGeometry
>>> from hips.utils import healpix_pixels_in_sky_image
>>> skycoord = SkyCoord(10, 20, unit="deg")
>>> geometry = WCSGeometry.create(
Expand Down

0 comments on commit fe19120

Please sign in to comment.