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.DataArraywith a sample image of the Sentinel-2 satellite (10 m bands). The spectral dataset is loaded as apandas.DataFramewith Landsat 8 reflectance samples of three different land covers.- Returns:
Loaded dataset.
- Return type:
Any
Examples
Open the
sentineldataset:>>> 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
spectraldataset:>>> 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)