cupy_xarray.cog3pio.Cog3pioBackendEntrypoint¶
- class cupy_xarray.cog3pio.Cog3pioBackendEntrypoint[source]¶
Xarray backend to read GeoTIFF files using ‘cog3pio’ engine.
When using
xarray.open_dataarray()withengine="cog3pio", the optionaldevice_idparameter can be set to the CUDA GPU id to do the decoding on.Examples
Read a GeoTIFF from a HTTP url into an [xarray.DataArray][]:
>>> import xarray as xr >>> # Read GeoTIFF into an xarray.DataArray >>> dataarray: xr.DataArray = xr.open_dataarray( ... filename_or_obj="https://github.com/OSGeo/gdal/raw/v3.11.0/autotest/gcore/data/byte_zstd.tif", ... engine="cog3pio", ... device_id=0, # cuda:0 ... ) >>> dataarray.sizes Frozen({'band': 1, 'y': 20, 'x': 20}) >>> dataarray.dtype dtype('uint8')
- __init__()¶
Methods
__init__()guess_can_open(filename_or_obj)Backend open_dataset method used by Xarray in
open_dataset().open_dataset(filename_or_obj, *[, ...])Backend open_dataset method used by Xarray in [xarray.open_dataset][].
open_datatree(filename_or_obj, *[, ...])Backend open_datatree method used by Xarray in
open_datatree().open_groups_as_dict(filename_or_obj, *[, ...])Opens a dictionary mapping from group names to Datasets.
Attributes
descriptionopen_dataset_parameterssupports_groupsurl