Env

class buzzard.Env(**kwargs)[source]

Context manager to update buzzard’s states. Can also be used as a decorator.

Parameters

significant: int

Number of significant digits for floating point comparisons Initialized to 9.0 see: https://github.com/earthcube-lab/buzzard/wiki/Precision-system see: https://github.com/earthcube-lab/buzzard/wiki/Floating-Point-Considerations

default_index_dtype: convertible to np.dtype

Default numpy return dtype for array indices. Initialized to np.int32 (signed to allow negative indices by default)

allow_complex_footprint: bool

Whether to allow non north-up / west-left Footprints Initialized to False

Examples

>>> import buzzard as buzz
>>> with buzz.Env(default_index_dtype='uint64'):
...     ds = buzz.Dataset()
...     dsm = ds.aopen_raster('dsm', 'path/to/dsm.tif')
...     x, y = dsm.meshgrid_raster
...     print(x.dtype)
numpy.uint64
>>> @buzz.Env(allow_complex_footprint=True)
... def main():
...     fp = buzz.Footprint(rsize=(10, 10), gt=(100, 1, 0, 100, 0, 1))
__enter__()[source]
__exit__(exc_type=None, exc_val=None, exc_tb=None)[source]
__call__(fn)[source]

Call self as a function.

buzzard.env = <buzzard._env._CurrentEnv object>

Namespace to access current values of buzzard’s environment variable (see buzz.Env)

Example

>>> buzz.env.significant
8.0