ChunkedPlateCarreeSampler

class toasty.samplers.ChunkedPlateCarreeSampler(chunked_image, planetary=False)[source]

Bases: object

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

This only works with the ChunkedJPEG2000Reader image right now, but in principle we could extend to accept other chunked formats.

Assume a typical image coordinate system, where (x,y) = (0,0) is the top-left edge of the image. The “global” coordinate system refers to the un-chunked image, which is probably too big to fit into memory.

In the planetary plate carree projection, (global) X and Y measure latitude and longitude orthogonally. The left edge of the X=0 column has lon = -pi, while the right edge of the X=(W-1) column has lon = +pi. The top edge of the Y=0 row has lat = +pi/2, and the bottom edge of the Y=(H-1) row has lat = -pi/2.

Attributes Summary

n_chunks

Methods Summary

filter(ichunk)

Get a TOAST tile-filter function for the specified chunk.

sampler(ichunk)

Get a TOAST sampler function for the specified chunk.

Attributes Documentation

n_chunks

Methods Documentation

filter(ichunk)[source]

Get a TOAST tile-filter function for the specified chunk.

Parameters:
ichunkint

The index of the chunk to query, between 0 and self.n_chunks - 1 (inclusive).

Returns:
A callable object, filter(tile) -> bool, suitable for use as a tile
filter function.
sampler(ichunk)[source]

Get a TOAST sampler function for the specified chunk.

Parameters:
ichunkint

The index of the chunk to query, between 0 and self.n_chunks - 1 (inclusive).

Returns:
A callable object, sampler(lon, lat) -> data, suitable for use as a tile
sampler function.