Skip to content

Commit 8d69c29

Browse files
committed
Use rioxarray instead of rasterio for satellite data loading (#993)
1 parent af21dfb commit 8d69c29

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

examples/user_guide/25_GLCM_Texture.ipynb

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
"id": "3a06tk9sxuh",
2828
"metadata": {
2929
"execution": {
30-
"iopub.execute_input": "2026-03-09T15:24:35.820959Z",
31-
"iopub.status.busy": "2026-03-09T15:24:35.820856Z",
32-
"iopub.status.idle": "2026-03-09T15:24:36.961690Z",
33-
"shell.execute_reply": "2026-03-09T15:24:36.960684Z"
30+
"iopub.execute_input": "2026-03-09T15:30:49.123715Z",
31+
"iopub.status.busy": "2026-03-09T15:30:49.123629Z",
32+
"iopub.status.idle": "2026-03-09T15:30:50.272830Z",
33+
"shell.execute_reply": "2026-03-09T15:30:50.272259Z"
3434
}
3535
},
3636
"outputs": [],
@@ -57,10 +57,10 @@
5757
"id": "mqtgqmsnvlp",
5858
"metadata": {
5959
"execution": {
60-
"iopub.execute_input": "2026-03-09T15:24:36.963072Z",
61-
"iopub.status.busy": "2026-03-09T15:24:36.962807Z",
62-
"iopub.status.idle": "2026-03-09T15:24:37.032462Z",
63-
"shell.execute_reply": "2026-03-09T15:24:37.031655Z"
60+
"iopub.execute_input": "2026-03-09T15:30:50.274712Z",
61+
"iopub.status.busy": "2026-03-09T15:30:50.274450Z",
62+
"iopub.status.idle": "2026-03-09T15:30:50.338586Z",
63+
"shell.execute_reply": "2026-03-09T15:30:50.338001Z"
6464
}
6565
},
6666
"outputs": [],
@@ -109,10 +109,10 @@
109109
"id": "2fgm4xz3uwj",
110110
"metadata": {
111111
"execution": {
112-
"iopub.execute_input": "2026-03-09T15:24:37.033546Z",
113-
"iopub.status.busy": "2026-03-09T15:24:37.033449Z",
114-
"iopub.status.idle": "2026-03-09T15:24:37.759309Z",
115-
"shell.execute_reply": "2026-03-09T15:24:37.758777Z"
112+
"iopub.execute_input": "2026-03-09T15:30:50.339809Z",
113+
"iopub.status.busy": "2026-03-09T15:30:50.339694Z",
114+
"iopub.status.idle": "2026-03-09T15:30:51.046768Z",
115+
"shell.execute_reply": "2026-03-09T15:30:51.046259Z"
116116
}
117117
},
118118
"outputs": [],
@@ -145,10 +145,10 @@
145145
"id": "7ah4bm6v5ut",
146146
"metadata": {
147147
"execution": {
148-
"iopub.execute_input": "2026-03-09T15:24:37.760483Z",
149-
"iopub.status.busy": "2026-03-09T15:24:37.760378Z",
150-
"iopub.status.idle": "2026-03-09T15:24:38.303162Z",
151-
"shell.execute_reply": "2026-03-09T15:24:38.302527Z"
148+
"iopub.execute_input": "2026-03-09T15:30:51.047924Z",
149+
"iopub.status.busy": "2026-03-09T15:30:51.047834Z",
150+
"iopub.status.idle": "2026-03-09T15:30:51.568614Z",
151+
"shell.execute_reply": "2026-03-09T15:30:51.567915Z"
152152
}
153153
},
154154
"outputs": [],
@@ -190,10 +190,10 @@
190190
"id": "nkzw9wmyxio",
191191
"metadata": {
192192
"execution": {
193-
"iopub.execute_input": "2026-03-09T15:24:38.304357Z",
194-
"iopub.status.busy": "2026-03-09T15:24:38.304247Z",
195-
"iopub.status.idle": "2026-03-09T15:24:38.663836Z",
196-
"shell.execute_reply": "2026-03-09T15:24:38.663308Z"
193+
"iopub.execute_input": "2026-03-09T15:30:51.570036Z",
194+
"iopub.status.busy": "2026-03-09T15:30:51.569932Z",
195+
"iopub.status.idle": "2026-03-09T15:30:51.920501Z",
196+
"shell.execute_reply": "2026-03-09T15:30:51.919825Z"
197197
}
198198
},
199199
"outputs": [],
@@ -225,10 +225,10 @@
225225
"id": "keurc3dmugs",
226226
"metadata": {
227227
"execution": {
228-
"iopub.execute_input": "2026-03-09T15:24:38.664895Z",
229-
"iopub.status.busy": "2026-03-09T15:24:38.664788Z",
230-
"iopub.status.idle": "2026-03-09T15:24:38.792508Z",
231-
"shell.execute_reply": "2026-03-09T15:24:38.791940Z"
228+
"iopub.execute_input": "2026-03-09T15:30:51.921620Z",
229+
"iopub.status.busy": "2026-03-09T15:30:51.921522Z",
230+
"iopub.status.idle": "2026-03-09T15:30:52.045363Z",
231+
"shell.execute_reply": "2026-03-09T15:30:52.044567Z"
232232
}
233233
},
234234
"outputs": [],
@@ -305,16 +305,16 @@
305305
"id": "2hogpjtllw7",
306306
"metadata": {
307307
"execution": {
308-
"iopub.execute_input": "2026-03-09T15:24:38.793620Z",
309-
"iopub.status.busy": "2026-03-09T15:24:38.793519Z",
310-
"iopub.status.idle": "2026-03-09T15:24:40.121299Z",
311-
"shell.execute_reply": "2026-03-09T15:24:40.120560Z"
308+
"iopub.execute_input": "2026-03-09T15:30:52.046807Z",
309+
"iopub.status.busy": "2026-03-09T15:30:52.046700Z",
310+
"iopub.status.idle": "2026-03-09T15:30:53.261434Z",
311+
"shell.execute_reply": "2026-03-09T15:30:53.260895Z"
312312
}
313313
},
314314
"outputs": [],
315315
"source": [
316-
"import os, rasterio\n",
317-
"from rasterio.windows import Window\n",
316+
"import os\n",
317+
"import rioxarray\n",
318318
"\n",
319319
"os.environ['AWS_NO_SIGN_REQUEST'] = 'YES'\n",
320320
"os.environ['GDAL_DISABLE_READDIR_ON_OPEN'] = 'EMPTY_DIR'\n",
@@ -326,8 +326,8 @@
326326
")\n",
327327
"\n",
328328
"try:\n",
329-
" with rasterio.open(COG_URL) as src:\n",
330-
" nir = src.read(1, window=Window(5300, 2100, 500, 500)).astype(np.float64)\n",
329+
" nir_da = rioxarray.open_rasterio(COG_URL).isel(band=0, y=slice(2100, 2600), x=slice(5300, 5800))\n",
330+
" nir = nir_da.load().values.astype(np.float64)\n",
331331
" print(f'Downloaded NIR band: {nir.shape}, range {nir.min():.0f}–{nir.max():.0f}')\n",
332332
"except Exception as exc:\n",
333333
" print(f'Remote read failed ({exc}), using synthetic fallback')\n",
@@ -372,10 +372,10 @@
372372
"id": "ytdru4ssilp",
373373
"metadata": {
374374
"execution": {
375-
"iopub.execute_input": "2026-03-09T15:24:40.122870Z",
376-
"iopub.status.busy": "2026-03-09T15:24:40.122512Z",
377-
"iopub.status.idle": "2026-03-09T15:24:45.554736Z",
378-
"shell.execute_reply": "2026-03-09T15:24:45.554227Z"
375+
"iopub.execute_input": "2026-03-09T15:30:53.262766Z",
376+
"iopub.status.busy": "2026-03-09T15:30:53.262453Z",
377+
"iopub.status.idle": "2026-03-09T15:30:58.515207Z",
378+
"shell.execute_reply": "2026-03-09T15:30:58.514628Z"
379379
}
380380
},
381381
"outputs": [],
@@ -416,10 +416,10 @@
416416
"id": "keramnxr509",
417417
"metadata": {
418418
"execution": {
419-
"iopub.execute_input": "2026-03-09T15:24:45.556433Z",
420-
"iopub.status.busy": "2026-03-09T15:24:45.556320Z",
421-
"iopub.status.idle": "2026-03-09T15:24:46.981187Z",
422-
"shell.execute_reply": "2026-03-09T15:24:46.980549Z"
419+
"iopub.execute_input": "2026-03-09T15:30:58.517250Z",
420+
"iopub.status.busy": "2026-03-09T15:30:58.517125Z",
421+
"iopub.status.idle": "2026-03-09T15:30:59.860739Z",
422+
"shell.execute_reply": "2026-03-09T15:30:59.860156Z"
423423
}
424424
},
425425
"outputs": [],
@@ -470,10 +470,10 @@
470470
"id": "q1zl6bioi7e",
471471
"metadata": {
472472
"execution": {
473-
"iopub.execute_input": "2026-03-09T15:24:46.982646Z",
474-
"iopub.status.busy": "2026-03-09T15:24:46.982318Z",
475-
"iopub.status.idle": "2026-03-09T15:24:47.183340Z",
476-
"shell.execute_reply": "2026-03-09T15:24:47.182726Z"
473+
"iopub.execute_input": "2026-03-09T15:30:59.862223Z",
474+
"iopub.status.busy": "2026-03-09T15:30:59.861896Z",
475+
"iopub.status.idle": "2026-03-09T15:31:00.062349Z",
476+
"shell.execute_reply": "2026-03-09T15:31:00.061769Z"
477477
}
478478
},
479479
"outputs": [],

0 commit comments

Comments
 (0)