spyndex.datasets.open

spyndex.datasets.open(dataset: str) Any[source]

Opens a dataset.

Parameters:

dataset (str) – One of “sentinel” or “spectral”. The sentinel dataset is loaded as a xarray.DataArray with a sample image of the Sentinel-2 satellite (10 m bands). The spectral dataset is loaded as a pandas.DataFrame with Landsat 8 reflectance samples of three different land covers.

Returns:

Loaded dataset.

Return type:

Any

Examples

Open the sentinel dataset:

>>> import spyndex
>>> spyndex.datasets.open("sentinel")
<xarray.DataArray (band: 4, x: 300, y: 300)>
Coordinates:
* band     (band) <U3 'B02' 'B03' 'B04' 'B08'
Dimensions without coordinates: x, y

Open the spectral dataset:

>>> spt = spyndex.datasets.open("spectral")
>>> spt.dtypes
SR_B1     float64
SR_B2     float64
SR_B3     float64
SR_B4     float64
SR_B5     float64
SR_B6     float64
SR_B7     float64
ST_B10    float64
class      object
dtype: object
>>> spt.shape
(120, 9)