fetch_tiles

hips.fetch_tiles(tile_metas: typing.List[hips.tiles.tile.HipsTileMeta], hips_survey: hips.tiles.survey.HipsSurveyProperties, progress_bar: bool = True, n_parallel: int = 5, timeout: float = 10, fetch_package: str = 'urllib') → typing.List[hips.tiles.tile.HipsTile][source]

Fetch a list of HiPS tiles.

This function fetches a list of HiPS tiles based on their URLs, which are generated using hips_survey and tile_metas.

The tiles are then fetched asynchronously using urllib or aiohttp.

Parameters:

tile_metas : list

Python list of HipsTileMeta

hips_survey : HipsSurveyProperties

HiPS survey properties

progress_bar : bool

Show a progress bar for tile fetching and drawing

n_parallel : int

Number of tile fetch web requests to make in parallel

timeout : float

Seconds to timeout for fetching a HiPS tile

fetch_package : {‘urllib’, ‘aiohttp’}

Package to use for fetching HiPS tiles

Returns:

tiles : list

A Python list of HipsTile

Examples

Define a list of tiles we want:

from hips import HipsSurveyProperties, HipsTileMeta
from hips import fetch_tiles
url = 'http://alasky.unistra.fr/DSS/DSS2Merged/properties'
hips_survey = HipsSurveyProperties.fetch(url)
tile_indices = [69623, 69627, 69628, 69629, 69630, 69631]
tile_metas = []
for healpix_pixel_index in tile_indices:
    tile_meta = HipsTileMeta(
       order=7,
       ipix=healpix_pixel_index,
       frame=hips_survey.astropy_frame,
       file_format='fits',
    )
    tile_metas.append(tile_meta)

Fetch all tiles (in parallel):

tiles = fetch_tiles(tile_metas, hips_survey)