Skip to content

Commit

Permalink
Merge pull request #142 from stactools-packages/mah/update_roles
Browse files Browse the repository at this point in the history
Update asset roles
  • Loading branch information
matthewhanson authored Nov 20, 2023
2 parents 353c702 + fc5ba9a commit 2487e2e
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 196 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Antimeridian handling (again) ([#122](https://github.com/stactools-packages/sentinel2/pull/122))
- Populate `created` property with a valid RFC 3339 datetime ([#125](https://github.com/stactools-packages/sentinel2/pull/125))
- stactools required version should be >=0.5.2 instead of >= 0.4.8 ([#125](https://github.com/stactools-packages/sentinel2/pull/125))
- Roles fixed, 'reflectance' removed from auxiliary assets (e.g., wvp, aot)

### Changed

Expand Down
12 changes: 6 additions & 6 deletions src/stactools/sentinel2/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def image_asset_from_href(
href=asset_href,
media_type=asset_media_type,
title="True color preview",
roles=["data", "reflectance"],
roles=["visual"],
)
asset_eo = EOExtension.ext(asset)
asset_eo.bands = RGB_BANDS
Expand Down Expand Up @@ -380,7 +380,7 @@ def set_asset_properties(_asset: pystac.Asset, _band_gsd: Optional[int] = None):
href=asset_href,
media_type=asset_media_type,
title="Aerosol optical thickness (AOT)",
roles=["data", "reflectance"],
roles=["data"],
)

maybe_res = extract_gsd(asset_href)
Expand All @@ -404,7 +404,7 @@ def set_asset_properties(_asset: pystac.Asset, _band_gsd: Optional[int] = None):
href=asset_href,
media_type=asset_media_type,
title="Water Vapour (WVP)",
roles=["data", "reflectance"],
roles=["data"],
)

maybe_res = extract_gsd(asset_href)
Expand All @@ -429,7 +429,7 @@ def set_asset_properties(_asset: pystac.Asset, _band_gsd: Optional[int] = None):
href=asset_href,
media_type=asset_media_type,
title="Scene classification map (SCL)",
roles=["data", "reflectance"],
roles=["data"],
)

maybe_res = extract_gsd(asset_href)
Expand All @@ -450,7 +450,7 @@ def set_asset_properties(_asset: pystac.Asset, _band_gsd: Optional[int] = None):
href=asset_href,
media_type=asset_media_type,
title="Cloud Probabilities",
roles=["cloud"],
roles=["data", "cloud"],
)
maybe_res = extract_gsd(asset_href)
asset_id = mk_asset_id(maybe_res, "cloud")
Expand All @@ -470,7 +470,7 @@ def set_asset_properties(_asset: pystac.Asset, _band_gsd: Optional[int] = None):
href=asset_href,
media_type=asset_media_type,
title="Snow Probabilities",
roles=["snow-ice"],
roles=["data", "snow-ice"],
)
maybe_res = extract_gsd(asset_href)
asset_id = mk_asset_id(maybe_res, "snow")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"stac_version": "1.0.0",
"id": "S2A_T01LAC_20200717T221944_L1C",
"properties": {
"created": "2023-11-17T19:40:05.470290Z",
"created": "2023-11-17T21:03:58.948575Z",
"providers": [
{
"name": "ESA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"stac_version": "1.0.0",
"id": "S2A_T46RER_20210908T043714_L1C",
"properties": {
"created": "2023-11-17T19:40:05.104435Z",
"created": "2023-11-17T21:03:58.526452Z",
"providers": [
{
"name": "ESA",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"stac_version": "1.0.0",
"id": "S2A_T07HFE_20190212T192646_L2A",
"properties": {
"created": "2023-11-17T19:40:04.987346Z",
"created": "2023-11-17T21:03:58.387630Z",
"providers": [
{
"name": "ESA",
Expand Down Expand Up @@ -547,8 +547,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"aot": {
Expand Down Expand Up @@ -584,8 +583,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp": {
Expand Down Expand Up @@ -622,8 +620,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"visual_20m": {
Expand Down Expand Up @@ -1190,8 +1187,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"aot_60m": {
Expand Down Expand Up @@ -1227,8 +1223,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp_60m": {
Expand Down Expand Up @@ -1265,8 +1260,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"visual_60m": {
Expand Down Expand Up @@ -1529,8 +1523,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp_10m": {
Expand Down Expand Up @@ -1567,8 +1560,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"visual": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"stac_version": "1.0.0",
"id": "S2A_T01WCP_20230625T234624_L2A",
"properties": {
"created": "2023-11-17T19:40:04.681157Z",
"created": "2023-11-17T21:03:58.098356Z",
"providers": [
{
"name": "ESA",
Expand Down Expand Up @@ -388,8 +388,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp_10m": {
Expand Down Expand Up @@ -426,8 +425,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"coastal_20m": {
Expand Down Expand Up @@ -956,8 +954,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp": {
Expand Down Expand Up @@ -994,8 +991,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"scl": {
Expand Down Expand Up @@ -1029,8 +1025,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"coastal": {
Expand Down Expand Up @@ -1599,8 +1594,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp_60m": {
Expand Down Expand Up @@ -1637,8 +1631,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"scl_60m": {
Expand Down Expand Up @@ -1672,8 +1665,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"safe_manifest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"stac_version": "1.0.0",
"id": "S2A_T01WCP_20230625T234624_L2A",
"properties": {
"created": "2023-11-17T19:40:05.152815Z",
"created": "2023-11-17T21:03:58.585964Z",
"providers": [
{
"name": "ESA",
Expand Down Expand Up @@ -386,8 +386,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp_10m": {
Expand Down Expand Up @@ -424,8 +423,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"coastal_20m": {
Expand Down Expand Up @@ -954,8 +952,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp": {
Expand Down Expand Up @@ -992,8 +989,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"scl": {
Expand Down Expand Up @@ -1027,8 +1023,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"coastal": {
Expand Down Expand Up @@ -1597,8 +1592,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"wvp_60m": {
Expand Down Expand Up @@ -1635,8 +1629,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"scl_60m": {
Expand Down Expand Up @@ -1670,8 +1663,7 @@
}
],
"roles": [
"data",
"reflectance"
"data"
]
},
"safe_manifest": {
Expand Down
Loading

0 comments on commit 2487e2e

Please sign in to comment.