toasty.samplers Module

“Sampler” functions that fetch image data as a function of sky coordinates.

The Sampler Protocol

A sampler is a callable object that obeys the following signature: func(lon, lat) -> data, where lon and lat are 2D numpy arrays of spherical coordinates measured in radians, and the returned data array is a numpy array of at least two dimensions whose first two axes have the same shape as lon and lat. The data array gives the map values sampled at the corresponding coordinates. Its additional dimensions can be used to encode color information: one standard is for data to have a dtype of np.uint8 and a shape of (ny, nx, 3), where the final axis samples RGB colors.

Functions

plate_carree_sampler(data)

Create a sampler function for all-sky data in a “plate carrée” projection.

plate_carree_galactic_sampler(data)

Create a sampler function for all-sky data in a “plate carrée” projection using Galactic coordinates.

plate_carree_ecliptic_sampler(data)

Create a sampler function for all-sky data in a “plate carrée” projection using ecliptic coordinates.

plate_carree_planet_sampler(data)

Create a sampler function for planetary data in a “plate carrée” projection.

plate_carree_planet_zeroleft_sampler(data)

Create a sampler function for planetary data in a “plate carrée” projection where the longitude=0 line is on the left edge of the image.

plate_carree_zeroright_sampler(data)

Create a sampler function for data in a “plate carrée” projection where the longitude=0 line is on the right edge of the image.

healpix_fits_file_sampler(path[, extension, ...])

Create a sampler for HEALPix data read from a FITS file.

healpix_sampler(data[, nest, coord, ...])

Create a sampler for HEALPix image data.

Classes

ChunkedPlateCarreeSampler(chunked_image[, ...])

Setup for TOAST sampling of a chunked plate-carree image.

WcsSampler(data, wcs)

Create a sampler for data with a generic WCS specification.