Skip to content

Commit

Permalink
handle one edge time ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
baloola committed Jul 22, 2023
1 parent 8e88969 commit 3fbebb2
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 24 deletions.
8 changes: 6 additions & 2 deletions stac/stac-generator/collection_convertor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ def create_links(title):
end_date = extent["temporal"]["interval"][0][1]
date = None
if start_date is None or end_date is None:
start_date = None
end_date = None
date = datetime.strptime('2000-01-01T00:00:00Z', "%Y-%m-%dT%H:%M:%SZ")
if start_date:
start_date = datetime.strptime(start_date, "%Y-%m-%dT%H:%M:%SZ")
date = start_date
elif start_date:
date = datetime.strptime(end_date, "%Y-%m-%dT%H:%M:%SZ")
end_date = end_date
else:
start_date = datetime.strptime(start_date, "%Y-%m-%dT%H:%M:%SZ")
end_date = datetime.strptime(end_date, "%Y-%m-%dT%H:%M:%SZ")
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/CNR_CHL/CNR_CHL.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "CNR_CHL",
"properties": {
"start_datetime": "2020-01-04T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +35,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2020-01-04T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/CNR_TSM/CNR_TSM.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "CNR_TSM",
"properties": {
"start_datetime": "2020-01-04T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +35,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2020-01-04T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/JAXA_WQ_CHLA_ANOMALY/JAXA_WQ_CHLA_ANOMALY.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "JAXA_WQ_CHLA_ANOMALY",
"properties": {
"start_datetime": "2018-01-06T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +35,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2018-01-06T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/JAXA_WQ_TSM_ANOMALY/JAXA_WQ_TSM_ANOMALY.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "JAXA_WQ_TSM_ANOMALY",
"properties": {
"start_datetime": "2018-01-06T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -34,7 +35,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2018-01-06T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/LANDSAT7_ETM_L1/LANDSAT7_ETM_L1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "LANDSAT7_ETM_L1",
"properties": {
"start_datetime": "1999-04-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -136,7 +137,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "1999-04-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/LANDSAT7_ETM_L2/LANDSAT7_ETM_L2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "LANDSAT7_ETM_L2",
"properties": {
"start_datetime": "1999-04-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -140,7 +141,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "1999-04-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/LANDSAT8-9_L1/LANDSAT8-9_L1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "LANDSAT8-9_L1",
"properties": {
"start_datetime": "2013-01-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -138,7 +139,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2013-01-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/LANDSAT8-9_L2/LANDSAT8-9_L2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "LANDSAT8-9_L2",
"properties": {
"start_datetime": "2013-01-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -140,7 +141,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2013-01-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/MODIS/MODIS.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "MODIS",
"properties": {
"start_datetime": "2000-02-24T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -44,7 +45,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2000-02-24T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "NASA_HARMONIZED_LANDSAT_SENTINEL",
"properties": {
"start_datetime": "2013-04-11T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -134,7 +135,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2013-04-11T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/SENTINEL1_CARD4L/SENTINEL1_CARD4L.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL1_CARD4L",
"properties": {
"start_datetime": "2018-01-01T02:50:58Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -41,7 +42,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2018-01-01T02:50:58Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/SENTINEL1_GRD/SENTINEL1_GRD.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL1_GRD",
"properties": {
"start_datetime": "2014-10-03T04:14:15Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -41,7 +42,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2014-10-03T04:14:15Z"
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL2_L1C_SENTINELHUB",
"properties": {
"start_datetime": "2015-11-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -140,7 +141,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2015-11-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL2_L2A_SENTINELHUB",
"properties": {
"start_datetime": "2016-11-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -143,7 +144,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2016-11-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/SENTINEL3_OLCI_L1B/SENTINEL3_OLCI_L1B.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL3_OLCI_L1B",
"properties": {
"start_datetime": "2016-04-17T11:33:13Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -66,7 +67,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2016-04-17T11:33:13Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/SENTINEL3_SLSTR/SENTINEL3_SLSTR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL3_SLSTR",
"properties": {
"start_datetime": "2016-04-17T11:33:13Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -48,7 +49,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2016-04-17T11:33:13Z"
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL_5P_CH4_T7D_AVERAGE",
"properties": {
"start_datetime": "2021-11-15T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -35,7 +36,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2021-11-15T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL_5P_CO_T3D_AVERAGE",
"properties": {
"start_datetime": "2018-04-30T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -35,7 +36,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2018-04-30T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/SENTINEL_5P_L2/SENTINEL_5P_L2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL_5P_L2",
"properties": {
"start_datetime": "2018-04-30T00:18:50Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -51,7 +52,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2018-04-30T00:18:50Z"
},
"geometry": {
"type": "Polygon",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "SENTINEL_5P_NO2_T14D_AVERAGE",
"properties": {
"start_datetime": "2018-04-30T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -35,7 +36,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2018-04-30T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/VEGETATION_INDICES/VEGETATION_INDICES.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "VEGETATION_INDICES",
"properties": {
"start_datetime": "2016-10-01T09:20:22Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -126,7 +127,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2016-10-01T09:20:22Z"
},
"geometry": {
"type": "Polygon",
Expand Down
3 changes: 2 additions & 1 deletion stac_dist/WATER_BODIES/WATER_BODIES.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"stac_version": "1.0.0",
"id": "WATER_BODIES",
"properties": {
"start_datetime": "2020-10-01T00:00:00Z",
"cube:dimensions": {
"x": {
"type": "spatial",
Expand Down Expand Up @@ -39,7 +40,7 @@
]
}
},
"datetime": "2000-01-01T00:00:00Z"
"datetime": "2020-10-01T00:00:00Z"
},
"geometry": {
"type": "Polygon",
Expand Down

0 comments on commit 3fbebb2

Please sign in to comment.