Skip to content

Commit 056c412

Browse files
Fix STAC API URL handling and enhance notebook execution tracking (#61)
1 parent 660995a commit 056c412

File tree

3 files changed

+29
-129
lines changed

3 files changed

+29
-129
lines changed

operator-tools/manage_collections.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ def create_or_update_collection(
149149
click.echo("❌ Collection data missing 'id' field", err=True)
150150
return False
151151

152-
url = f"{self.api_url}/collections"
152+
url = (
153+
f"{self.api_url}/collections/{collection_id}"
154+
if update
155+
else f"{self.api_url}/collections"
156+
)
153157
method = "PUT" if update else "POST"
154158

155159
try:

operator-tools/submit_stac_items_notebook.ipynb

Lines changed: 22 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"cell_type": "code",
25-
"execution_count": 24,
25+
"execution_count": null,
2626
"metadata": {},
2727
"outputs": [],
2828
"source": [
@@ -56,23 +56,15 @@
5656
},
5757
{
5858
"cell_type": "code",
59-
"execution_count": 32,
59+
"execution_count": null,
6060
"metadata": {},
61-
"outputs": [
62-
{
63-
"name": "stdout",
64-
"output_type": "stream",
65-
"text": [
66-
"✅ Configuration loaded\n"
67-
]
68-
}
69-
],
61+
"outputs": [],
7062
"source": [
7163
"# STAC API Configuration\n",
7264
"STAC_API_URL = \"https://stac.core.eopf.eodc.eu/\"\n",
7365
"\n",
7466
"# Webhook Configuration\n",
75-
"WEBHOOK_URL = \"http://localhost:12001/samples\"\n",
67+
"WEBHOOK_URL = \"http://localhost:12000/samples\"\n",
7668
"\n",
7769
"print(\"✅ Configuration loaded\")"
7870
]
@@ -86,30 +78,23 @@
8678
},
8779
{
8880
"cell_type": "code",
89-
"execution_count": 26,
81+
"execution_count": null,
9082
"metadata": {},
91-
"outputs": [
92-
{
93-
"name": "stdout",
94-
"output_type": "stream",
95-
"text": [
96-
"Area of Interest: [12.4, 41.8, 12.6, 42.0]\n",
97-
"Time Range: 2025-07-01T00:00:00Z to 2025-07-31T23:59:59Z\n"
98-
]
99-
}
100-
],
83+
"outputs": [],
10184
"source": [
10285
"# Area of Interest (AOI) - Bounding box: [min_lon, min_lat, max_lon, max_lat]\n",
10386
"# Example: Rome area\n",
104-
"aoi_bbox = [12.4, 41.8, 12.6, 42.0]\n",
87+
"# aoi_bbox = [12.4, 41.8, 12.6, 42.0]\n",
10588
"# Example 2: Majorca area (2.1697998046875004%2C39.21097520599528%2C3.8177490234375004)\n",
10689
"# aoi_bbox = [2.16, 39.21, 3.82, 39.78]\n",
10790
"# Example 3: France Full\n",
10891
"# aoi_bbox = [-5.14, 41.33, 9.56, 51.09]\n",
92+
"# Example 4: Lagoon From Venice to Trieste\n",
93+
"aoi_bbox = [12.0, 44.4, 14.0, 45.0]\n",
10994
"\n",
11095
"# Time range\n",
111-
"start_date = \"2025-07-01T00:00:00Z\"\n",
112-
"end_date = \"2025-07-31T23:59:59Z\"\n",
96+
"start_date = \"2025-01-01T00:00:00Z\"\n",
97+
"end_date = \"2025-12-31T23:59:59Z\"\n",
11398
"\n",
11499
"print(f\"Area of Interest: {aoi_bbox}\")\n",
115100
"print(f\"Time Range: {start_date} to {end_date}\")"
@@ -124,55 +109,9 @@
124109
},
125110
{
126111
"cell_type": "code",
127-
"execution_count": 27,
112+
"execution_count": null,
128113
"metadata": {},
129-
"outputs": [
130-
{
131-
"name": "stdout",
132-
"output_type": "stream",
133-
"text": [
134-
"\n",
135-
"📚 Available Collections (12 total):\n",
136-
"\n",
137-
" - sentinel-2-l2a\n",
138-
" The Sentinel-2 Level-2A Collection 1 product provides orthorectified Surface Reflectance (Bottom-Of-...\n",
139-
"\n",
140-
" - sentinel-3-slstr-l1-rbt\n",
141-
" The Sentinel-3 SLSTR Level-1B RBT product provides radiances and brightness temperatures for each pi...\n",
142-
"\n",
143-
" - sentinel-3-olci-l2-lrr\n",
144-
" The Sentinel-3 OLCI L2 LRR product provides land and atmospheric geophysical parameters computed for...\n",
145-
"\n",
146-
" - sentinel-2-l1c\n",
147-
" The Sentinel-2 Level-1C product is composed of 110x110 km2 tiles (ortho-images in UTM/WGS84 projecti...\n",
148-
"\n",
149-
" - sentinel-3-olci-l2-lfr\n",
150-
" The Sentinel-3 OLCI L2 LFR product provides land and atmospheric geophysical parameters computed for...\n",
151-
"\n",
152-
" - sentinel-3-olci-l1-efr\n",
153-
" The Sentinel-3 OLCI L1 EFR product provides TOA radiances at full resolution for each pixel in the i...\n",
154-
"\n",
155-
" - sentinel-1-l1-grd\n",
156-
" The Sentinel-1 Level-1 Ground Range Detected (GRD) products consist of focused SAR data that has bee...\n",
157-
"\n",
158-
" - sentinel-3-slstr-l2-frp\n",
159-
" The Sentinel-3 SLSTR Level-2 FRP product provides global (over land and water) fire radiative power.\n",
160-
"\n",
161-
" - sentinel-3-olci-l1-err\n",
162-
" The Sentinel-3 OLCI L1 ERR product provides TOA radiances at reduced resolution for each pixel in th...\n",
163-
"\n",
164-
" - sentinel-1-l1-slc\n",
165-
" The Sentinel-1 Level-1 Single Look Complex (SLC) products consist of focused SAR data, geo-reference...\n",
166-
"\n",
167-
" - sentinel-3-slstr-l2-lst\n",
168-
" The Sentinel-3 SLSTR Level-2 LST product provides land surface temperature.\n",
169-
"\n",
170-
" - sentinel-1-l2-ocn\n",
171-
" The Sentinel-1 Level-2 Ocean (OCN) products for wind, wave and currents applications may contain the...\n",
172-
"\n"
173-
]
174-
}
175-
],
114+
"outputs": [],
176115
"source": [
177116
"# Connect to STAC API\n",
178117
"catalog = Client.open(STAC_API_URL)\n",
@@ -203,49 +142,30 @@
203142
"cell_type": "code",
204143
"execution_count": null,
205144
"metadata": {},
206-
"outputs": [
207-
{
208-
"name": "stdout",
209-
"output_type": "stream",
210-
"text": [
211-
"🔍 Searching collection: sentinel-2-l2a\n",
212-
"🎯 Target collection for processing: sentinel-2-l2a\n"
213-
]
214-
}
215-
],
145+
"outputs": [],
216146
"source": [
217147
"# Choose the source collection to search\n",
218148
"source_collection = \"sentinel-2-l2a\" # Change this to your desired collection\n",
219149
"\n",
220150
"# Choose the target collection for processing\n",
221-
"target_collection = \"sentinel-2-l2a-staging\" # Change this to your target collection\n",
151+
"target_collection = \"sentinel-2-l2a\" # Change this to your target collection\n",
222152
"\n",
223153
"print(f\"🔍 Searching collection: {source_collection}\")\n",
224154
"print(f\"🎯 Target collection for processing: {target_collection}\")"
225155
]
226156
},
227157
{
228158
"cell_type": "code",
229-
"execution_count": 29,
159+
"execution_count": null,
230160
"metadata": {},
231-
"outputs": [
232-
{
233-
"name": "stdout",
234-
"output_type": "stream",
235-
"text": [
236-
"\n",
237-
"✅ Found 10 items (after filtering).\n",
238-
"\n"
239-
]
240-
}
241-
],
161+
"outputs": [],
242162
"source": [
243163
"# Search for items\n",
244164
"search = catalog.search(\n",
245165
" collections=[source_collection],\n",
246166
" bbox=aoi_bbox,\n",
247167
" datetime=f\"{start_date}/{end_date}\", # Adjust as needed\n",
248-
" limit=100, # Adjust limit as needed\n",
168+
" limit=200, # Adjust limit as needed\n",
249169
")\n",
250170
"\n",
251171
"# Collect items paginated results and clean them (workaround for issue #26)\n",
@@ -286,7 +206,7 @@
286206
},
287207
{
288208
"cell_type": "code",
289-
"execution_count": 33,
209+
"execution_count": null,
290210
"metadata": {},
291211
"outputs": [],
292212
"source": [
@@ -327,34 +247,9 @@
327247
},
328248
{
329249
"cell_type": "code",
330-
"execution_count": 35,
250+
"execution_count": null,
331251
"metadata": {},
332-
"outputs": [
333-
{
334-
"name": "stdout",
335-
"output_type": "stream",
336-
"text": [
337-
"\n",
338-
"📤 Submitting 10 items to pipeline...\n",
339-
"\n",
340-
"✅ Submitted: S2C_MSIL2A_20250728T100051_N0511_R122_T33TTG_20250728T153115\n",
341-
"✅ Submitted: S2C_MSIL2A_20250728T100051_N0511_R122_T32TQM_20250728T153115\n",
342-
"✅ Submitted: S2B_MSIL2A_20250713T100029_N0511_R122_T33TUG_20250713T123724\n",
343-
"✅ Submitted: S2B_MSIL2A_20250713T100029_N0511_R122_T33TTG_20250713T123724\n",
344-
"✅ Submitted: S2B_MSIL2A_20250713T100029_N0511_R122_T32TQM_20250713T123724\n",
345-
"✅ Submitted: S2C_MSIL2A_20250708T100051_N0511_R122_T33TTG_20250708T155705\n",
346-
"✅ Submitted: S2C_MSIL2A_20250708T100051_N0511_R122_T32TQM_20250708T155705\n",
347-
"✅ Submitted: S2B_MSIL2A_20250703T100029_N0511_R122_T33TUG_20250703T122001\n",
348-
"✅ Submitted: S2B_MSIL2A_20250703T100029_N0511_R122_T33TTG_20250703T122001\n",
349-
"✅ Submitted: S2B_MSIL2A_20250703T100029_N0511_R122_T32TQM_20250703T122001\n",
350-
"\n",
351-
"📊 Summary:\n",
352-
" - Successfully submitted: 10\n",
353-
" - Failed: 0\n",
354-
" - Total: 10\n"
355-
]
356-
}
357-
],
252+
"outputs": [],
358253
"source": [
359254
"# Submit all found items to the pipeline\n",
360255
"if items:\n",
@@ -439,7 +334,7 @@
439334
"name": "python",
440335
"nbconvert_exporter": "python",
441336
"pygments_lexer": "ipython3",
442-
"version": "3.13.1"
337+
"version": "3.11.0"
443338
}
444339
},
445340
"nbformat": 4,

stac/sentinel-2-l2a.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,5 +306,6 @@
306306
"https://stac-extensions.github.io/product/v0.1.0/schema.json",
307307
"https://stac-extensions.github.io/sat/v1.0.0/schema.json",
308308
"https://stac-extensions.github.io/scientific/v1.0.0/schema.json"
309-
]
309+
],
310+
"eodash:rasterform": "https://raw.githubusercontent.com/EOPF-Explorer/eodash-assets/refs/heads/main/forms/bandsform.json"
310311
}

0 commit comments

Comments
 (0)