toasty.toast.sample_layer(pio, sampler, depth, parallel=None, cli_progress=False, format=None)[source]

Generate a layer of the TOAST tile pyramid through direct sampling.


A PyramidIO instance to manage the I/O with the tiles in the tile pyramid.


The sampler callable that will produce data for tiling.


The depth of the layer of the TOAST tile pyramid to generate. The number of tiles in each layer is 4**depth. Each tile is 256×256 TOAST pixels, so the resolution of the pixelization at which the data will be sampled is a refinement level of 2**(depth + 8).

parallelinteger or None (the default)

The level of parallelization to use. If unspecified, defaults to using all CPUs. If the OS does not support fork-based multiprocessing, parallel processing is not possible and serial processing will be forced. Pass 1 to force serial processing.

cli_progressoptional boolean, defaults False

If true, a progress bar will be printed to the terminal using tqdm.