EDK Accessor¶
- class earth_data_kit.xarray_boosted.edk_accessor.EDKAccessor(xarray_obj)
The EDK Accessor extends xarray’s functionality by providing additional methods for working with Earth Data Kit datasets. This accessor is automatically registered with xarray when edk is imported, allowing you to access these extended capabilities through the .edk namespace on xarray objects.
- export(output_path, overwrite=False)
Export an xarray DataArray to Cloud Optimized GeoTIFF (COG) format.
This method handles different dimensional configurations: - For 4D data (time, band, x, y): Creates separate COGs for each time step - For 3D data (band, x, y): Creates a single COG with multiple bands - For 2D data (x, y): Creates a single COG with one band
- Parameters:
output_path (str) – Path where the COG(s) will be saved. For time series data, this should be a directory. For single COG, this should be the full file path.
overwrite (bool, optional) – If True, overwrites existing files at the output path. Default is False.
- Returns:
Creates COG file(s) at the specified output path.
- Return type:
None
- Raises:
ValueError – If the DataArray dimensions are not valid for COG export.
- plot(colors=None, opacity=1)
Plot the data on an interactive map using folium.
Note: This implementation currently loads all the data into memory, which may not be suitable for larger datasets. Future optimizations such as tilesets are planned to improve performance with large datasets.
- Parameters:
colors (list, optional) – A list of colors to use for the colormap. If None, the default viridis colormap will be used.
opacity (float, optional) – The opacity of the overlay, between 0 and 1. Defaults to 1 (fully opaque).
- Returns:
An interactive map with the data overlaid on OpenStreetMap.
- Return type:
folium.Map