tcvis
darts_acquisition.tcvis
¶
Landsat Trends related Data Loading. Should be used temporary and maybe moved to the acquisition package.
load_tcvis
¶
load_tcvis(
geobox: odc.geo.geobox.GeoBox,
data_dir: pathlib.Path | str,
buffer: int = 0,
persist: bool = True,
) -> xarray.Dataset
Load the TCVIS for the given geobox, fetch new data from GEE if necessary.
Parameters:
-
geobox
(odc.geo.geobox.GeoBox
) –The geobox to load the data for.
-
data_dir
(pathlib.Path | str
) –The directory to store the downloaded data for faster access for consecutive calls.
-
buffer
(int
, default:0
) –The buffer around the geobox in pixels. Defaults to 0.
-
persist
(bool
, default:True
) –If the data should be persisted in memory. If not, this will return a Dask backed Dataset. Defaults to True.
Returns:
Usage
Since the API of the load_tcvis
is based on GeoBox, one can load a specific ROI based on an existing Xarray DataArray:
import xarray as xr
import odc.geo.xr
from darts_aquisition import load_tcvis
# Assume "optical" is an already loaded s2 based dataarray
tcvis = load_tcvis(
optical.odc.geobox,
"/path/to/tcvis-parent-directory",
)
# Now we can for example match the resolution and extent of the optical data:
tcvis = tcvis.odc.reproject(optical.odc.geobox, resampling="cubic")