vasi0050 commited on
Commit
d9803b0
·
verified ·
1 Parent(s): 82cab59

Upload 2 files

Browse files
Files changed (2) hide show
  1. conv_antarctis.ipynb +0 -0
  2. make_conv_train.ipynb +1504 -0
conv_antarctis.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
make_conv_train.ipynb ADDED
@@ -0,0 +1,1504 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "0dd2c5d4",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "import xarray as xr\n",
11
+ "import geopandas as gpd\n",
12
+ "from shapely.geometry import box\n",
13
+ "import rioxarray as rxr # Make sure you have rioxarray installed (pip install rioxarray)\n",
14
+ "import numpy as np\n",
15
+ "import ibis\n",
16
+ "ibis.options.interactive = True"
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "code",
21
+ "execution_count": 2,
22
+ "id": "d615f835",
23
+ "metadata": {},
24
+ "outputs": [
25
+ {
26
+ "data": {
27
+ "text/plain": [
28
+ "<duckdb.duckdb.DuckDBPyConnection at 0x1c9eb17f6f0>"
29
+ ]
30
+ },
31
+ "execution_count": 2,
32
+ "metadata": {},
33
+ "output_type": "execute_result"
34
+ }
35
+ ],
36
+ "source": [
37
+ "con = ibis.duckdb.connect()\n",
38
+ "con.raw_sql('INSTALL spatial;')\n",
39
+ "con.raw_sql('LOAD spatial;')"
40
+ ]
41
+ },
42
+ {
43
+ "cell_type": "markdown",
44
+ "id": "700cf1f9",
45
+ "metadata": {},
46
+ "source": [
47
+ "- The .rio accessor: https://corteva.github.io/rioxarray/html/rioxarray.html#rioxarray-rio-accessors\n",
48
+ "\n",
49
+ "- Affine( pixel_width, 0, top_left_x_coord,\n",
50
+ " 0, -pixel_height, top_left_y_coord)\n",
51
+ "\n",
52
+ "- Rasterio Affine Docs (https://affine.readthedocs.io/en/latest/)"
53
+ ]
54
+ },
55
+ {
56
+ "cell_type": "code",
57
+ "execution_count": 3,
58
+ "id": "cf514138",
59
+ "metadata": {},
60
+ "outputs": [],
61
+ "source": [
62
+ "filename = 'BedMachineAntarctica-v3.nc'\n",
63
+ "sat_im = rxr.open_rasterio(filename)\n",
64
+ "transform = sat_im.rio.transform()"
65
+ ]
66
+ },
67
+ {
68
+ "cell_type": "code",
69
+ "execution_count": 4,
70
+ "id": "7cc14869",
71
+ "metadata": {},
72
+ "outputs": [],
73
+ "source": [
74
+ "tab = con.read_parquet('bedmap_train2_30m.parquet')"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "execution_count": 5,
80
+ "id": "0fec2bb7",
81
+ "metadata": {},
82
+ "outputs": [
83
+ {
84
+ "data": {
85
+ "application/vnd.jupyter.widget-view+json": {
86
+ "model_id": "0dae1027ada7475b8c194923c425073c",
87
+ "version_major": 2,
88
+ "version_minor": 0
89
+ },
90
+ "text/plain": [
91
+ "FloatProgress(value=0.0, layout=Layout(width='auto'), style=ProgressStyle(bar_color='black'))"
92
+ ]
93
+ },
94
+ "metadata": {},
95
+ "output_type": "display_data"
96
+ }
97
+ ],
98
+ "source": [
99
+ "# Let's create a dummy GeoPandas DataFrame for demonstration\n",
100
+ "num_points = 100_000\n",
101
+ "frac_points = num_points/30_000_000\n",
102
+ "# Generate random points within a reasonable Antarctica extent (approx for EPSG:3031)\n",
103
+ "# min_x, max_x = -2000000, 2000000\n",
104
+ "# min_y, max_y = -2000000, 2000000\n",
105
+ "# random_x = np.random.uniform(min_x, max_x, num_points)\n",
106
+ "# random_y = np.random.uniform(min_y, max_y, num_points)\n",
107
+ "# ice_thickness_data = np.random.uniform(100, 5000, num_points) # Example ice thickness\n",
108
+ "# v_data = np.random.uniform(0, 1, num_points) # Example velocity\n",
109
+ "# temp_data = np.random.uniform(0, 1000, num_points) # Example temperature\n",
110
+ "\n",
111
+ "# gdf = gpd.GeoDataFrame(\n",
112
+ "# {'ice_thickness': ice_thickness_data,\n",
113
+ "# 'v': v_data,\n",
114
+ "# 'temp': temp_data\n",
115
+ "# },\n",
116
+ "# geometry=gpd.points_from_xy(random_x, random_y),\n",
117
+ "# crs=\"EPSG:3031\"\n",
118
+ "# )\n",
119
+ "data = tab.drop(['LON','LAT'])\n",
120
+ "random_data = data.sample(frac_points)\n",
121
+ "\n",
122
+ "# 3.1. Create a spatial index for your GeoDataFrame\n",
123
+ "gdf = random_data.to_pandas()\n",
124
+ "gdf.crs = \"EPSG:3031\"\n",
125
+ "gdf_sindex = gdf.sindex"
126
+ ]
127
+ },
128
+ {
129
+ "cell_type": "code",
130
+ "execution_count": 6,
131
+ "id": "ae2f315d",
132
+ "metadata": {},
133
+ "outputs": [
134
+ {
135
+ "data": {
136
+ "text/html": [
137
+ "<div>\n",
138
+ "<style scoped>\n",
139
+ " .dataframe tbody tr th:only-of-type {\n",
140
+ " vertical-align: middle;\n",
141
+ " }\n",
142
+ "\n",
143
+ " .dataframe tbody tr th {\n",
144
+ " vertical-align: top;\n",
145
+ " }\n",
146
+ "\n",
147
+ " .dataframe thead th {\n",
148
+ " text-align: right;\n",
149
+ " }\n",
150
+ "</style>\n",
151
+ "<table border=\"1\" class=\"dataframe\">\n",
152
+ " <thead>\n",
153
+ " <tr style=\"text-align: right;\">\n",
154
+ " <th></th>\n",
155
+ " <th>THICK</th>\n",
156
+ " <th>geometry</th>\n",
157
+ " <th>EAST</th>\n",
158
+ " <th>NORTH</th>\n",
159
+ " <th>vx</th>\n",
160
+ " <th>vy</th>\n",
161
+ " <th>v</th>\n",
162
+ " <th>ith_bm</th>\n",
163
+ " <th>smb</th>\n",
164
+ " <th>z</th>\n",
165
+ " <th>s</th>\n",
166
+ " <th>temp</th>\n",
167
+ " </tr>\n",
168
+ " </thead>\n",
169
+ " <tbody>\n",
170
+ " <tr>\n",
171
+ " <th>0</th>\n",
172
+ " <td>1064.24</td>\n",
173
+ " <td>POINT (-413937.178 826713.054)</td>\n",
174
+ " <td>-4.139372e+05</td>\n",
175
+ " <td>8.267131e+05</td>\n",
176
+ " <td>-2.619273</td>\n",
177
+ " <td>3.084245</td>\n",
178
+ " <td>4.046376</td>\n",
179
+ " <td>954.490873</td>\n",
180
+ " <td>62.644607</td>\n",
181
+ " <td>1162.279839</td>\n",
182
+ " <td>0.007977</td>\n",
183
+ " <td>244.021857</td>\n",
184
+ " </tr>\n",
185
+ " <tr>\n",
186
+ " <th>1</th>\n",
187
+ " <td>1193.70</td>\n",
188
+ " <td>POINT (1671948.79 -1896344.349)</td>\n",
189
+ " <td>1.671949e+06</td>\n",
190
+ " <td>-1.896344e+06</td>\n",
191
+ " <td>31.064121</td>\n",
192
+ " <td>-41.057273</td>\n",
193
+ " <td>51.484748</td>\n",
194
+ " <td>1211.514173</td>\n",
195
+ " <td>451.263755</td>\n",
196
+ " <td>1203.777496</td>\n",
197
+ " <td>0.015953</td>\n",
198
+ " <td>252.699878</td>\n",
199
+ " </tr>\n",
200
+ " <tr>\n",
201
+ " <th>2</th>\n",
202
+ " <td>1552.96</td>\n",
203
+ " <td>POINT (-1258929.617 -809646.847)</td>\n",
204
+ " <td>-1.258930e+06</td>\n",
205
+ " <td>-8.096468e+05</td>\n",
206
+ " <td>-2.924342</td>\n",
207
+ " <td>8.953849</td>\n",
208
+ " <td>9.419298</td>\n",
209
+ " <td>1663.638829</td>\n",
210
+ " <td>490.454161</td>\n",
211
+ " <td>2100.545793</td>\n",
212
+ " <td>0.003695</td>\n",
213
+ " <td>246.286919</td>\n",
214
+ " </tr>\n",
215
+ " <tr>\n",
216
+ " <th>3</th>\n",
217
+ " <td>1264.70</td>\n",
218
+ " <td>POINT (-844998.401 333006.309)</td>\n",
219
+ " <td>-8.449984e+05</td>\n",
220
+ " <td>3.330063e+05</td>\n",
221
+ " <td>-2.674579</td>\n",
222
+ " <td>-1.263969</td>\n",
223
+ " <td>2.958207</td>\n",
224
+ " <td>1259.694288</td>\n",
225
+ " <td>145.535283</td>\n",
226
+ " <td>345.654052</td>\n",
227
+ " <td>0.004805</td>\n",
228
+ " <td>246.782685</td>\n",
229
+ " </tr>\n",
230
+ " <tr>\n",
231
+ " <th>4</th>\n",
232
+ " <td>2000.78</td>\n",
233
+ " <td>POINT (-735958.864 48154.371)</td>\n",
234
+ " <td>-7.359589e+05</td>\n",
235
+ " <td>4.815437e+04</td>\n",
236
+ " <td>-3.450994</td>\n",
237
+ " <td>5.502195</td>\n",
238
+ " <td>6.494884</td>\n",
239
+ " <td>2022.433247</td>\n",
240
+ " <td>132.701361</td>\n",
241
+ " <td>1458.315269</td>\n",
242
+ " <td>0.002991</td>\n",
243
+ " <td>243.095592</td>\n",
244
+ " </tr>\n",
245
+ " <tr>\n",
246
+ " <th>...</th>\n",
247
+ " <td>...</td>\n",
248
+ " <td>...</td>\n",
249
+ " <td>...</td>\n",
250
+ " <td>...</td>\n",
251
+ " <td>...</td>\n",
252
+ " <td>...</td>\n",
253
+ " <td>...</td>\n",
254
+ " <td>...</td>\n",
255
+ " <td>...</td>\n",
256
+ " <td>...</td>\n",
257
+ " <td>...</td>\n",
258
+ " <td>...</td>\n",
259
+ " </tr>\n",
260
+ " <tr>\n",
261
+ " <th>99761</th>\n",
262
+ " <td>2024.41</td>\n",
263
+ " <td>POINT (-1070869.73 36219.135)</td>\n",
264
+ " <td>-1.070870e+06</td>\n",
265
+ " <td>3.621913e+04</td>\n",
266
+ " <td>-6.510958</td>\n",
267
+ " <td>4.801056</td>\n",
268
+ " <td>8.089667</td>\n",
269
+ " <td>1676.777041</td>\n",
270
+ " <td>202.611396</td>\n",
271
+ " <td>1739.456718</td>\n",
272
+ " <td>0.009819</td>\n",
273
+ " <td>243.995007</td>\n",
274
+ " </tr>\n",
275
+ " <tr>\n",
276
+ " <th>99762</th>\n",
277
+ " <td>2787.40</td>\n",
278
+ " <td>POINT (919130.388 -1668408.781)</td>\n",
279
+ " <td>9.191304e+05</td>\n",
280
+ " <td>-1.668409e+06</td>\n",
281
+ " <td>0.308528</td>\n",
282
+ " <td>-1.388530</td>\n",
283
+ " <td>1.422394</td>\n",
284
+ " <td>2820.331161</td>\n",
285
+ " <td>85.178935</td>\n",
286
+ " <td>2181.561262</td>\n",
287
+ " <td>0.002284</td>\n",
288
+ " <td>234.099728</td>\n",
289
+ " </tr>\n",
290
+ " <tr>\n",
291
+ " <th>99763</th>\n",
292
+ " <td>785.40</td>\n",
293
+ " <td>POINT (2292737.808 -1064316.615)</td>\n",
294
+ " <td>2.292738e+06</td>\n",
295
+ " <td>-1.064317e+06</td>\n",
296
+ " <td>-167.424091</td>\n",
297
+ " <td>-27.102104</td>\n",
298
+ " <td>169.603509</td>\n",
299
+ " <td>796.579113</td>\n",
300
+ " <td>1294.093330</td>\n",
301
+ " <td>212.071962</td>\n",
302
+ " <td>0.048592</td>\n",
303
+ " <td>258.157311</td>\n",
304
+ " </tr>\n",
305
+ " <tr>\n",
306
+ " <th>99764</th>\n",
307
+ " <td>2452.89</td>\n",
308
+ " <td>POINT (-1387664.803 -630194.489)</td>\n",
309
+ " <td>-1.387665e+06</td>\n",
310
+ " <td>-6.301945e+05</td>\n",
311
+ " <td>-43.763266</td>\n",
312
+ " <td>47.033471</td>\n",
313
+ " <td>64.244617</td>\n",
314
+ " <td>2506.279739</td>\n",
315
+ " <td>738.107499</td>\n",
316
+ " <td>1219.776864</td>\n",
317
+ " <td>0.004550</td>\n",
318
+ " <td>249.767054</td>\n",
319
+ " </tr>\n",
320
+ " <tr>\n",
321
+ " <th>99765</th>\n",
322
+ " <td>1680.48</td>\n",
323
+ " <td>POINT (539623.208 -1053727.718)</td>\n",
324
+ " <td>5.396232e+05</td>\n",
325
+ " <td>-1.053728e+06</td>\n",
326
+ " <td>-4.670764</td>\n",
327
+ " <td>-1.080457</td>\n",
328
+ " <td>4.794103</td>\n",
329
+ " <td>1509.649156</td>\n",
330
+ " <td>31.253687</td>\n",
331
+ " <td>2153.899426</td>\n",
332
+ " <td>0.008152</td>\n",
333
+ " <td>234.451772</td>\n",
334
+ " </tr>\n",
335
+ " </tbody>\n",
336
+ "</table>\n",
337
+ "<p>99766 rows × 12 columns</p>\n",
338
+ "</div>"
339
+ ],
340
+ "text/plain": [
341
+ " THICK geometry EAST NORTH \\\n",
342
+ "0 1064.24 POINT (-413937.178 826713.054) -4.139372e+05 8.267131e+05 \n",
343
+ "1 1193.70 POINT (1671948.79 -1896344.349) 1.671949e+06 -1.896344e+06 \n",
344
+ "2 1552.96 POINT (-1258929.617 -809646.847) -1.258930e+06 -8.096468e+05 \n",
345
+ "3 1264.70 POINT (-844998.401 333006.309) -8.449984e+05 3.330063e+05 \n",
346
+ "4 2000.78 POINT (-735958.864 48154.371) -7.359589e+05 4.815437e+04 \n",
347
+ "... ... ... ... ... \n",
348
+ "99761 2024.41 POINT (-1070869.73 36219.135) -1.070870e+06 3.621913e+04 \n",
349
+ "99762 2787.40 POINT (919130.388 -1668408.781) 9.191304e+05 -1.668409e+06 \n",
350
+ "99763 785.40 POINT (2292737.808 -1064316.615) 2.292738e+06 -1.064317e+06 \n",
351
+ "99764 2452.89 POINT (-1387664.803 -630194.489) -1.387665e+06 -6.301945e+05 \n",
352
+ "99765 1680.48 POINT (539623.208 -1053727.718) 5.396232e+05 -1.053728e+06 \n",
353
+ "\n",
354
+ " vx vy v ith_bm smb \\\n",
355
+ "0 -2.619273 3.084245 4.046376 954.490873 62.644607 \n",
356
+ "1 31.064121 -41.057273 51.484748 1211.514173 451.263755 \n",
357
+ "2 -2.924342 8.953849 9.419298 1663.638829 490.454161 \n",
358
+ "3 -2.674579 -1.263969 2.958207 1259.694288 145.535283 \n",
359
+ "4 -3.450994 5.502195 6.494884 2022.433247 132.701361 \n",
360
+ "... ... ... ... ... ... \n",
361
+ "99761 -6.510958 4.801056 8.089667 1676.777041 202.611396 \n",
362
+ "99762 0.308528 -1.388530 1.422394 2820.331161 85.178935 \n",
363
+ "99763 -167.424091 -27.102104 169.603509 796.579113 1294.093330 \n",
364
+ "99764 -43.763266 47.033471 64.244617 2506.279739 738.107499 \n",
365
+ "99765 -4.670764 -1.080457 4.794103 1509.649156 31.253687 \n",
366
+ "\n",
367
+ " z s temp \n",
368
+ "0 1162.279839 0.007977 244.021857 \n",
369
+ "1 1203.777496 0.015953 252.699878 \n",
370
+ "2 2100.545793 0.003695 246.286919 \n",
371
+ "3 345.654052 0.004805 246.782685 \n",
372
+ "4 1458.315269 0.002991 243.095592 \n",
373
+ "... ... ... ... \n",
374
+ "99761 1739.456718 0.009819 243.995007 \n",
375
+ "99762 2181.561262 0.002284 234.099728 \n",
376
+ "99763 212.071962 0.048592 258.157311 \n",
377
+ "99764 1219.776864 0.004550 249.767054 \n",
378
+ "99765 2153.899426 0.008152 234.451772 \n",
379
+ "\n",
380
+ "[99766 rows x 12 columns]"
381
+ ]
382
+ },
383
+ "execution_count": 6,
384
+ "metadata": {},
385
+ "output_type": "execute_result"
386
+ }
387
+ ],
388
+ "source": [
389
+ "gdf"
390
+ ]
391
+ },
392
+ {
393
+ "cell_type": "code",
394
+ "execution_count": 8,
395
+ "id": "8cd3bb9e",
396
+ "metadata": {},
397
+ "outputs": [
398
+ {
399
+ "data": {
400
+ "text/plain": [
401
+ "99766"
402
+ ]
403
+ },
404
+ "execution_count": 8,
405
+ "metadata": {},
406
+ "output_type": "execute_result"
407
+ }
408
+ ],
409
+ "source": [
410
+ "len(gdf)"
411
+ ]
412
+ },
413
+ {
414
+ "cell_type": "code",
415
+ "execution_count": 9,
416
+ "id": "9f8614bd",
417
+ "metadata": {},
418
+ "outputs": [],
419
+ "source": [
420
+ "size = 27 #pixels\n",
421
+ "half = size // 2\n",
422
+ "\n",
423
+ "images = []\n",
424
+ "im_data = {}\n",
425
+ "\n",
426
+ "scalar_feats = ['THICK', 'vx', 'vy', 'v', 'smb', 'z', 's', 'temp']\n",
427
+ "\n",
428
+ "for sclr in scalar_feats:\n",
429
+ " im_data[sclr] = []\n",
430
+ "\n",
431
+ "\n",
432
+ "for idx, data_row in gdf.iterrows():\n",
433
+ " geom = data_row.geometry\n",
434
+ "\n",
435
+ " col, row = ~transform * (geom.x, geom.y) #Pixel coordinates\n",
436
+ " col, row = int(np.floor(col)), int(np.floor(row))\n",
437
+ "\n",
438
+ " patch = sat_im.surface.isel(\n",
439
+ " y=slice(row-half, row+half+1),\n",
440
+ " x=slice(col-half, col+half+1)\n",
441
+ " )\n",
442
+ "\n",
443
+ " image = xr.DataArray(\n",
444
+ " patch[0].values,\n",
445
+ " coords = {\n",
446
+ " \"x\": np.arange(size),\n",
447
+ " \"y\": np.arange(size)\n",
448
+ " },\n",
449
+ " dims = (\"x\", \"y\"),\n",
450
+ " name = \"z_image\"\n",
451
+ " )\n",
452
+ "\n",
453
+ " images.append(image)\n",
454
+ " for sclr in scalar_feats:\n",
455
+ " im_data[sclr].append(data_row[sclr])\n",
456
+ "\n",
457
+ "sc = np.arange(len(gdf))\n",
458
+ "\n",
459
+ "# Create a DataArray for all images\n",
460
+ "all_images_da = xr.concat(images, dim = 'sample')\n",
461
+ "all_images_da['sample'] = sc # Add sample coordinates\n",
462
+ "\n",
463
+ "scalars_ds = xr.Dataset(\n",
464
+ " {\n",
465
+ " 'vx': xr.DataArray(np.array(im_data['vx']), coords = {'sample': sc}, dims = ('sample',), name = 'vx'),\n",
466
+ " 'vy': xr.DataArray(np.array(im_data['vy']), coords = {'sample': sc}, dims = ('sample',), name = 'vy'),\n",
467
+ " 'v': xr.DataArray(np.array(im_data['v']), coords = {'sample': sc}, dims = ('sample',), name = 'v'),\n",
468
+ " 'smb': xr.DataArray(np.array(im_data['smb']), coords = {'sample': sc}, dims = ('sample',), name = 'smb'),\n",
469
+ " 'z': xr.DataArray(np.array(im_data['z']), coords = {'sample': sc}, dims = ('sample',), name = 'z'),\n",
470
+ " 's': xr.DataArray(np.array(im_data['s']), coords = {'sample': sc}, dims = ('sample',), name = 's'),\n",
471
+ " 'temp': xr.DataArray(np.array(im_data['temp']), coords = {'sample': sc}, dims = ('sample',), name = 'temp')\n",
472
+ " },\n",
473
+ " coords = {'sample': sc}\n",
474
+ ")\n",
475
+ "\n",
476
+ "# Create DataArrays for labels and scalar features, aligning with the 'sample' dimension\n",
477
+ "labels_da = xr.DataArray(\n",
478
+ " np.array(im_data[\"THICK\"]),\n",
479
+ " coords={\"sample\": sc},\n",
480
+ " dims=(\"sample\",),\n",
481
+ " name=\"label\"\n",
482
+ ")\n",
483
+ "\n",
484
+ "# Combine everything into a single Dataset\n",
485
+ "training_data_ds = xr.Dataset(\n",
486
+ " {\n",
487
+ " \"images\": all_images_da,\n",
488
+ " \"labels\": labels_da\n",
489
+ " },\n",
490
+ " coords={\"sample\": sc}, # Add sample coordinates from scalar_features_ds\n",
491
+ " # name = \"Elevation images, with labels and scarlars\",\n",
492
+ " attrs={'description': 'CNN data with elevation images. Scalar features are everything from Niccolo 30M parquet.\\\n",
493
+ " Images are 27x27 pixels.'}\n",
494
+ ")\n",
495
+ "\n",
496
+ "training_data_ds = training_data_ds.merge(scalars_ds)"
497
+ ]
498
+ },
499
+ {
500
+ "cell_type": "code",
501
+ "execution_count": 16,
502
+ "id": "6cc1c242",
503
+ "metadata": {},
504
+ "outputs": [
505
+ {
506
+ "data": {
507
+ "text/html": [
508
+ "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
509
+ "<defs>\n",
510
+ "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
511
+ "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
512
+ "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
513
+ "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
514
+ "</symbol>\n",
515
+ "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
516
+ "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
517
+ "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
518
+ "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
519
+ "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
520
+ "</symbol>\n",
521
+ "</defs>\n",
522
+ "</svg>\n",
523
+ "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
524
+ " *\n",
525
+ " */\n",
526
+ "\n",
527
+ ":root {\n",
528
+ " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
529
+ " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
530
+ " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
531
+ " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
532
+ " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
533
+ " --xr-background-color: var(--jp-layout-color0, white);\n",
534
+ " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
535
+ " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
536
+ "}\n",
537
+ "\n",
538
+ "html[theme=\"dark\"],\n",
539
+ "html[data-theme=\"dark\"],\n",
540
+ "body[data-theme=\"dark\"],\n",
541
+ "body.vscode-dark {\n",
542
+ " --xr-font-color0: rgba(255, 255, 255, 1);\n",
543
+ " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
544
+ " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
545
+ " --xr-border-color: #1f1f1f;\n",
546
+ " --xr-disabled-color: #515151;\n",
547
+ " --xr-background-color: #111111;\n",
548
+ " --xr-background-color-row-even: #111111;\n",
549
+ " --xr-background-color-row-odd: #313131;\n",
550
+ "}\n",
551
+ "\n",
552
+ ".xr-wrap {\n",
553
+ " display: block !important;\n",
554
+ " min-width: 300px;\n",
555
+ " max-width: 700px;\n",
556
+ "}\n",
557
+ "\n",
558
+ ".xr-text-repr-fallback {\n",
559
+ " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
560
+ " display: none;\n",
561
+ "}\n",
562
+ "\n",
563
+ ".xr-header {\n",
564
+ " padding-top: 6px;\n",
565
+ " padding-bottom: 6px;\n",
566
+ " margin-bottom: 4px;\n",
567
+ " border-bottom: solid 1px var(--xr-border-color);\n",
568
+ "}\n",
569
+ "\n",
570
+ ".xr-header > div,\n",
571
+ ".xr-header > ul {\n",
572
+ " display: inline;\n",
573
+ " margin-top: 0;\n",
574
+ " margin-bottom: 0;\n",
575
+ "}\n",
576
+ "\n",
577
+ ".xr-obj-type,\n",
578
+ ".xr-array-name {\n",
579
+ " margin-left: 2px;\n",
580
+ " margin-right: 10px;\n",
581
+ "}\n",
582
+ "\n",
583
+ ".xr-obj-type {\n",
584
+ " color: var(--xr-font-color2);\n",
585
+ "}\n",
586
+ "\n",
587
+ ".xr-sections {\n",
588
+ " padding-left: 0 !important;\n",
589
+ " display: grid;\n",
590
+ " grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
591
+ "}\n",
592
+ "\n",
593
+ ".xr-section-item {\n",
594
+ " display: contents;\n",
595
+ "}\n",
596
+ "\n",
597
+ ".xr-section-item input {\n",
598
+ " display: inline-block;\n",
599
+ " opacity: 0;\n",
600
+ " height: 0;\n",
601
+ "}\n",
602
+ "\n",
603
+ ".xr-section-item input + label {\n",
604
+ " color: var(--xr-disabled-color);\n",
605
+ "}\n",
606
+ "\n",
607
+ ".xr-section-item input:enabled + label {\n",
608
+ " cursor: pointer;\n",
609
+ " color: var(--xr-font-color2);\n",
610
+ "}\n",
611
+ "\n",
612
+ ".xr-section-item input:focus + label {\n",
613
+ " border: 2px solid var(--xr-font-color0);\n",
614
+ "}\n",
615
+ "\n",
616
+ ".xr-section-item input:enabled + label:hover {\n",
617
+ " color: var(--xr-font-color0);\n",
618
+ "}\n",
619
+ "\n",
620
+ ".xr-section-summary {\n",
621
+ " grid-column: 1;\n",
622
+ " color: var(--xr-font-color2);\n",
623
+ " font-weight: 500;\n",
624
+ "}\n",
625
+ "\n",
626
+ ".xr-section-summary > span {\n",
627
+ " display: inline-block;\n",
628
+ " padding-left: 0.5em;\n",
629
+ "}\n",
630
+ "\n",
631
+ ".xr-section-summary-in:disabled + label {\n",
632
+ " color: var(--xr-font-color2);\n",
633
+ "}\n",
634
+ "\n",
635
+ ".xr-section-summary-in + label:before {\n",
636
+ " display: inline-block;\n",
637
+ " content: \"►\";\n",
638
+ " font-size: 11px;\n",
639
+ " width: 15px;\n",
640
+ " text-align: center;\n",
641
+ "}\n",
642
+ "\n",
643
+ ".xr-section-summary-in:disabled + label:before {\n",
644
+ " color: var(--xr-disabled-color);\n",
645
+ "}\n",
646
+ "\n",
647
+ ".xr-section-summary-in:checked + label:before {\n",
648
+ " content: \"▼\";\n",
649
+ "}\n",
650
+ "\n",
651
+ ".xr-section-summary-in:checked + label > span {\n",
652
+ " display: none;\n",
653
+ "}\n",
654
+ "\n",
655
+ ".xr-section-summary,\n",
656
+ ".xr-section-inline-details {\n",
657
+ " padding-top: 4px;\n",
658
+ " padding-bottom: 4px;\n",
659
+ "}\n",
660
+ "\n",
661
+ ".xr-section-inline-details {\n",
662
+ " grid-column: 2 / -1;\n",
663
+ "}\n",
664
+ "\n",
665
+ ".xr-section-details {\n",
666
+ " display: none;\n",
667
+ " grid-column: 1 / -1;\n",
668
+ " margin-bottom: 5px;\n",
669
+ "}\n",
670
+ "\n",
671
+ ".xr-section-summary-in:checked ~ .xr-section-details {\n",
672
+ " display: contents;\n",
673
+ "}\n",
674
+ "\n",
675
+ ".xr-array-wrap {\n",
676
+ " grid-column: 1 / -1;\n",
677
+ " display: grid;\n",
678
+ " grid-template-columns: 20px auto;\n",
679
+ "}\n",
680
+ "\n",
681
+ ".xr-array-wrap > label {\n",
682
+ " grid-column: 1;\n",
683
+ " vertical-align: top;\n",
684
+ "}\n",
685
+ "\n",
686
+ ".xr-preview {\n",
687
+ " color: var(--xr-font-color3);\n",
688
+ "}\n",
689
+ "\n",
690
+ ".xr-array-preview,\n",
691
+ ".xr-array-data {\n",
692
+ " padding: 0 5px !important;\n",
693
+ " grid-column: 2;\n",
694
+ "}\n",
695
+ "\n",
696
+ ".xr-array-data,\n",
697
+ ".xr-array-in:checked ~ .xr-array-preview {\n",
698
+ " display: none;\n",
699
+ "}\n",
700
+ "\n",
701
+ ".xr-array-in:checked ~ .xr-array-data,\n",
702
+ ".xr-array-preview {\n",
703
+ " display: inline-block;\n",
704
+ "}\n",
705
+ "\n",
706
+ ".xr-dim-list {\n",
707
+ " display: inline-block !important;\n",
708
+ " list-style: none;\n",
709
+ " padding: 0 !important;\n",
710
+ " margin: 0;\n",
711
+ "}\n",
712
+ "\n",
713
+ ".xr-dim-list li {\n",
714
+ " display: inline-block;\n",
715
+ " padding: 0;\n",
716
+ " margin: 0;\n",
717
+ "}\n",
718
+ "\n",
719
+ ".xr-dim-list:before {\n",
720
+ " content: \"(\";\n",
721
+ "}\n",
722
+ "\n",
723
+ ".xr-dim-list:after {\n",
724
+ " content: \")\";\n",
725
+ "}\n",
726
+ "\n",
727
+ ".xr-dim-list li:not(:last-child):after {\n",
728
+ " content: \",\";\n",
729
+ " padding-right: 5px;\n",
730
+ "}\n",
731
+ "\n",
732
+ ".xr-has-index {\n",
733
+ " font-weight: bold;\n",
734
+ "}\n",
735
+ "\n",
736
+ ".xr-var-list,\n",
737
+ ".xr-var-item {\n",
738
+ " display: contents;\n",
739
+ "}\n",
740
+ "\n",
741
+ ".xr-var-item > div,\n",
742
+ ".xr-var-item label,\n",
743
+ ".xr-var-item > .xr-var-name span {\n",
744
+ " background-color: var(--xr-background-color-row-even);\n",
745
+ " margin-bottom: 0;\n",
746
+ "}\n",
747
+ "\n",
748
+ ".xr-var-item > .xr-var-name:hover span {\n",
749
+ " padding-right: 5px;\n",
750
+ "}\n",
751
+ "\n",
752
+ ".xr-var-list > li:nth-child(odd) > div,\n",
753
+ ".xr-var-list > li:nth-child(odd) > label,\n",
754
+ ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
755
+ " background-color: var(--xr-background-color-row-odd);\n",
756
+ "}\n",
757
+ "\n",
758
+ ".xr-var-name {\n",
759
+ " grid-column: 1;\n",
760
+ "}\n",
761
+ "\n",
762
+ ".xr-var-dims {\n",
763
+ " grid-column: 2;\n",
764
+ "}\n",
765
+ "\n",
766
+ ".xr-var-dtype {\n",
767
+ " grid-column: 3;\n",
768
+ " text-align: right;\n",
769
+ " color: var(--xr-font-color2);\n",
770
+ "}\n",
771
+ "\n",
772
+ ".xr-var-preview {\n",
773
+ " grid-column: 4;\n",
774
+ "}\n",
775
+ "\n",
776
+ ".xr-index-preview {\n",
777
+ " grid-column: 2 / 5;\n",
778
+ " color: var(--xr-font-color2);\n",
779
+ "}\n",
780
+ "\n",
781
+ ".xr-var-name,\n",
782
+ ".xr-var-dims,\n",
783
+ ".xr-var-dtype,\n",
784
+ ".xr-preview,\n",
785
+ ".xr-attrs dt {\n",
786
+ " white-space: nowrap;\n",
787
+ " overflow: hidden;\n",
788
+ " text-overflow: ellipsis;\n",
789
+ " padding-right: 10px;\n",
790
+ "}\n",
791
+ "\n",
792
+ ".xr-var-name:hover,\n",
793
+ ".xr-var-dims:hover,\n",
794
+ ".xr-var-dtype:hover,\n",
795
+ ".xr-attrs dt:hover {\n",
796
+ " overflow: visible;\n",
797
+ " width: auto;\n",
798
+ " z-index: 1;\n",
799
+ "}\n",
800
+ "\n",
801
+ ".xr-var-attrs,\n",
802
+ ".xr-var-data,\n",
803
+ ".xr-index-data {\n",
804
+ " display: none;\n",
805
+ " background-color: var(--xr-background-color) !important;\n",
806
+ " padding-bottom: 5px !important;\n",
807
+ "}\n",
808
+ "\n",
809
+ ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
810
+ ".xr-var-data-in:checked ~ .xr-var-data,\n",
811
+ ".xr-index-data-in:checked ~ .xr-index-data {\n",
812
+ " display: block;\n",
813
+ "}\n",
814
+ "\n",
815
+ ".xr-var-data > table {\n",
816
+ " float: right;\n",
817
+ "}\n",
818
+ "\n",
819
+ ".xr-var-name span,\n",
820
+ ".xr-var-data,\n",
821
+ ".xr-index-name div,\n",
822
+ ".xr-index-data,\n",
823
+ ".xr-attrs {\n",
824
+ " padding-left: 25px !important;\n",
825
+ "}\n",
826
+ "\n",
827
+ ".xr-attrs,\n",
828
+ ".xr-var-attrs,\n",
829
+ ".xr-var-data,\n",
830
+ ".xr-index-data {\n",
831
+ " grid-column: 1 / -1;\n",
832
+ "}\n",
833
+ "\n",
834
+ "dl.xr-attrs {\n",
835
+ " padding: 0;\n",
836
+ " margin: 0;\n",
837
+ " display: grid;\n",
838
+ " grid-template-columns: 125px auto;\n",
839
+ "}\n",
840
+ "\n",
841
+ ".xr-attrs dt,\n",
842
+ ".xr-attrs dd {\n",
843
+ " padding: 0;\n",
844
+ " margin: 0;\n",
845
+ " float: left;\n",
846
+ " padding-right: 10px;\n",
847
+ " width: auto;\n",
848
+ "}\n",
849
+ "\n",
850
+ ".xr-attrs dt {\n",
851
+ " font-weight: normal;\n",
852
+ " grid-column: 1;\n",
853
+ "}\n",
854
+ "\n",
855
+ ".xr-attrs dt:hover span {\n",
856
+ " display: inline-block;\n",
857
+ " background: var(--xr-background-color);\n",
858
+ " padding-right: 10px;\n",
859
+ "}\n",
860
+ "\n",
861
+ ".xr-attrs dd {\n",
862
+ " grid-column: 2;\n",
863
+ " white-space: pre-wrap;\n",
864
+ " word-break: break-all;\n",
865
+ "}\n",
866
+ "\n",
867
+ ".xr-icon-database,\n",
868
+ ".xr-icon-file-text2,\n",
869
+ ".xr-no-icon {\n",
870
+ " display: inline-block;\n",
871
+ " vertical-align: middle;\n",
872
+ " width: 1em;\n",
873
+ " height: 1.5em !important;\n",
874
+ " stroke-width: 0;\n",
875
+ " stroke: currentColor;\n",
876
+ " fill: currentColor;\n",
877
+ "}\n",
878
+ "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 298MB\n",
879
+ "Dimensions: (x: 27, y: 27, sample: 99766)\n",
880
+ "Coordinates:\n",
881
+ " * x (x) int64 216B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
882
+ " * y (y) int64 216B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
883
+ " * sample (sample) int64 798kB 0 1 2 3 4 5 ... 99761 99762 99763 99764 99765\n",
884
+ "Data variables:\n",
885
+ " images (sample, x, y) float32 291MB 1.093e+03 1.093e+03 ... 2.133e+03\n",
886
+ " labels (sample) float64 798kB 1.064e+03 1.194e+03 ... 2.453e+03 1.68e+03\n",
887
+ " vx (sample) float64 798kB -2.619 31.06 -2.924 ... -167.4 -43.76 -4.671\n",
888
+ " vy (sample) float64 798kB 3.084 -41.06 8.954 ... -27.1 47.03 -1.08\n",
889
+ " v (sample) float64 798kB 4.046 51.48 9.419 ... 169.6 64.24 4.794\n",
890
+ " smb (sample) float64 798kB 62.64 451.3 490.5 ... 1.294e+03 738.1 31.25\n",
891
+ " z (sample) float64 798kB 1.162e+03 1.204e+03 ... 1.22e+03 2.154e+03\n",
892
+ " s (sample) float64 798kB 0.007977 0.01595 ... 0.00455 0.008152\n",
893
+ " temp (sample) float64 798kB 244.0 252.7 246.3 ... 258.2 249.8 234.5\n",
894
+ "Attributes:\n",
895
+ " description: CNN data with elevation images. Scalar features are everyth...</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-c6bff10c-0fa0-44fe-81c3-d48f65cd0b8d' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-c6bff10c-0fa0-44fe-81c3-d48f65cd0b8d' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>x</span>: 27</li><li><span class='xr-has-index'>y</span>: 27</li><li><span class='xr-has-index'>sample</span>: 99766</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-8c708d47-4082-49f7-8b9d-0adf32231f41' class='xr-section-summary-in' type='checkbox' checked><label for='section-8c708d47-4082-49f7-8b9d-0adf32231f41' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 21 22 23 24 25 26</div><input id='attrs-8ba6949c-95bf-4ad5-b045-057cf0fcea5f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8ba6949c-95bf-4ad5-b045-057cf0fcea5f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f01e4341-92ec-4cd1-9afc-28d64ffa0de1' class='xr-var-data-in' type='checkbox'><label for='data-f01e4341-92ec-4cd1-9afc-28d64ffa0de1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
896
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>y</span></div><div class='xr-var-dims'>(y)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 21 22 23 24 25 26</div><input id='attrs-b72a2d45-a067-45c8-ab80-a5a16d6c01b3' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-b72a2d45-a067-45c8-ab80-a5a16d6c01b3' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a7d140bc-5b5a-4ebb-b5cc-855944628a93' class='xr-var-data-in' type='checkbox'><label for='data-a7d140bc-5b5a-4ebb-b5cc-855944628a93' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
897
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>sample</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 ... 99762 99763 99764 99765</div><input id='attrs-4e3a3fa9-69cf-4f4e-824e-0a65ea1b3cec' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-4e3a3fa9-69cf-4f4e-824e-0a65ea1b3cec' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-299f325f-f837-4761-902b-c9d5d3e65d4c' class='xr-var-data-in' type='checkbox'><label for='data-299f325f-f837-4761-902b-c9d5d3e65d4c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, ..., 99763, 99764, 99765])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-708909ab-3818-4ebc-b388-491bdea6d7c2' class='xr-section-summary-in' type='checkbox' checked><label for='section-708909ab-3818-4ebc-b388-491bdea6d7c2' class='xr-section-summary' >Data variables: <span>(9)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>images</span></div><div class='xr-var-dims'>(sample, x, y)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>1.093e+03 1.093e+03 ... 2.133e+03</div><input id='attrs-4b3d836a-fa09-4c7a-9f59-340894318a61' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-4b3d836a-fa09-4c7a-9f59-340894318a61' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-cfa2ec7b-dead-4863-a5f7-3b98e99dc490' class='xr-var-data-in' type='checkbox'><label for='data-cfa2ec7b-dead-4863-a5f7-3b98e99dc490' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[1092.5057 , 1093.3561 , 1094.1313 , ..., 1181.6246 ,\n",
898
+ " 1187.6576 , 1193.0239 ],\n",
899
+ " [1094.4419 , 1095.7927 , 1096.984 , ..., 1180.3619 ,\n",
900
+ " 1187.452 , 1193.2283 ],\n",
901
+ " [1096.7919 , 1098.3004 , 1099.7814 , ..., 1180.863 ,\n",
902
+ " 1188.2043 , 1192.8219 ],\n",
903
+ " ...,\n",
904
+ " [1165.3557 , 1161.6156 , 1162.1578 , ..., 1213.3615 ,\n",
905
+ " 1240.3538 , 1267.7552 ],\n",
906
+ " [1162.5809 , 1159.64 , 1158.411 , ..., 1217.8882 ,\n",
907
+ " 1221.593 , 1262.5428 ],\n",
908
+ " [1162.889 , 1158.089 , 1152.5607 , ..., 1216.3546 ,\n",
909
+ " 1219.4219 , 1261.0667 ]],\n",
910
+ "\n",
911
+ " [[1284.6726 , 1281.334 , 1280.9316 , ..., 1233.7749 ,\n",
912
+ " 1228.7972 , 1223.2537 ],\n",
913
+ " [1283.8816 , 1283.3535 , 1283.7786 , ..., 1230.4524 ,\n",
914
+ " 1225.3945 , 1219.3942 ],\n",
915
+ " [1284.984 , 1285.9851 , 1285.9116 , ..., 1226.6727 ,\n",
916
+ " 1221.5719 , 1215.9447 ],\n",
917
+ "...\n",
918
+ " [1208.358 , 1208.8232 , 1208.9432 , ..., 1249.744 ,\n",
919
+ " 1252.31 , 1254.7693 ],\n",
920
+ " [1210.8943 , 1210.7345 , 1210.8956 , ..., 1254.7004 ,\n",
921
+ " 1256.9983 , 1259.825 ],\n",
922
+ " [1213.844 , 1213.547 , 1213.1089 , ..., 1259.0881 ,\n",
923
+ " 1261.5992 , 1264.7634 ]],\n",
924
+ "\n",
925
+ " [[2119.1958 , 2120.359 , 2127.3264 , ..., 2161.8188 ,\n",
926
+ " 2161.1162 , 2157.5664 ],\n",
927
+ " [2121.8757 , 2118.1497 , 2121.682 , ..., 2160.6697 ,\n",
928
+ " 2159.7742 , 2155.9841 ],\n",
929
+ " [2128.5696 , 2122.7732 , 2120.0735 , ..., 2161.4866 ,\n",
930
+ " 2160.421 , 2155.841 ],\n",
931
+ " ...,\n",
932
+ " [2089.4995 , 2092.1367 , 2094.292 , ..., 2135.124 ,\n",
933
+ " 2133.6853 , 2133.2725 ],\n",
934
+ " [2091.6492 , 2094.2234 , 2097.71 , ..., 2132.7346 ,\n",
935
+ " 2132.212 , 2132.3438 ],\n",
936
+ " [2090.6233 , 2094.323 , 2098.8733 , ..., 2131.1018 ,\n",
937
+ " 2131.7812 , 2132.9963 ]]], dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>labels</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.064e+03 1.194e+03 ... 1.68e+03</div><input id='attrs-0b2a6aaf-bbf5-4569-bbab-5cd4c76e45d9' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-0b2a6aaf-bbf5-4569-bbab-5cd4c76e45d9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2751c73e-9bc1-4bd2-ab32-fa6db880d242' class='xr-var-data-in' type='checkbox'><label for='data-2751c73e-9bc1-4bd2-ab32-fa6db880d242' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([1064.24, 1193.7 , 1552.96, ..., 785.4 , 2452.89, 1680.48])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>vx</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-2.619 31.06 ... -43.76 -4.671</div><input id='attrs-9685dc8c-8951-44cf-bae6-53b0d83d855a' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-9685dc8c-8951-44cf-bae6-53b0d83d855a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d252b01b-062f-4041-9a16-8343931d3b81' class='xr-var-data-in' type='checkbox'><label for='data-d252b01b-062f-4041-9a16-8343931d3b81' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ -2.6192728 , 31.0641206 , -2.92434162, ..., -167.42409072,\n",
938
+ " -43.7632661 , -4.6707643 ])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>vy</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>3.084 -41.06 8.954 ... 47.03 -1.08</div><input id='attrs-1a3ed6a2-2a79-4364-b376-983ff1ea5b8f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1a3ed6a2-2a79-4364-b376-983ff1ea5b8f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-51d222f9-5e7d-4a9c-8493-d38895b5e283' class='xr-var-data-in' type='checkbox'><label for='data-51d222f9-5e7d-4a9c-8493-d38895b5e283' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 3.08424518, -41.05727307, 8.95384872, ..., -27.10210423,\n",
939
+ " 47.03347077, -1.0804574 ])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>v</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>4.046 51.48 9.419 ... 64.24 4.794</div><input id='attrs-ea9ca126-fa9b-4cf6-9dfa-3199efe5c7da' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ea9ca126-fa9b-4cf6-9dfa-3199efe5c7da' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4dbcf236-ac57-4081-8e9f-be29effc3556' class='xr-var-data-in' type='checkbox'><label for='data-4dbcf236-ac57-4081-8e9f-be29effc3556' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 4.04637595, 51.48474784, 9.41929832, ..., 169.60350883,\n",
940
+ " 64.24461715, 4.79410339])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>smb</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>62.64 451.3 490.5 ... 738.1 31.25</div><input id='attrs-df405866-562e-4446-b785-f53bf9297f74' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-df405866-562e-4446-b785-f53bf9297f74' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-30795d36-bf4f-4b3a-ac66-9830b2ba2778' class='xr-var-data-in' type='checkbox'><label for='data-30795d36-bf4f-4b3a-ac66-9830b2ba2778' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 62.64460724, 451.26375545, 490.45416098, ..., 1294.09333047,\n",
941
+ " 738.10749937, 31.25368722])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>z</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.162e+03 1.204e+03 ... 2.154e+03</div><input id='attrs-c95266fb-86df-4413-a1cf-704aeeb8fd4b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c95266fb-86df-4413-a1cf-704aeeb8fd4b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2c5724b8-cb1a-4e83-861e-45ca2f7aa255' class='xr-var-data-in' type='checkbox'><label for='data-2c5724b8-cb1a-4e83-861e-45ca2f7aa255' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([1162.27983927, 1203.77749618, 2100.54579323, ..., 212.0719624 ,\n",
942
+ " 1219.77686434, 2153.89942609])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>s</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.007977 0.01595 ... 0.008152</div><input id='attrs-c5800ab8-4adb-4733-b8d0-2e75653a33f5' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c5800ab8-4adb-4733-b8d0-2e75653a33f5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-64b426eb-1397-4a5c-a661-5950f91042e1' class='xr-var-data-in' type='checkbox'><label for='data-64b426eb-1397-4a5c-a661-5950f91042e1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0.00797659, 0.01595318, 0.0036955 , ..., 0.04859182, 0.00454957,\n",
943
+ " 0.00815192])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>temp</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>244.0 252.7 246.3 ... 249.8 234.5</div><input id='attrs-c3f17c06-3fc4-4c3a-88a8-90afc650ec43' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c3f17c06-3fc4-4c3a-88a8-90afc650ec43' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-fe9a5422-2446-4de1-acd5-a8609fd88623' class='xr-var-data-in' type='checkbox'><label for='data-fe9a5422-2446-4de1-acd5-a8609fd88623' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([244.02185692, 252.69987787, 246.28691873, ..., 258.1573107 ,\n",
944
+ " 249.76705444, 234.45177178])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-bca8d97e-9a3c-4c68-a2f3-e34a91add4d6' class='xr-section-summary-in' type='checkbox' ><label for='section-bca8d97e-9a3c-4c68-a2f3-e34a91add4d6' class='xr-section-summary' >Indexes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>x</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-0a34b61e-bb99-49b4-8018-4ef2aef54de4' class='xr-index-data-in' type='checkbox'/><label for='index-0a34b61e-bb99-49b4-8018-4ef2aef54de4' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
945
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26],\n",
946
+ " dtype=&#x27;int64&#x27;, name=&#x27;x&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>y</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-b8fda282-8e4c-4368-9582-4f0ceb9423b1' class='xr-index-data-in' type='checkbox'/><label for='index-b8fda282-8e4c-4368-9582-4f0ceb9423b1' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
947
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26],\n",
948
+ " dtype=&#x27;int64&#x27;, name=&#x27;y&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>sample</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-a3e75d4e-77de-4c54-a0e9-ef4a78c3bd36' class='xr-index-data-in' type='checkbox'/><label for='index-a3e75d4e-77de-4c54-a0e9-ef4a78c3bd36' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n",
949
+ " ...\n",
950
+ " 99756, 99757, 99758, 99759, 99760, 99761, 99762, 99763, 99764, 99765],\n",
951
+ " dtype=&#x27;int64&#x27;, name=&#x27;sample&#x27;, length=99766))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-a27dcb76-c8e0-40c3-93f3-da85eef62b1d' class='xr-section-summary-in' type='checkbox' checked><label for='section-a27dcb76-c8e0-40c3-93f3-da85eef62b1d' class='xr-section-summary' >Attributes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>description :</span></dt><dd>CNN data with elevation images. Scalar features are everything from Niccolo 30M parquet. Images are 27x27 pixels.</dd></dl></div></li></ul></div></div>"
952
+ ],
953
+ "text/plain": [
954
+ "<xarray.Dataset> Size: 298MB\n",
955
+ "Dimensions: (x: 27, y: 27, sample: 99766)\n",
956
+ "Coordinates:\n",
957
+ " * x (x) int64 216B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
958
+ " * y (y) int64 216B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
959
+ " * sample (sample) int64 798kB 0 1 2 3 4 5 ... 99761 99762 99763 99764 99765\n",
960
+ "Data variables:\n",
961
+ " images (sample, x, y) float32 291MB 1.093e+03 1.093e+03 ... 2.133e+03\n",
962
+ " labels (sample) float64 798kB 1.064e+03 1.194e+03 ... 2.453e+03 1.68e+03\n",
963
+ " vx (sample) float64 798kB -2.619 31.06 -2.924 ... -167.4 -43.76 -4.671\n",
964
+ " vy (sample) float64 798kB 3.084 -41.06 8.954 ... -27.1 47.03 -1.08\n",
965
+ " v (sample) float64 798kB 4.046 51.48 9.419 ... 169.6 64.24 4.794\n",
966
+ " smb (sample) float64 798kB 62.64 451.3 490.5 ... 1.294e+03 738.1 31.25\n",
967
+ " z (sample) float64 798kB 1.162e+03 1.204e+03 ... 1.22e+03 2.154e+03\n",
968
+ " s (sample) float64 798kB 0.007977 0.01595 ... 0.00455 0.008152\n",
969
+ " temp (sample) float64 798kB 244.0 252.7 246.3 ... 258.2 249.8 234.5\n",
970
+ "Attributes:\n",
971
+ " description: CNN data with elevation images. Scalar features are everyth..."
972
+ ]
973
+ },
974
+ "execution_count": 16,
975
+ "metadata": {},
976
+ "output_type": "execute_result"
977
+ }
978
+ ],
979
+ "source": [
980
+ "training_data_ds"
981
+ ]
982
+ },
983
+ {
984
+ "cell_type": "code",
985
+ "execution_count": null,
986
+ "id": "c0812faa",
987
+ "metadata": {},
988
+ "outputs": [],
989
+ "source": [
990
+ "# training_data_ds.to_netcdf('conv_train_1.nc')"
991
+ ]
992
+ },
993
+ {
994
+ "cell_type": "code",
995
+ "execution_count": 18,
996
+ "id": "bdb4d03a",
997
+ "metadata": {},
998
+ "outputs": [],
999
+ "source": [
1000
+ "test_import = xr.open_dataset('conv_train_1.nc') "
1001
+ ]
1002
+ },
1003
+ {
1004
+ "cell_type": "code",
1005
+ "execution_count": 19,
1006
+ "id": "6bf789a6",
1007
+ "metadata": {},
1008
+ "outputs": [
1009
+ {
1010
+ "data": {
1011
+ "text/html": [
1012
+ "<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
1013
+ "<defs>\n",
1014
+ "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
1015
+ "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
1016
+ "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
1017
+ "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
1018
+ "</symbol>\n",
1019
+ "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
1020
+ "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
1021
+ "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
1022
+ "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
1023
+ "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
1024
+ "</symbol>\n",
1025
+ "</defs>\n",
1026
+ "</svg>\n",
1027
+ "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
1028
+ " *\n",
1029
+ " */\n",
1030
+ "\n",
1031
+ ":root {\n",
1032
+ " --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
1033
+ " --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
1034
+ " --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
1035
+ " --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
1036
+ " --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
1037
+ " --xr-background-color: var(--jp-layout-color0, white);\n",
1038
+ " --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
1039
+ " --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
1040
+ "}\n",
1041
+ "\n",
1042
+ "html[theme=\"dark\"],\n",
1043
+ "html[data-theme=\"dark\"],\n",
1044
+ "body[data-theme=\"dark\"],\n",
1045
+ "body.vscode-dark {\n",
1046
+ " --xr-font-color0: rgba(255, 255, 255, 1);\n",
1047
+ " --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
1048
+ " --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
1049
+ " --xr-border-color: #1f1f1f;\n",
1050
+ " --xr-disabled-color: #515151;\n",
1051
+ " --xr-background-color: #111111;\n",
1052
+ " --xr-background-color-row-even: #111111;\n",
1053
+ " --xr-background-color-row-odd: #313131;\n",
1054
+ "}\n",
1055
+ "\n",
1056
+ ".xr-wrap {\n",
1057
+ " display: block !important;\n",
1058
+ " min-width: 300px;\n",
1059
+ " max-width: 700px;\n",
1060
+ "}\n",
1061
+ "\n",
1062
+ ".xr-text-repr-fallback {\n",
1063
+ " /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
1064
+ " display: none;\n",
1065
+ "}\n",
1066
+ "\n",
1067
+ ".xr-header {\n",
1068
+ " padding-top: 6px;\n",
1069
+ " padding-bottom: 6px;\n",
1070
+ " margin-bottom: 4px;\n",
1071
+ " border-bottom: solid 1px var(--xr-border-color);\n",
1072
+ "}\n",
1073
+ "\n",
1074
+ ".xr-header > div,\n",
1075
+ ".xr-header > ul {\n",
1076
+ " display: inline;\n",
1077
+ " margin-top: 0;\n",
1078
+ " margin-bottom: 0;\n",
1079
+ "}\n",
1080
+ "\n",
1081
+ ".xr-obj-type,\n",
1082
+ ".xr-array-name {\n",
1083
+ " margin-left: 2px;\n",
1084
+ " margin-right: 10px;\n",
1085
+ "}\n",
1086
+ "\n",
1087
+ ".xr-obj-type {\n",
1088
+ " color: var(--xr-font-color2);\n",
1089
+ "}\n",
1090
+ "\n",
1091
+ ".xr-sections {\n",
1092
+ " padding-left: 0 !important;\n",
1093
+ " display: grid;\n",
1094
+ " grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
1095
+ "}\n",
1096
+ "\n",
1097
+ ".xr-section-item {\n",
1098
+ " display: contents;\n",
1099
+ "}\n",
1100
+ "\n",
1101
+ ".xr-section-item input {\n",
1102
+ " display: inline-block;\n",
1103
+ " opacity: 0;\n",
1104
+ " height: 0;\n",
1105
+ "}\n",
1106
+ "\n",
1107
+ ".xr-section-item input + label {\n",
1108
+ " color: var(--xr-disabled-color);\n",
1109
+ "}\n",
1110
+ "\n",
1111
+ ".xr-section-item input:enabled + label {\n",
1112
+ " cursor: pointer;\n",
1113
+ " color: var(--xr-font-color2);\n",
1114
+ "}\n",
1115
+ "\n",
1116
+ ".xr-section-item input:focus + label {\n",
1117
+ " border: 2px solid var(--xr-font-color0);\n",
1118
+ "}\n",
1119
+ "\n",
1120
+ ".xr-section-item input:enabled + label:hover {\n",
1121
+ " color: var(--xr-font-color0);\n",
1122
+ "}\n",
1123
+ "\n",
1124
+ ".xr-section-summary {\n",
1125
+ " grid-column: 1;\n",
1126
+ " color: var(--xr-font-color2);\n",
1127
+ " font-weight: 500;\n",
1128
+ "}\n",
1129
+ "\n",
1130
+ ".xr-section-summary > span {\n",
1131
+ " display: inline-block;\n",
1132
+ " padding-left: 0.5em;\n",
1133
+ "}\n",
1134
+ "\n",
1135
+ ".xr-section-summary-in:disabled + label {\n",
1136
+ " color: var(--xr-font-color2);\n",
1137
+ "}\n",
1138
+ "\n",
1139
+ ".xr-section-summary-in + label:before {\n",
1140
+ " display: inline-block;\n",
1141
+ " content: \"►\";\n",
1142
+ " font-size: 11px;\n",
1143
+ " width: 15px;\n",
1144
+ " text-align: center;\n",
1145
+ "}\n",
1146
+ "\n",
1147
+ ".xr-section-summary-in:disabled + label:before {\n",
1148
+ " color: var(--xr-disabled-color);\n",
1149
+ "}\n",
1150
+ "\n",
1151
+ ".xr-section-summary-in:checked + label:before {\n",
1152
+ " content: \"▼\";\n",
1153
+ "}\n",
1154
+ "\n",
1155
+ ".xr-section-summary-in:checked + label > span {\n",
1156
+ " display: none;\n",
1157
+ "}\n",
1158
+ "\n",
1159
+ ".xr-section-summary,\n",
1160
+ ".xr-section-inline-details {\n",
1161
+ " padding-top: 4px;\n",
1162
+ " padding-bottom: 4px;\n",
1163
+ "}\n",
1164
+ "\n",
1165
+ ".xr-section-inline-details {\n",
1166
+ " grid-column: 2 / -1;\n",
1167
+ "}\n",
1168
+ "\n",
1169
+ ".xr-section-details {\n",
1170
+ " display: none;\n",
1171
+ " grid-column: 1 / -1;\n",
1172
+ " margin-bottom: 5px;\n",
1173
+ "}\n",
1174
+ "\n",
1175
+ ".xr-section-summary-in:checked ~ .xr-section-details {\n",
1176
+ " display: contents;\n",
1177
+ "}\n",
1178
+ "\n",
1179
+ ".xr-array-wrap {\n",
1180
+ " grid-column: 1 / -1;\n",
1181
+ " display: grid;\n",
1182
+ " grid-template-columns: 20px auto;\n",
1183
+ "}\n",
1184
+ "\n",
1185
+ ".xr-array-wrap > label {\n",
1186
+ " grid-column: 1;\n",
1187
+ " vertical-align: top;\n",
1188
+ "}\n",
1189
+ "\n",
1190
+ ".xr-preview {\n",
1191
+ " color: var(--xr-font-color3);\n",
1192
+ "}\n",
1193
+ "\n",
1194
+ ".xr-array-preview,\n",
1195
+ ".xr-array-data {\n",
1196
+ " padding: 0 5px !important;\n",
1197
+ " grid-column: 2;\n",
1198
+ "}\n",
1199
+ "\n",
1200
+ ".xr-array-data,\n",
1201
+ ".xr-array-in:checked ~ .xr-array-preview {\n",
1202
+ " display: none;\n",
1203
+ "}\n",
1204
+ "\n",
1205
+ ".xr-array-in:checked ~ .xr-array-data,\n",
1206
+ ".xr-array-preview {\n",
1207
+ " display: inline-block;\n",
1208
+ "}\n",
1209
+ "\n",
1210
+ ".xr-dim-list {\n",
1211
+ " display: inline-block !important;\n",
1212
+ " list-style: none;\n",
1213
+ " padding: 0 !important;\n",
1214
+ " margin: 0;\n",
1215
+ "}\n",
1216
+ "\n",
1217
+ ".xr-dim-list li {\n",
1218
+ " display: inline-block;\n",
1219
+ " padding: 0;\n",
1220
+ " margin: 0;\n",
1221
+ "}\n",
1222
+ "\n",
1223
+ ".xr-dim-list:before {\n",
1224
+ " content: \"(\";\n",
1225
+ "}\n",
1226
+ "\n",
1227
+ ".xr-dim-list:after {\n",
1228
+ " content: \")\";\n",
1229
+ "}\n",
1230
+ "\n",
1231
+ ".xr-dim-list li:not(:last-child):after {\n",
1232
+ " content: \",\";\n",
1233
+ " padding-right: 5px;\n",
1234
+ "}\n",
1235
+ "\n",
1236
+ ".xr-has-index {\n",
1237
+ " font-weight: bold;\n",
1238
+ "}\n",
1239
+ "\n",
1240
+ ".xr-var-list,\n",
1241
+ ".xr-var-item {\n",
1242
+ " display: contents;\n",
1243
+ "}\n",
1244
+ "\n",
1245
+ ".xr-var-item > div,\n",
1246
+ ".xr-var-item label,\n",
1247
+ ".xr-var-item > .xr-var-name span {\n",
1248
+ " background-color: var(--xr-background-color-row-even);\n",
1249
+ " margin-bottom: 0;\n",
1250
+ "}\n",
1251
+ "\n",
1252
+ ".xr-var-item > .xr-var-name:hover span {\n",
1253
+ " padding-right: 5px;\n",
1254
+ "}\n",
1255
+ "\n",
1256
+ ".xr-var-list > li:nth-child(odd) > div,\n",
1257
+ ".xr-var-list > li:nth-child(odd) > label,\n",
1258
+ ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
1259
+ " background-color: var(--xr-background-color-row-odd);\n",
1260
+ "}\n",
1261
+ "\n",
1262
+ ".xr-var-name {\n",
1263
+ " grid-column: 1;\n",
1264
+ "}\n",
1265
+ "\n",
1266
+ ".xr-var-dims {\n",
1267
+ " grid-column: 2;\n",
1268
+ "}\n",
1269
+ "\n",
1270
+ ".xr-var-dtype {\n",
1271
+ " grid-column: 3;\n",
1272
+ " text-align: right;\n",
1273
+ " color: var(--xr-font-color2);\n",
1274
+ "}\n",
1275
+ "\n",
1276
+ ".xr-var-preview {\n",
1277
+ " grid-column: 4;\n",
1278
+ "}\n",
1279
+ "\n",
1280
+ ".xr-index-preview {\n",
1281
+ " grid-column: 2 / 5;\n",
1282
+ " color: var(--xr-font-color2);\n",
1283
+ "}\n",
1284
+ "\n",
1285
+ ".xr-var-name,\n",
1286
+ ".xr-var-dims,\n",
1287
+ ".xr-var-dtype,\n",
1288
+ ".xr-preview,\n",
1289
+ ".xr-attrs dt {\n",
1290
+ " white-space: nowrap;\n",
1291
+ " overflow: hidden;\n",
1292
+ " text-overflow: ellipsis;\n",
1293
+ " padding-right: 10px;\n",
1294
+ "}\n",
1295
+ "\n",
1296
+ ".xr-var-name:hover,\n",
1297
+ ".xr-var-dims:hover,\n",
1298
+ ".xr-var-dtype:hover,\n",
1299
+ ".xr-attrs dt:hover {\n",
1300
+ " overflow: visible;\n",
1301
+ " width: auto;\n",
1302
+ " z-index: 1;\n",
1303
+ "}\n",
1304
+ "\n",
1305
+ ".xr-var-attrs,\n",
1306
+ ".xr-var-data,\n",
1307
+ ".xr-index-data {\n",
1308
+ " display: none;\n",
1309
+ " background-color: var(--xr-background-color) !important;\n",
1310
+ " padding-bottom: 5px !important;\n",
1311
+ "}\n",
1312
+ "\n",
1313
+ ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
1314
+ ".xr-var-data-in:checked ~ .xr-var-data,\n",
1315
+ ".xr-index-data-in:checked ~ .xr-index-data {\n",
1316
+ " display: block;\n",
1317
+ "}\n",
1318
+ "\n",
1319
+ ".xr-var-data > table {\n",
1320
+ " float: right;\n",
1321
+ "}\n",
1322
+ "\n",
1323
+ ".xr-var-name span,\n",
1324
+ ".xr-var-data,\n",
1325
+ ".xr-index-name div,\n",
1326
+ ".xr-index-data,\n",
1327
+ ".xr-attrs {\n",
1328
+ " padding-left: 25px !important;\n",
1329
+ "}\n",
1330
+ "\n",
1331
+ ".xr-attrs,\n",
1332
+ ".xr-var-attrs,\n",
1333
+ ".xr-var-data,\n",
1334
+ ".xr-index-data {\n",
1335
+ " grid-column: 1 / -1;\n",
1336
+ "}\n",
1337
+ "\n",
1338
+ "dl.xr-attrs {\n",
1339
+ " padding: 0;\n",
1340
+ " margin: 0;\n",
1341
+ " display: grid;\n",
1342
+ " grid-template-columns: 125px auto;\n",
1343
+ "}\n",
1344
+ "\n",
1345
+ ".xr-attrs dt,\n",
1346
+ ".xr-attrs dd {\n",
1347
+ " padding: 0;\n",
1348
+ " margin: 0;\n",
1349
+ " float: left;\n",
1350
+ " padding-right: 10px;\n",
1351
+ " width: auto;\n",
1352
+ "}\n",
1353
+ "\n",
1354
+ ".xr-attrs dt {\n",
1355
+ " font-weight: normal;\n",
1356
+ " grid-column: 1;\n",
1357
+ "}\n",
1358
+ "\n",
1359
+ ".xr-attrs dt:hover span {\n",
1360
+ " display: inline-block;\n",
1361
+ " background: var(--xr-background-color);\n",
1362
+ " padding-right: 10px;\n",
1363
+ "}\n",
1364
+ "\n",
1365
+ ".xr-attrs dd {\n",
1366
+ " grid-column: 2;\n",
1367
+ " white-space: pre-wrap;\n",
1368
+ " word-break: break-all;\n",
1369
+ "}\n",
1370
+ "\n",
1371
+ ".xr-icon-database,\n",
1372
+ ".xr-icon-file-text2,\n",
1373
+ ".xr-no-icon {\n",
1374
+ " display: inline-block;\n",
1375
+ " vertical-align: middle;\n",
1376
+ " width: 1em;\n",
1377
+ " height: 1.5em !important;\n",
1378
+ " stroke-width: 0;\n",
1379
+ " stroke: currentColor;\n",
1380
+ " fill: currentColor;\n",
1381
+ "}\n",
1382
+ "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 298MB\n",
1383
+ "Dimensions: (sample: 99766, x: 27, y: 27)\n",
1384
+ "Coordinates:\n",
1385
+ " * sample (sample) int32 399kB 0 1 2 3 4 5 ... 99761 99762 99763 99764 99765\n",
1386
+ " * x (x) int32 108B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
1387
+ " * y (y) int32 108B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
1388
+ "Data variables:\n",
1389
+ " images (sample, x, y) float32 291MB ...\n",
1390
+ " labels (sample) float64 798kB ...\n",
1391
+ " vx (sample) float64 798kB ...\n",
1392
+ " vy (sample) float64 798kB ...\n",
1393
+ " v (sample) float64 798kB ...\n",
1394
+ " smb (sample) float64 798kB ...\n",
1395
+ " z (sample) float64 798kB ...\n",
1396
+ " s (sample) float64 798kB ...\n",
1397
+ " temp (sample) float64 798kB ...\n",
1398
+ "Attributes:\n",
1399
+ " description: CNN data with elevation images. Scalar features are everyth...</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-0e2f7c7e-2cd2-4982-a8a2-0bc8b9bdc4d5' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-0e2f7c7e-2cd2-4982-a8a2-0bc8b9bdc4d5' class='xr-section-summary' title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>sample</span>: 99766</li><li><span class='xr-has-index'>x</span>: 27</li><li><span class='xr-has-index'>y</span>: 27</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-0c1ef4d1-7113-4b9d-82de-d462fcbdb769' class='xr-section-summary-in' type='checkbox' checked><label for='section-0c1ef4d1-7113-4b9d-82de-d462fcbdb769' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>sample</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>0 1 2 3 ... 99762 99763 99764 99765</div><input id='attrs-6335aaac-619c-46bd-a686-c15a4c7d776f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-6335aaac-619c-46bd-a686-c15a4c7d776f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-55395f74-69a2-47d9-84fb-22982cbcac96' class='xr-var-data-in' type='checkbox'><label for='data-55395f74-69a2-47d9-84fb-22982cbcac96' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, ..., 99763, 99764, 99765], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 21 22 23 24 25 26</div><input id='attrs-017600b7-76db-43a5-bdc3-a67e4038cccc' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-017600b7-76db-43a5-bdc3-a67e4038cccc' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-57d16ef2-e532-4204-850d-269b006c35be' class='xr-var-data-in' type='checkbox'><label for='data-57d16ef2-e532-4204-850d-269b006c35be' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
1400
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>y</span></div><div class='xr-var-dims'>(y)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 21 22 23 24 25 26</div><input id='attrs-0aef4d4b-2f9b-4851-a3cf-0f248066e9d6' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-0aef4d4b-2f9b-4851-a3cf-0f248066e9d6' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0cceb419-823d-4b59-a48d-b28a0def925f' class='xr-var-data-in' type='checkbox'><label for='data-0cceb419-823d-4b59-a48d-b28a0def925f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
1401
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26], dtype=int32)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-e8a55884-30f5-49e3-ad00-7fff9b2f51f7' class='xr-section-summary-in' type='checkbox' checked><label for='section-e8a55884-30f5-49e3-ad00-7fff9b2f51f7' class='xr-section-summary' >Data variables: <span>(9)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>images</span></div><div class='xr-var-dims'>(sample, x, y)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-e37fe593-a0ef-4148-b41c-2017b8d8020c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-e37fe593-a0ef-4148-b41c-2017b8d8020c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-fdede8f0-6b50-41e7-ac8e-8554066f621d' class='xr-var-data-in' type='checkbox'><label for='data-fdede8f0-6b50-41e7-ac8e-8554066f621d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[72729414 values with dtype=float32]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>labels</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-038b948d-503f-4771-95d0-9270fa2dcba0' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-038b948d-503f-4771-95d0-9270fa2dcba0' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b029294f-474c-450a-bfd1-b9bb91dfe938' class='xr-var-data-in' type='checkbox'><label for='data-b029294f-474c-450a-bfd1-b9bb91dfe938' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>vx</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-514bce6b-50c5-4b51-be89-a8539e39703c' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-514bce6b-50c5-4b51-be89-a8539e39703c' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a0ad5996-2707-4e27-8527-84cc954a1193' class='xr-var-data-in' type='checkbox'><label for='data-a0ad5996-2707-4e27-8527-84cc954a1193' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>vy</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-5f0eab0b-41eb-40c6-95fc-b9c3b9f52de4' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-5f0eab0b-41eb-40c6-95fc-b9c3b9f52de4' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-928269d4-3753-4740-9c65-64552639bf90' class='xr-var-data-in' type='checkbox'><label for='data-928269d4-3753-4740-9c65-64552639bf90' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>v</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-74e1d1e3-887c-4d66-9e2b-0b6cd18d5a8d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-74e1d1e3-887c-4d66-9e2b-0b6cd18d5a8d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b4f50b80-4e4e-477e-9444-150ab3df8050' class='xr-var-data-in' type='checkbox'><label for='data-b4f50b80-4e4e-477e-9444-150ab3df8050' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>smb</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-620958f0-24af-47d3-8c98-8d148ac5e878' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-620958f0-24af-47d3-8c98-8d148ac5e878' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4847a9ae-aae0-4826-beda-9e66abf11b65' class='xr-var-data-in' type='checkbox'><label for='data-4847a9ae-aae0-4826-beda-9e66abf11b65' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>z</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-3d9aefec-49f1-4203-b22e-dbfa9050900d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3d9aefec-49f1-4203-b22e-dbfa9050900d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bc2ce70c-f1da-4fc9-8542-a7e2645c7ab2' class='xr-var-data-in' type='checkbox'><label for='data-bc2ce70c-f1da-4fc9-8542-a7e2645c7ab2' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>s</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-93510040-c969-4a01-a924-47df518e586f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-93510040-c969-4a01-a924-47df518e586f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3c917ecb-f7f4-4692-872c-5eeb60bead45' class='xr-var-data-in' type='checkbox'><label for='data-3c917ecb-f7f4-4692-872c-5eeb60bead45' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>temp</span></div><div class='xr-var-dims'>(sample)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>...</div><input id='attrs-fdfc0af3-4e34-4783-bdf2-b2dabba05d31' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-fdfc0af3-4e34-4783-bdf2-b2dabba05d31' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-d7f830f2-7802-4932-8fbc-e3b8a1fddca1' class='xr-var-data-in' type='checkbox'><label for='data-d7f830f2-7802-4932-8fbc-e3b8a1fddca1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>[99766 values with dtype=float64]</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-949cf030-21e2-49bb-94dd-b4da96ac9b38' class='xr-section-summary-in' type='checkbox' ><label for='section-949cf030-21e2-49bb-94dd-b4da96ac9b38' class='xr-section-summary' >Indexes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>sample</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-8e8e183f-f1b9-474e-bd07-1b44f26b18d4' class='xr-index-data-in' type='checkbox'/><label for='index-8e8e183f-f1b9-474e-bd07-1b44f26b18d4' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n",
1402
+ " ...\n",
1403
+ " 99756, 99757, 99758, 99759, 99760, 99761, 99762, 99763, 99764, 99765],\n",
1404
+ " dtype=&#x27;int32&#x27;, name=&#x27;sample&#x27;, length=99766))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>x</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-7778756e-c0a5-46ff-b2b8-22d1512fcf9e' class='xr-index-data-in' type='checkbox'/><label for='index-7778756e-c0a5-46ff-b2b8-22d1512fcf9e' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
1405
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26],\n",
1406
+ " dtype=&#x27;int32&#x27;, name=&#x27;x&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>y</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-65f25132-8c31-4309-a3e5-9d43eec4fbd0' class='xr-index-data-in' type='checkbox'/><label for='index-65f25132-8c31-4309-a3e5-9d43eec4fbd0' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
1407
+ " 18, 19, 20, 21, 22, 23, 24, 25, 26],\n",
1408
+ " dtype=&#x27;int32&#x27;, name=&#x27;y&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-a5029b4a-40fe-4041-9186-6209cf7587d0' class='xr-section-summary-in' type='checkbox' checked><label for='section-a5029b4a-40fe-4041-9186-6209cf7587d0' class='xr-section-summary' >Attributes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>description :</span></dt><dd>CNN data with elevation images. Scalar features are everything from Niccolo 30M parquet. Images are 27x27 pixels.</dd></dl></div></li></ul></div></div>"
1409
+ ],
1410
+ "text/plain": [
1411
+ "<xarray.Dataset> Size: 298MB\n",
1412
+ "Dimensions: (sample: 99766, x: 27, y: 27)\n",
1413
+ "Coordinates:\n",
1414
+ " * sample (sample) int32 399kB 0 1 2 3 4 5 ... 99761 99762 99763 99764 99765\n",
1415
+ " * x (x) int32 108B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
1416
+ " * y (y) int32 108B 0 1 2 3 4 5 6 7 8 9 ... 18 19 20 21 22 23 24 25 26\n",
1417
+ "Data variables:\n",
1418
+ " images (sample, x, y) float32 291MB ...\n",
1419
+ " labels (sample) float64 798kB ...\n",
1420
+ " vx (sample) float64 798kB ...\n",
1421
+ " vy (sample) float64 798kB ...\n",
1422
+ " v (sample) float64 798kB ...\n",
1423
+ " smb (sample) float64 798kB ...\n",
1424
+ " z (sample) float64 798kB ...\n",
1425
+ " s (sample) float64 798kB ...\n",
1426
+ " temp (sample) float64 798kB ...\n",
1427
+ "Attributes:\n",
1428
+ " description: CNN data with elevation images. Scalar features are everyth..."
1429
+ ]
1430
+ },
1431
+ "execution_count": 19,
1432
+ "metadata": {},
1433
+ "output_type": "execute_result"
1434
+ }
1435
+ ],
1436
+ "source": [
1437
+ "test_import"
1438
+ ]
1439
+ },
1440
+ {
1441
+ "cell_type": "code",
1442
+ "execution_count": null,
1443
+ "id": "4a1e044e",
1444
+ "metadata": {},
1445
+ "outputs": [],
1446
+ "source": [
1447
+ "p = gdf.iloc[0].geometry\n",
1448
+ "\n",
1449
+ "transform = sat_im.rio.transform()\n",
1450
+ "\n",
1451
+ "col, row = ~transform * (p.x, p.y)\n",
1452
+ "\n",
1453
+ "col, row = int(np.floor(col)), int(np.floor(row))\n",
1454
+ "\n",
1455
+ "print(p.x, p.y)\n",
1456
+ "\n",
1457
+ "print(sat_im.surface[0][row][col].x, sat_im.surface[0][row][col].y)"
1458
+ ]
1459
+ },
1460
+ {
1461
+ "cell_type": "code",
1462
+ "execution_count": 25,
1463
+ "id": "9ac2f290",
1464
+ "metadata": {},
1465
+ "outputs": [
1466
+ {
1467
+ "name": "stdout",
1468
+ "output_type": "stream",
1469
+ "text": [
1470
+ "\n",
1471
+ "Source file path for Affine class: c:\\Users\\Cap\\Documents\\Python_Scripts\\AppML\\.geoMLvenv\\Lib\\site-packages\\affine\\__init__.py\n"
1472
+ ]
1473
+ }
1474
+ ],
1475
+ "source": [
1476
+ "import inspect\n",
1477
+ "\n",
1478
+ "source_file_path = inspect.getsourcefile(type(sat_im.surface.rio.transform()))\n",
1479
+ "print(f\"\\nSource file path for Affine class: {source_file_path}\")"
1480
+ ]
1481
+ }
1482
+ ],
1483
+ "metadata": {
1484
+ "kernelspec": {
1485
+ "display_name": ".geoMLvenv",
1486
+ "language": "python",
1487
+ "name": "python3"
1488
+ },
1489
+ "language_info": {
1490
+ "codemirror_mode": {
1491
+ "name": "ipython",
1492
+ "version": 3
1493
+ },
1494
+ "file_extension": ".py",
1495
+ "mimetype": "text/x-python",
1496
+ "name": "python",
1497
+ "nbconvert_exporter": "python",
1498
+ "pygments_lexer": "ipython3",
1499
+ "version": "3.11.9"
1500
+ }
1501
+ },
1502
+ "nbformat": 4,
1503
+ "nbformat_minor": 5
1504
+ }