From 8782375d7c25d9cf3bf00f9835adc327aa17d811 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Tue, 25 Jul 2017 19:30:10 +0500 Subject: [PATCH] Update high-level docs example --- docs/getting_started.rst | 8 +++----- hips/draw/simple.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index ac958e1..aadda40 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -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. diff --git a/hips/draw/simple.py b/hips/draw/simple.py index 2539df3..d53e408 100644 --- a/hips/draw/simple.py +++ b/hips/draw/simple.py @@ -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)