earthdaily.accessor package

Subpackages

Module contents

class earthdaily.accessor.EarthDailyAccessorDataArray(xarray_obj)[source]

Bases: object

centroid(to_wkt: str = False, to_4326: bool = True)[source]

Return the geographic center point in 4326/WKT of this dataset.

clip(geom)[source]
drop_unfrozen_coords(keep_spatial_ref=True)[source]
lee_filter(window_size: int)[source]
plot_band(cmap='Greys', col='time', col_wrap=5, **kwargs)[source]
sel_nearest_dates(target: (<class 'xarray.core.dataset.Dataset'>, <class 'xarray.core.dataarray.DataArray'>), max_delta: int = 0, method: str = 'nearest', return_target: bool = False)[source]
whittaker(beta: float = 10000.0, weights: (<class 'numpy.ndarray'>, <class 'list'>) = None, time='time')[source]
zonal_stats(geometry, reducers: list = ['mean'], label: str = None, lazy_load=True, **kwargs)[source]

Zonal stats from dtacube

Parameters:
  • geometry (str,gpd.GeoDataFrame) – A geometry (wkt, geopandas…)

  • stats (list, optional) – The default is [“mean”].

  • raise_missing_geometry (bool, optional) – DESCRIPTION. The default is False.

  • **kwargs (dict) – Any kwargs for xvec.zonal_stats.

Returns:

With new dimension “zonal_statistics” and “geometry”.

Return type:

xr.dataset

class earthdaily.accessor.EarthDailyAccessorDataset(xarray_obj)[source]

Bases: EarthDailyAccessorDataArray

add_indices(indices: list[str | dict], **kwargs)[source]

Uses spyndex to compute and add index.

For list of indices, see https://github.com/awesome-spectral-indices/awesome-spectral-indices.

Parameters:

indices (list[str|dict]) – [‘NDVI’,{‘NDVI2’:’(red-nir)/(red+nir)’}].

Returns:

The input xr.Dataset with new data_vars of indices.

Return type:

xr.Dataset

available_indices(details=False)[source]
plot_band(band, cmap='Greys', col='time', col_wrap=5, **kwargs)[source]
plot_rgb(red: str = 'red', green: str = 'green', blue: str = 'blue', col='time', col_wrap=5, background: None | int | float = None, **kwargs)[source]
earthdaily.accessor.xr_loop_func(dataset: Dataset, func, to_numpy: bool = False, loop_dimension: str = 'time', **kwargs)[source]