Skip to content

Commit

Permalink
Update high-level docs example
Browse files Browse the repository at this point in the history
  • Loading branch information
adl1995 committed Jul 25, 2017
1 parent c15092b commit 8782375
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,18 @@ To make a sky image with the `hips` package, follow the following three steps:


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::
and draw it, returning the an object of `~hips.HipsDrawResult`::

from hips import make_sky_image

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


That's it. Go ahead and try it out for your favourite sky region and survey.

Now you can then save the sky image to local disk e.g. FITS file format::

from astropy.io import fits
hdu = fits.PrimaryHDU(data=data, header=geometry.fits_header)
hdu.writeto('my_image.fits')
result.write_image('my_image.fits')

or plot and analyse the sky image however you like.

Expand Down
2 changes: 1 addition & 1 deletion hips/draw/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def write_image(self, filename: str) -> None:
Filename
"""
if self.tile_format == 'fits':
hdu = fits.PrimaryHDU(self.image)
hdu = fits.PrimaryHDU(data=self.image, header=self.geometry.fits_header)
hdu.writeto(filename)
else:
image = Image.fromarray(self.image)
Expand Down

0 comments on commit 8782375

Please sign in to comment.