Important docs! and code examples
https://lpdaac.usgs.gov/documents/1326/HLS_User_Guide_V2.pdf
https://www.sciencedirect.com/science/article/pii/S0034425718304139
Needs updating, but helpful: https://lpdaac.usgs.gov/resources/e-learning/getting-started-cloud-native-hls-data-python/
And https://nbviewer.org/github/microsoft/AIforEarthDataSets/blob/main/data/hls.ipynb
import geopandas as gpd
import pandas as pd
# mamba install odc-stac odc-geo pyarrow=10 -c conda-forge
import odc
from odc.geo.geobox import GeoBox
import odc.stac
import pystac_client
#import planetary_computer
import holoviews as hv
import hvplot.pandas
import hvplot.xarray
import xarray as xr
import fsspec
import ast
import numpy as np
import pystac
import os
stac_client = pystac_client.Client.open('https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD')
%%time
search = stac_client.search(
collections = ['HLSS30.v2.0', 'HLSL30.v2.0'],
intersects=dict(type="Point", coordinates=[-105.78, 35.79]), # Pecos Mtns NM
datetime = '2022/2024',
)
items = search.get_all_items()
print(f'Returned {len(items)} items')
Returned 201 items CPU times: user 141 ms, sys: 8.01 ms, total: 149 ms Wall time: 4.9 s
gf = gpd.GeoDataFrame.from_features( items.to_dict(), crs='EPSG:4326')
# Instead of re-doing searches, can save and reload
# items.save_object_object('results.json')
# items = pystac.ItemCollection.from_file('results.json')
# gf = gpd.read_file('results.json')
items[0].self_href
'https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0/items/HLS.S30.T13SDV.2022001T175739.v2.0'
items[0].assets['B03'].href
'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B03.tif'
gf['stac_id'] = [item.id for item in items]
gf['time'] = pd.to_datetime(gf.datetime) # Use standard xarray dimension name 'time' for index
gf.head()
geometry | eo:cloud_cover | datetime | start_datetime | end_datetime | stac_id | time | |
---|---|---|---|---|---|---|---|
0 | POLYGON ((-106.09829 35.14991, -105.85526 35.1... | 100 | 2022-01-01T18:04:02.903000Z | 2022-01-01T18:04:02.903Z | 2022-01-01T18:04:02.903Z | HLS.S30.T13SDV.2022001T175739.v2.0 | 2022-01-01 18:04:02.903000+00:00 |
1 | POLYGON ((-106.09829 35.14991, -104.89284 35.1... | 6 | 2022-01-03T17:54:13.056000Z | 2022-01-03T17:54:13.056Z | 2022-01-03T17:54:13.056Z | HLS.S30.T13SDV.2022003T174731.v2.0 | 2022-01-03 17:54:13.056000+00:00 |
2 | POLYGON ((-106.09829 35.14991, -104.89284 35.1... | 85 | 2022-01-06T17:38:44.248000Z | 2022-01-06T17:38:44.248Z | 2022-01-06T17:39:08.139Z | HLS.L30.T13SDV.2022006T173844.v2.0 | 2022-01-06 17:38:44.248000+00:00 |
3 | POLYGON ((-106.09829 35.14991, -105.85855 35.1... | 34 | 2022-01-06T18:04:08.477000Z | 2022-01-06T18:04:08.477Z | 2022-01-06T18:04:08.477Z | HLS.S30.T13SDV.2022006T175731.v2.0 | 2022-01-06 18:04:08.477000+00:00 |
4 | POLYGON ((-106.09829 35.14991, -104.89284 35.1... | 19 | 2022-01-08T17:54:07.404000Z | 2022-01-08T17:54:07.404Z | 2022-01-08T17:54:07.404Z | HLS.S30.T13SDV.2022008T174719.v2.0 | 2022-01-08 17:54:07.404000+00:00 |
print(gf[gf.stac_id.str.startswith('HLS.L30')].shape)
(48, 7)
print(gf[gf.stac_id.str.startswith('HLS.S30')].shape)
(153, 7)
gf['platform'] = gf.stac_id.str[4] #'L' = Landsat, 'S' = Sentinel
gf['mgrs'] = gf.stac_id.str[9:14]
gf.platform.value_counts()
S 153 L 48 Name: platform, dtype: int64
df = gf.set_index('time').tz_localize(None) # Drop timezone info (always UTC)
df = df.loc[:,['platform','eo:cloud_cover']] # Drop Geometry (#GeoPandasInterface leads to some errors (such as fill_color: expected an element of either String, Dict(Enum('expr', 'field', 'value', 'transform'), Either(String, Instance(Transform), Instance(Expression), Nullable(Color))) or Nullable(Color), got dim('cloud')
df.hvplot.scatter(y='platform', c='eo:cloud_cover', marker='s', width=1000)
iL = items[0] # landsat
iL
ID: HLS.S30.T13SDV.2022001T175739.v2.0 |
Bounding Box: [-106.111925, 35.149912, -105.539103, 36.143685] |
Datetime: 2022-01-01 18:04:02.903000+00:00 |
eo:cloud_cover: 100 |
datetime: 2022-01-01T18:04:02.903000Z |
start_datetime: 2022-01-01T18:04:02.903Z |
end_datetime: 2022-01-01T18:04:02.903Z |
stac_extensions: ['https://stac-extensions.github.io/eo/v1.0.0/schema.json'] |
https://stac-extensions.github.io/eo/v1.0.0/schema.json |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B11.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B11.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B09.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B09.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.VZA.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.VZA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B03.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B03.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B04.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B04.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.VAA.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.VAA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B06.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B06.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.Fmask.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.Fmask.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B08.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B08.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B12.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B12.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B01.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B01.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B07.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B07.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B10.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B10.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B8A.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B8A.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.SAA.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.SAA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.SZA.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.SZA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B05.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B05.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B02.tif |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.B02.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.jpg |
Title: Download HLS.S30.T13SDV.2022001T175739.v2.0.jpg |
Media type: image/jpeg |
Owner: |
href: https://cmr.earthdata.nasa.gov/search/concepts/G2195159893-LPCLOUD.xml |
Media type: application/xml |
Owner: |
Rel: self |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0/items/HLS.S30.T13SDV.2022001T175739.v2.0 |
Rel: parent |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0 |
Rel: collection |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0 |
LPCLOUD
Rel: root |
Target: |
Media Type: application/json |
Rel: provider |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD |
Rel: via |
Target: https://cmr.earthdata.nasa.gov/search/concepts/G2195159893-LPCLOUD.json |
Rel: via |
Target: https://cmr.earthdata.nasa.gov/search/concepts/G2195159893-LPCLOUD.umm_json |
# Do some index calculations
iS = items[-1] #sentinel
iS
ID: HLS.S30.T13SDV.2023043T174439.v2.0 |
Bounding Box: [-106.111925, 35.149912, -104.89151, 36.144896] |
Datetime: 2023-02-12 17:54:09.919000+00:00 |
eo:cloud_cover: 3 |
datetime: 2023-02-12T17:54:09.919000Z |
start_datetime: 2023-02-12T17:54:09.919Z |
end_datetime: 2023-02-12T17:54:09.919Z |
stac_extensions: ['https://stac-extensions.github.io/eo/v1.0.0/schema.json'] |
https://stac-extensions.github.io/eo/v1.0.0/schema.json |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B8A.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B8A.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.SAA.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.SAA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B11.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B11.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B08.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B08.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B10.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B10.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B03.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B03.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B09.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B09.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B12.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B12.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B01.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B01.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B06.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B06.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B05.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B05.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.SZA.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.SZA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B02.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B02.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B04.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B04.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.VZA.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.VZA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.Fmask.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.Fmask.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B07.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.B07.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.VAA.tif |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.VAA.tif |
Owner: |
href: https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.jpg |
Title: Download HLS.S30.T13SDV.2023043T174439.v2.0.jpg |
Media type: image/jpeg |
Owner: |
href: https://cmr.earthdata.nasa.gov/search/concepts/G2611119279-LPCLOUD.xml |
Media type: application/xml |
Owner: |
Rel: self |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0/items/HLS.S30.T13SDV.2023043T174439.v2.0 |
Rel: parent |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0 |
Rel: collection |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD/collections/HLSS30.v2.0 |
LPCLOUD
Rel: root |
Target: |
Media Type: application/json |
Rel: provider |
Target: https://cmr.earthdata.nasa.gov/cloudstac/LPCLOUD |
Rel: via |
Target: https://cmr.earthdata.nasa.gov/search/concepts/G2611119279-LPCLOUD.json |
Rel: via |
Target: https://cmr.earthdata.nasa.gov/search/concepts/G2611119279-LPCLOUD.umm_json |
iL.assets
{'B11': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B11.tif>, 'B09': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B09.tif>, 'VZA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.VZA.tif>, 'B03': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B03.tif>, 'B04': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B04.tif>, 'VAA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.VAA.tif>, 'B06': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B06.tif>, 'Fmask': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.Fmask.tif>, 'B08': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B08.tif>, 'B12': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B12.tif>, 'B01': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B01.tif>, 'B07': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B07.tif>, 'B10': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B10.tif>, 'B8A': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B8A.tif>, 'SAA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.SAA.tif>, 'SZA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.SZA.tif>, 'B05': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B05.tif>, 'B02': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.B02.tif>, 'browse': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/HLSS30.020/HLS.S30.T13SDV.2022001T175739.v2.0/HLS.S30.T13SDV.2022001T175739.v2.0.jpg>, 'metadata': <Asset href=https://cmr.earthdata.nasa.gov/search/concepts/G2195159893-LPCLOUD.xml>}
iS.assets
{'B8A': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B8A.tif>, 'SAA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.SAA.tif>, 'B11': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B11.tif>, 'B08': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B08.tif>, 'B10': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B10.tif>, 'B03': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B03.tif>, 'B09': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B09.tif>, 'B12': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B12.tif>, 'B01': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B01.tif>, 'B06': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B06.tif>, 'B05': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B05.tif>, 'SZA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.SZA.tif>, 'B02': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B02.tif>, 'B04': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B04.tif>, 'VZA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.VZA.tif>, 'Fmask': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.Fmask.tif>, 'B07': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B07.tif>, 'VAA': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.VAA.tif>, 'browse': <Asset href=https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.jpg>, 'metadata': <Asset href=https://cmr.earthdata.nasa.gov/search/concepts/G2611119279-LPCLOUD.xml>}
iL.assets.keys()
dict_keys(['B11', 'B09', 'VZA', 'B03', 'B04', 'VAA', 'B06', 'Fmask', 'B08', 'B12', 'B01', 'B07', 'B10', 'B8A', 'SAA', 'SZA', 'B05', 'B02', 'browse', 'metadata'])
iS.assets.keys()
dict_keys(['B8A', 'SAA', 'B11', 'B08', 'B10', 'B03', 'B09', 'B12', 'B01', 'B06', 'B05', 'SZA', 'B02', 'B04', 'VZA', 'Fmask', 'B07', 'VAA', 'browse', 'metadata'])
iS.assets['B8A'].href
'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-protected/HLSS30.020/HLS.S30.T13SDV.2023043T174439.v2.0/HLS.S30.T13SDV.2023043T174439.v2.0.B8A.tif'
MGRS_TILE = gf.mgrs.iloc[0]
url = 'https://github.com/scottyhq/mgrs/raw/main/MGRS_LAND.parquet'
with fsspec.open(url) as file:
gfMGRS = gpd.read_parquet(file)
aoi = gfMGRS.query(' tile == @MGRS_TILE ') # returns a geodataframe
aoi
tile | geometry | epsg | utm_wkt | utm_bounds | |
---|---|---|---|---|---|
1461 | 13SDV | POLYGON ((-106.11193 36.13974, -104.89151 36.1... | 32613 | POLYGON ((399960 4000020,399960 3890220,509760... | (399960.0, 3890220.0, 509760.0, 4000020.0) |
s = aoi.iloc[0] #geoseries
GEOMETRY = s.geometry.__geo_interface__
BOUNDS = ast.literal_eval(s.utm_bounds)
EPSG = str(s.epsg)
GRID = GeoBox.from_bbox(BOUNDS,
crs=EPSG,
#resolution=10,
#resolution=20,
#resolution=100,
resolution=500,
#resolution=1000,
)
GRID
# Need to separate b/c band naming scheme is not the same
itemsL8 = [i for i in items if i.id.startswith('HLS.L')]
itemsS2 = [i for i in items if i.id.startswith('HLS.S')]
len(itemsL8)
48
# Map to common band names
# https://github.com/stac-extensions/eo#common-band-names
common_names = {
'L8': {'B03':'green',
'B04':'red',
'B05':'nir08',
'B06':'swir16',
},
'S2': {'B03':'green',
'B04':'red',
'B8A':'nir08',
'B11':'swir16',
}
}
L = odc.stac.load(
itemsL8,
chunks={'x': 256, 'y': 256},
geobox=GRID
)
L
<xarray.Dataset> Dimensions: (y: 221, x: 221, time: 48) Coordinates: * y (y) float64 4e+06 4e+06 3.999e+06 ... 3.891e+06 3.89e+06 * x (x) float64 3.998e+05 4.002e+05 ... 5.092e+05 5.098e+05 spatial_ref int32 32613 * time (time) datetime64[ns] 2022-01-06T17:38:44.248000 ... 2023-02... Data variables: (12/16) B10 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B03 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B04 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> Fmask (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B05 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B07 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> ... ... B02 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> SAA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B11 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> VZA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> SZA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> browse (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray>
S = odc.stac.load(
itemsS2,
chunks={'x': 256, 'y': 256}, #IF not set will actually read the pixels in eagerly!
geobox=GRID
)
S
<xarray.Dataset> Dimensions: (y: 221, x: 221, time: 153) Coordinates: * y (y) float64 4e+06 4e+06 3.999e+06 ... 3.891e+06 3.89e+06 * x (x) float64 3.998e+05 4.002e+05 ... 5.092e+05 5.098e+05 spatial_ref int32 32613 * time (time) datetime64[ns] 2022-01-01T18:04:02.903000 ... 2023-02... Data variables: (12/19) B11 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B09 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> VZA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B03 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B04 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> VAA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> ... ... B8A (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> SAA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> SZA (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B05 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> B02 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> browse (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray>
# Add 'L8' or 'S2' identifier as coordinate
L = L.assign_coords(platform=('time',['L8',]*L.time.size))
S = S.assign_coords(platform=('time',['S2',]*S.time.size))
# Use common names mapping ('L8': {'B03':'green')
S = S.rename_vars(common_names['S2'])
L = L.rename_vars(common_names['L8'])
# bands to keep track of
bands = ['green', 'red', 'nir08', 'swir16', 'Fmask']# , 'browse'] #browse images have no georeferencing
#xr.merge([ L[bands], S[bands] ]) # not lazy, not sure why...
ds = xr.concat([ L[bands], S[bands] ], dim='time') #Lazy! but no alignment...
ds
<xarray.Dataset> Dimensions: (time: 201, y: 221, x: 221) Coordinates: * y (y) float64 4e+06 4e+06 3.999e+06 ... 3.891e+06 3.89e+06 * x (x) float64 3.998e+05 4.002e+05 ... 5.092e+05 5.098e+05 spatial_ref int32 32613 * time (time) datetime64[ns] 2022-01-06T17:38:44.248000 ... 2023-02... platform (time) <U2 'L8' 'L8' 'L8' 'L8' 'L8' ... 'S2' 'S2' 'S2' 'S2' Data variables: green (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> red (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> nir08 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> swir16 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> Fmask (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray>
# NOTE: concat does not 'align' along the time dimension
np.all(np.diff(ds.time.values).astype(int) > 0)
False
ds = ds.sortby('time')
np.all(np.diff(ds.time.values).astype(int) > 0)
True
# Add cloud-cover estimate from STAC metadata
# Since pandas timeindex is used behind the scenes the metadata should be in the proper place
ds = ds.assign_coords(cloud_cover=df['eo:cloud_cover'])
# Need ~/.netrc to access full resolution NASA images and these GDAL settings
import os
os.environ['GDAL_HTTP_COOKIEJAR'] = '/tmp/cookie'
os.environ['GDAL_HTTP_COOKIEFILE'] = '/tmp/cookie'
os.environ['GDAL_DISABLE_READDIR_ON_OPEN']='EMPTY_DIR'
# Common indicies (lazy)
ds['ndsi'] = (ds.green - ds.swir16) / (ds.green + ds.swir16)
ds['ndvi'] = (ds.nir08 - ds.red) / (ds.nir08 + ds.red)
ds['ndwi'] = (ds.nir08 - ds.swir16) / (ds.nir08 + ds.swir16)
ds
<xarray.Dataset> Dimensions: (time: 201, y: 221, x: 221) Coordinates: * y (y) float64 4e+06 4e+06 3.999e+06 ... 3.891e+06 3.89e+06 * x (x) float64 3.998e+05 4.002e+05 ... 5.092e+05 5.098e+05 spatial_ref int32 32613 * time (time) datetime64[ns] 2022-01-01T18:04:02.903000 ... 2023-02... platform (time) <U2 'S2' 'S2' 'L8' 'S2' 'S2' ... 'S2' 'L8' 'S2' 'S2' cloud_cover (time) int64 100 6 85 34 19 67 3 24 2 ... 3 4 2 1 1 87 13 10 3 Data variables: green (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> red (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> nir08 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> swir16 (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> Fmask (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> ndsi (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> ndvi (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray> ndwi (time, y, x) float32 dask.array<chunksize=(1, 221, 221), meta=np.ndarray>
ds.green.isel(time=0).hvplot.image(data_aspect=1)
ds.ndvi.isel(time=0).hvplot.image(data_aspect=1, title='NDVI',
clim=(0,1),
cmap='greens')
ds.ndwi.isel(time=0).hvplot.image(data_aspect=1, title='NDWI',
clim=(0,1),
cmap='blues')
ds.ndsi.isel(time=0).hvplot.image(data_aspect=1, title='NDSI',
clim=(0,1),
cmap='magma')
/home/jovyan/.local/envs/odc/lib/python3.10/site-packages/rasterio/warp.py:344: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned. _reproject(
ds.ndvi.hvplot.image(x='x',y='y',
data_aspect=1,
rasterize=True,
cmap='greens',
clim=(0,1),
)
HLS has a bit-packed mask (Fmask), which is a little tricky to work with:
(LSB to MSB)
0: cirrus
1: cloud
2: cloud/shadow adjacent
3: cloud shadow
4: snow/isce
5: water
6-7: aerosol level
- 11=high aerosol (3)
- 10 moderate (2)
- 01 low (1)
- 00 climatrology aerosol (0)
But using python indexing we'll reverse these!
0:1- aerosol level
2: water
3: snow/isce
4: cloud shadow
5: cloud adjacent
6: cloud
7: cirrus
def extract_masks(da):
''' given a da.fmask return all mask arrays as an xarray dataset'''
da = da.astype('uint8')
dsM = da.to_dataset()
explode = (da.shape[0], da.shape[1], 8)
masks = np.unpackbits(da, axis=1).reshape(explode)
aerosols = masks[:,:,0:2].sum(axis=-1)
high_aerosol = (aerosols == 3)
moderate_aerosol = (aerosols == 2)
low_aerosol = (aerosols == 1)
# Now to get a mask array it looks like this:
masks = masks.astype('bool')
water = masks[:,:,2]
snow = masks[:,:,3]
cloud_shadow = masks[:,:,4]
cloud_adjacent = masks[:,:,5]
cloud = masks[:,:,6]
dsM['water'] = (('y','x'), water)
dsM['snow'] = (('y','x'), snow)
dsM['cloud_shadow'] = (('y','x'), cloud_shadow)
dsM['cloud_adjacent'] = (('y','x'), cloud_adjacent)
dsM['cloud'] = (('y','x'), cloud)
dsM['high_aerosol'] = (('y','x'), high_aerosol)
dsM['mod_aerosol'] = (('y','x'), moderate_aerosol)
dsM['low_aerosol'] = (('y','x'), low_aerosol)
dsM = dsM.drop_vars('Fmask')
return dsM
dsM = extract_masks(ds.Fmask.isel(time=0))
dsM
<xarray.Dataset> Dimensions: (y: 221, x: 221) Coordinates: * y (y) float64 4e+06 4e+06 3.999e+06 ... 3.891e+06 3.89e+06 * x (x) float64 3.998e+05 4.002e+05 ... 5.092e+05 5.098e+05 spatial_ref int32 32613 time datetime64[ns] 2022-01-01T18:04:02.903000 platform <U2 'S2' cloud_cover int64 100 Data variables: water (y, x) bool False False False False ... False False False snow (y, x) bool False False False False ... False False False cloud_shadow (y, x) bool False False False False ... False False False cloud_adjacent (y, x) bool False False False False ... False False False cloud (y, x) bool False False False False ... False False False high_aerosol (y, x) bool False False False False ... False False False mod_aerosol (y, x) bool False False False False ... False False False low_aerosol (y, x) bool False False False False ... False False False
daM = dsM.to_array(dim='mask')
#daM.isel(mask=0).plot() # works
daM.plot(col='mask');
x = 4.28e5
y = 3.843e6
%%time
# NOTE: investigate speeding up with direct cloud access
# https://nasa-openscapes.github.io/2021-Cloud-Hackathon/tutorials/02_Data_Discovery_CMR-STAC_API.html#write-links-to-file-for-s3-access
ts = ds.ndvi.sel(x=x, y=y, method='nearest').compute()
ts
CPU times: user 1min 11s, sys: 36.6 s, total: 1min 47s Wall time: 1min 57s
<xarray.DataArray 'ndvi' (time: 201)> array([ nan, 3.60661023e-03, 1.41867176e-01, nan, 1.58511922e-01, nan, 1.51203454e-01, 1.54201999e-01, nan, nan, 1.51955307e-01, 1.52223930e-01, nan, 1.90091550e-01, -7.79220788e-03, nan, nan, 3.66379321e-02, 4.38430049e-02, nan, 1.36266854e-02, 1.47289798e-01, nan, -1.76315021e-04, nan, 1.46871999e-01, 1.43611997e-01, nan, 1.37165621e-01, nan, 1.23454861e-01, 1.49481624e-01, nan, 1.34703189e-01, -4.82324930e-03, nan, 1.43676102e-01, 1.38878435e-01, 1.39025316e-01, nan, 1.44757435e-01, 1.31953433e-01, nan, 2.51022875e-01, nan, 9.87767056e-02, 1.42601863e-01, nan, 1.43214285e-01, nan, 1.47783250e-01, 1.44830033e-01, nan, 1.30434781e-01, 1.46328762e-01, nan, 1.48943543e-01, nan, 1.44377679e-01, 1.43508777e-01, nan, 1.38525158e-01, 1.69910789e-01, nan, 1.43574297e-01, nan, 1.42616317e-01, 1.41946316e-01, nan, 1.41478032e-01, nan, 1.48749456e-01, 9.39703584e-02, nan, 1.79093570e-01, 1.59660101e-01, nan, 1.41880900e-01, 1.51453346e-01, 1.52474582e-01, ... nan, 2.77656823e-01, 2.32945383e-01, nan, 2.68764138e-01, nan, 2.30831638e-01, 2.41340995e-01, nan, 2.18896970e-01, 2.09195405e-01, nan, 2.12283596e-01, nan, nan, 2.96979427e-01, 2.16499880e-01, nan, 2.16234505e-01, nan, 2.52555609e-01, 2.17617929e-01, nan, 2.16433942e-01, nan, 1.92335322e-01, 1.92733020e-01, nan, 2.78362576e-02, 1.79670721e-01, nan, 1.76278308e-01, nan, -2.35354751e-02, nan, 1.72227234e-01, 1.67865708e-01, nan, 6.07298128e-02, nan, 6.80725947e-02, 1.60147607e-01, nan, nan, 1.83544308e-01, 4.86675836e-02, nan, 1.62754714e-01, 1.50161326e-01, nan, 1.53374240e-01, nan, 1.47378832e-01, 1.51300833e-01, nan, 5.52976802e-02, -2.93188989e-02, 2.76613571e-02, nan, 1.52223751e-01, 1.46571502e-01, nan, 1.54409900e-01, nan, 2.15486921e-02, nan, -1.75644029e-02, nan, 1.20016873e-01, nan, 1.41350746e-01, 1.43720105e-01, nan, -1.11423135e-02, -1.28874499e-02, nan, 1.72452092e-01], dtype=float32) Coordinates: y float64 3.89e+06 x float64 4.282e+05 spatial_ref int32 32613 * time (time) datetime64[ns] 2022-01-01T18:04:02.903000 ... 2023-02... platform (time) <U2 'S2' 'S2' 'L8' 'S2' 'S2' ... 'S2' 'L8' 'S2' 'S2' cloud_cover (time) int64 100 6 85 34 19 67 3 24 2 ... 3 4 2 1 1 87 13 10 3
ts.plot.line('k.');