Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit e479d7e

Browse files
authored
Merge pull request #37 from unity-sds/stac-reader-writer
Stac reader writer
2 parents 864d801 + 67ac274 commit e479d7e

12 files changed

+363
-69
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Repo Specific
2+
tests/test_files/tmp/
13
# Byte-compiled / optimized / DLL files
24
__pycache__/
35
*.py[cod]

poetry.lock

Lines changed: 61 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ packages = [
1212
]
1313

1414
[tool.poetry.dependencies]
15-
python = "^3.7"
15+
python = "^3.9"
1616
requests = "^2.28.0"
1717
tenacity = "^8.0.1"
1818
giturlparse = "^0.10.0"
19+
pystac = "^1.7.3"
1920

2021

2122
[tool.poetry.dev-dependencies]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"type": "Feature",
3+
"stac_version": "1.0.0",
4+
"id": "SNDR.SS1330.CHIRP.20160829T2317.m06.g233.L1_AQ.std.v02_48.G.200425130422",
5+
"properties": {
6+
"datetime": "2016-08-29T23:17:00Z",
7+
"start_datetime": "2016-08-29T23:17:00Z",
8+
"end_datetime": "2023-01-01T00:06:00.000000Z",
9+
"created": "2023-05-24T16:01:04.801686Z",
10+
"updated": "2023-05-24T16:01:04.801692Z"
11+
},
12+
"geometry": "",
13+
"links": [
14+
{
15+
"rel": "root",
16+
"href": "./catalog.json",
17+
"type": "application/json"
18+
},
19+
{
20+
"rel": "parent",
21+
"href": "./catalog.json",
22+
"type": "application/json"
23+
}
24+
],
25+
"assets": {
26+
"data": {
27+
"href": "/unity/ads/sounder_sips/chirp_test_data/SNDR.SS1330.CHIRP.20160829T2317.m06.g233.L1_AQ.std.v02_48.G.200425130422.nc",
28+
"title": "Main Data File"
29+
},
30+
"metadata_stac": {
31+
"href": "/unity/ads/sounder_sips/chirp_test_data/SNDR.SS1330.CHIRP.20160829T2317.m06.g233.L1_AQ.std.v02_48.G.200425130422.json",
32+
"title": "Metadata STAC File"
33+
}
34+
},
35+
"bbox": "",
36+
"stac_extensions": []
37+
}

tests/test_files/catalog_01.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"type": "Catalog",
3+
"id": "catalog_id",
4+
"stac_version": "1.0.0",
5+
"description": "Tutorial chirp catalog.",
6+
"links": [
7+
{
8+
"rel": "root",
9+
"href": "./catalog_01.json",
10+
"type": "application/json"
11+
},
12+
{
13+
"rel": "item",
14+
"href": "./SNDR.SS1330.CHIRP.20160829T2317.m06.g233.L1_AQ.std.v02_48.G.200425130422.json",
15+
"type": "application/json"
16+
}
17+
]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"type": "Catalog",
3+
"id": "catalog_id",
4+
"stac_version": "1.0.0",
5+
"description": "Tutorial chirp catalog.",
6+
"links": [
7+
{
8+
"rel": "root",
9+
"href": "./catalog.json",
10+
"type": "application/json"
11+
},
12+
{
13+
"rel": "item",
14+
"href": "./SNDR.SS1330.CHIRP.20160829T2317.m06.g233.L1_AQ.std.v02_48.G.200425130422.json",
15+
"type": "application/json"
16+
17+
]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"type": "Catalogsss",
3+
"id": "catalog_id",
4+
"stac_version": "1.0.0",
5+
"description": "Tutorial chirp catalog.",
6+
"links": [
7+
{
8+
"rel": "root",
9+
"href": "./catalog.json",
10+
"type": "application/json"
11+
},
12+
{
13+
"rel": "item",
14+
"href": "./SNDR.SS1330.CHIRP.20160829T2317.m06.g233.L1_AQ.std.v02_48.G.200425130422.json",
15+
"type": "application/json"
16+
}
17+
]
18+
}

tests/test_files/cmr_granules.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"type":"FeatureCollection","stac_version":"1.0.0","numberMatched":2,"numberReturned":2,"features":[{"properties":{"datetime":"2016-08-22T00:05:22.000Z","start_datetime":"2016-08-22T00:05:22.000Z","end_datetime":"2016-08-22T00:11:22.000Z"},"bbox":[-7.02,-60.32,26.31,-36.16],"assets":{"metadata":{"href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068613-GES_DISC.xml","type":"application/xml"},"opendap":{"title":"The OPENDAP location for the granule. (GET DATA : OPENDAP DATA)","href":"https://sounder.gesdisc.eosdis.nasa.gov/opendap/CHIRP/SNDR13CHRP1.2/2016/235/SNDR.SS1330.CHIRP.20160822T0005.m06.g001.L1_AQ.std.v02_48.G.200425095850.nc","type":"application/x-netcdf"},"data":{"title":"Download SNDR.SS1330.CHIRP.20160822T0005.m06.g001.L1_AQ.std.v02_48.G.200425095850.nc","href":"https://data.gesdisc.earthdata.nasa.gov/data/CHIRP/SNDR13CHRP1.2/2016/235/SNDR.SS1330.CHIRP.20160822T0005.m06.g001.L1_AQ.std.v02_48.G.200425095850.nc"}},"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[6.18,-36.16],[-7.02,-56.04],[23.24,-60.32],[26.31,-38.94],[6.18,-36.16]]]},"stac_extensions":[],"id":"G2040068613-GES_DISC","stac_version":"1.0.0","collection":"C2011289787-GES_DISC","links":[{"rel":"self","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068613-GES_DISC.stac"},{"rel":"parent","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/C2011289787-GES_DISC.stac"},{"rel":"collection","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/C2011289787-GES_DISC.stac"},{"rel":"root","href":"https://cmr.earthdata.nasa.gov:443/search/"},{"rel":"via","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068613-GES_DISC.json"},{"rel":"via","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068613-GES_DISC.umm_json"}]},{"properties":{"datetime":"2016-08-22T00:11:22.000Z","start_datetime":"2016-08-22T00:11:22.000Z","end_datetime":"2016-08-22T00:17:22.000Z"},"bbox":[-43.78,-81.77028018298317,23.22,-56.18],"assets":{"metadata":{"href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068619-GES_DISC.xml","type":"application/xml"},"opendap":{"title":"The OPENDAP location for the granule. (GET DATA : OPENDAP DATA)","href":"https://sounder.gesdisc.eosdis.nasa.gov/opendap/CHIRP/SNDR13CHRP1.2/2016/235/SNDR.SS1330.CHIRP.20160822T0011.m06.g002.L1_AQ.std.v02_48.G.200425095901.nc","type":"application/x-netcdf"},"data":{"title":"Download SNDR.SS1330.CHIRP.20160822T0011.m06.g002.L1_AQ.std.v02_48.G.200425095901.nc","href":"https://data.gesdisc.earthdata.nasa.gov/data/CHIRP/SNDR13CHRP1.2/2016/235/SNDR.SS1330.CHIRP.20160822T0011.m06.g002.L1_AQ.std.v02_48.G.200425095901.nc"}},"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-7.16,-56.18],[-43.78,-71.72],[20.73,-81.77],[23.22,-60.47],[-7.16,-56.18]]]},"stac_extensions":[],"id":"G2040068619-GES_DISC","stac_version":"1.0.0","collection":"C2011289787-GES_DISC","links":[{"rel":"self","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068619-GES_DISC.stac"},{"rel":"parent","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/C2011289787-GES_DISC.stac"},{"rel":"collection","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/C2011289787-GES_DISC.stac"},{"rel":"root","href":"https://cmr.earthdata.nasa.gov:443/search/"},{"rel":"via","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068619-GES_DISC.json"},{"rel":"via","href":"https://cmr.earthdata.nasa.gov:443/search/concepts/G2040068619-GES_DISC.umm_json"}]}],"links":[{"rel":"self","href":"https://cmr.earthdata.nasa.gov:443/search/granules.stac?collection_concept_id=C2011289787-GES_DISC&temporal%5B%5D=2016-08-22T00%3A10%3A00%2C2016-08-22T00%3A15%3A00&page_num=1"},{"rel":"root","href":"https://cmr.earthdata.nasa.gov:443/search/"}],"context":{"returned":2,"limit":1000000,"matched":2}}

0 commit comments

Comments
 (0)