HipsTileAllskyArray¶
-
class
hips.
HipsTileAllskyArray
(meta: hips.tiles.tile.HipsTileMeta, raw_data: bytes) → None[source]¶ Bases:
hips.HipsTile
All-sky tile array container.
To quote from section 4.3.2 “Allsky preview file” of the HiPS IVOA working draft: “The tiles at low orders (0 to 3) may be packaged together into a unique file called Allsky.”
This class implements that all-sky tile array format.
TODO: We’re sub-classing
HipsTile
here at the moment. This is weird! Probably the currentHipsTile
should be renamedImageIO
or be split up into functions that do image I/O in the three supported formats?TODO: We re-use the
HipsTileMeta
class to storeorder
as well as other info likefile_format
andframe
. Note thatipix
doesn’t make sense for anAllSkyTileArray
. Maybe there’s a better way to handle this without code duplication?Examples
Load an example existing HiPS all-sky image (unfortunately one has to pass a dummy ipix value here):
>>> from hips import HipsTileAllskyArray, HipsTileMeta >>> meta = HipsTileMeta(order=3, ipix=-1, file_format='jpg', frame='icrs') >>> url = 'http://alasky.unistra.fr/Fermi/Color/Norder3/Allsky.jpg' >>> allsky = HipsTileAllskyArray.fetch(meta, url)
Now you can extract tiles (e.g. for drawing):
>>> tile = allsky.tile(ipix=42) >>> tile.meta HipsTileMeta(order=3, ipix=42, file_format='jpg', frame='icrs', width=64)
TODO: add an example how to go the other way: combine tiles into an allsky image.
Attributes Summary
height
Image pixel height (int) n_tiles
Number of tiles in the image (int). n_tiles_in_row
Number of tiles per tile row (int). tile_width
Pixel width of a single tile (int). tiles
Split into a list of HipsTile
.width
Image pixel width (int). Methods Summary
from_tiles
(…)Create all-sky image from list of tiles. tile
((ipix: int) -> hips.tiles.tile.HipsTile)Extract one of the tiles ( HipsTile
)tiles_to_allsky_array
(…)Combine tiles into an all-sky image. Attributes Documentation
-
height
¶ Image pixel height (int)
-
n_tiles
¶ Number of tiles in the image (int).
-
n_tiles_in_row
¶ Number of tiles per tile row (int).
-
tile_width
¶ Pixel width of a single tile (int).
-
width
¶ Image pixel width (int).
Methods Documentation
-
classmethod
from_tiles
(tiles: typing.List[hips.tiles.tile.HipsTile]) → hips.tiles.allsky.HipsTileAllskyArray[source]¶ Create all-sky image from list of tiles.
-