open_asset¶
Import path: earth2studio.data.stac.open_asset
Documentation¶
Open one item asset as a lazy, dask-backed xarray.DataArray.
Nothing beyond the file header is read until values are requested, so
windowing (.rio.clip_box, .isel) before .compute() fetches only
the COG tiles covering that window. The array keeps the asset's native
grid and CRS (da.rio.crs, da.rio.transform()).
Parameters:
-
item(Item) –Item returned by
search_items. -
asset(str) –Asset key, e.g.
"red". -
provider(StacProvider | None, default:None) –Provider whose
signturns the href into a GDAL path; inferred from the href host when None, by default None -
chunks(int | Mapping[str, int] | None, default:1024) –Dask chunk size; an int is used for both
xandy. Match the COG's internal block size for best throughput. None loads eagerly, by default 1024 -
rescale(bool, default:True) –Apply the STAC
raster:bandsscale/offset(or, failing that, the file's own scale/offset tags) so values are in physical units, by default True -
mask_nodata(bool, default:True) –Replace
raster:bands/file nodata with NaN, by default True
Returns:
-
DataArray–(time, y, x)for single-band assets, else(time, band, y, x)(notimewhen the item has neitherdatetimenorstart_datetime); float32 (float64 for 32/64-bit inputs) when values are rescaled or masked, otherwise the file dtype.