|
22 | 22 | }, |
23 | 23 | { |
24 | 24 | "cell_type": "code", |
25 | | - "execution_count": null, |
26 | 25 | "id": "4fd7d3b3-5186-4157-841e-1b4c9f38bb62", |
27 | | - "metadata": { |
28 | | - "ExecuteTime": { |
29 | | - "start_time": "2024-10-09T20:06:48.348972Z" |
30 | | - }, |
31 | | - "jupyter": { |
32 | | - "is_executing": true |
33 | | - } |
34 | | - }, |
35 | | - "outputs": [], |
| 26 | + "metadata": {}, |
36 | 27 | "source": [ |
37 | 28 | "import warnings\n", |
38 | 29 | "\n", |
|
41 | 32 | "import uxarray as ux\n", |
42 | 33 | "\n", |
43 | 34 | "warnings.filterwarnings(\"ignore\")" |
44 | | - ] |
| 35 | + ], |
| 36 | + "outputs": [], |
| 37 | + "execution_count": null |
45 | 38 | }, |
46 | 39 | { |
47 | 40 | "cell_type": "code", |
48 | | - "execution_count": null, |
49 | 41 | "id": "1eebd05d-506e-4227-aa8e-f1212aae30f2", |
50 | 42 | "metadata": {}, |
51 | | - "outputs": [], |
52 | 43 | "source": [ |
53 | 44 | "file = \"../../test/meshfiles/mpas/QU/mesh.QU.1920km.151026.nc\"\n", |
54 | 45 | "\n", |
55 | 46 | "uxds = ux.open_dataset(file, file)" |
56 | | - ] |
| 47 | + ], |
| 48 | + "outputs": [], |
| 49 | + "execution_count": null |
57 | 50 | }, |
58 | 51 | { |
59 | 52 | "cell_type": "markdown", |
|
73 | 66 | }, |
74 | 67 | { |
75 | 68 | "cell_type": "code", |
76 | | - "execution_count": null, |
77 | 69 | "id": "6486e0e4-1908-4363-8196-2efa9e521e56", |
78 | 70 | "metadata": {}, |
79 | | - "outputs": [], |
80 | 71 | "source": [ |
81 | 72 | "grid = uxds.uxgrid" |
82 | | - ] |
| 73 | + ], |
| 74 | + "outputs": [], |
| 75 | + "execution_count": null |
83 | 76 | }, |
84 | 77 | { |
85 | 78 | "cell_type": "code", |
86 | | - "execution_count": null, |
87 | 79 | "id": "925a82d6-2947-4b15-a3ff-0b0612bc5ba0", |
88 | 80 | "metadata": {}, |
89 | | - "outputs": [], |
90 | 81 | "source": [ |
91 | 82 | "dual = grid.get_dual()" |
92 | | - ] |
| 83 | + ], |
| 84 | + "outputs": [], |
| 85 | + "execution_count": null |
93 | 86 | }, |
94 | 87 | { |
95 | 88 | "cell_type": "code", |
96 | | - "execution_count": null, |
97 | 89 | "id": "12e9a8a5-526f-4b30-9a0b-de2d6d809f1d", |
98 | 90 | "metadata": {}, |
99 | | - "outputs": [], |
100 | 91 | "source": [ |
101 | 92 | "(\n", |
102 | 93 | " grid.plot(title=\"Primal Grid\", backend=\"bokeh\", projection=ccrs.Orthographic())\n", |
103 | 94 | " + dual.plot(title=\"Dual Grid\", backend=\"bokeh\", projection=ccrs.Orthographic())\n", |
104 | 95 | ")" |
105 | | - ] |
| 96 | + ], |
| 97 | + "outputs": [], |
| 98 | + "execution_count": null |
106 | 99 | }, |
107 | 100 | { |
108 | 101 | "cell_type": "code", |
109 | | - "execution_count": null, |
110 | 102 | "id": "550be213-245f-4c2e-8a59-c18b36d58e0f", |
111 | 103 | "metadata": {}, |
112 | | - "outputs": [], |
113 | 104 | "source": [ |
114 | 105 | "(\n", |
115 | 106 | " grid.plot(backend=\"bokeh\", projection=ccrs.Orthographic(), color=\"red\")\n", |
116 | 107 | " * dual.plot(backend=\"bokeh\", projection=ccrs.Orthographic(), color=\"blue\")\n", |
117 | 108 | ").opts(title=\"Primal (Red) & Dual (Blue) Grids\")" |
118 | | - ] |
| 109 | + ], |
| 110 | + "outputs": [], |
| 111 | + "execution_count": null |
119 | 112 | }, |
120 | 113 | { |
121 | 114 | "cell_type": "markdown", |
|
155 | 148 | }, |
156 | 149 | { |
157 | 150 | "cell_type": "code", |
158 | | - "execution_count": null, |
159 | 151 | "id": "75e86af7-de9c-4013-91f6-9fd9e9c0c3ad", |
160 | 152 | "metadata": {}, |
161 | | - "outputs": [], |
162 | 153 | "source": [ |
163 | 154 | "uxds_dual_face = uxds[\"latCell\"].get_dual()" |
164 | | - ] |
| 155 | + ], |
| 156 | + "outputs": [], |
| 157 | + "execution_count": null |
165 | 158 | }, |
166 | 159 | { |
167 | 160 | "cell_type": "code", |
168 | | - "execution_count": null, |
169 | 161 | "id": "ff1407d4-910e-4b89-a6eb-6c4fbed9488a", |
170 | 162 | "metadata": {}, |
171 | | - "outputs": [], |
172 | 163 | "source": [ |
173 | 164 | "(\n", |
174 | 165 | " uxds[\"latCell\"].plot.polygons(\n", |
175 | 166 | " rasterize=True,\n", |
176 | 167 | " backend=\"matplotlib\",\n", |
177 | 168 | " title=\"Face centered data on Primal Mesh\",\n", |
178 | | - " cmap=ux.cmaps.sequential_green_blue,\n", |
| 169 | + " cmap=\"Blues\",\n", |
179 | 170 | " projection=ccrs.Orthographic(),\n", |
180 | 171 | " )\n", |
181 | 172 | " + uxds_dual_face.topological_mean(destination=\"face\").plot.polygons(\n", |
182 | 173 | " rasterize=True,\n", |
183 | 174 | " backend=\"matplotlib\",\n", |
184 | 175 | " title=\"Node Centered Data on Dual Mesh\",\n", |
185 | | - " cmap=ux.cmaps.sequential_green_blue,\n", |
| 176 | + " cmap=\"Blues\",\n", |
186 | 177 | " projection=ccrs.Orthographic(),\n", |
187 | 178 | " )\n", |
188 | 179 | ").cols(1).opts(fig_size=125)" |
189 | | - ] |
| 180 | + ], |
| 181 | + "outputs": [], |
| 182 | + "execution_count": null |
190 | 183 | }, |
191 | 184 | { |
192 | 185 | "cell_type": "markdown", |
|
206 | 199 | }, |
207 | 200 | { |
208 | 201 | "cell_type": "code", |
209 | | - "execution_count": null, |
210 | 202 | "id": "c68473ae-dac6-422e-b322-71cfbfe3f876", |
211 | 203 | "metadata": {}, |
212 | | - "outputs": [], |
213 | 204 | "source": [ |
214 | 205 | "uxds_dual_node = uxds[\"latVertex\"].get_dual()" |
215 | | - ] |
| 206 | + ], |
| 207 | + "outputs": [], |
| 208 | + "execution_count": null |
216 | 209 | }, |
217 | 210 | { |
218 | 211 | "cell_type": "code", |
219 | | - "execution_count": null, |
220 | 212 | "id": "1cec4e98-d35f-41cc-b3a2-b2bcf1db2094", |
221 | 213 | "metadata": {}, |
222 | | - "outputs": [], |
223 | 214 | "source": [ |
224 | 215 | "(\n", |
225 | 216 | " uxds[\"latVertex\"]\n", |
|
228 | 219 | " rasterize=True,\n", |
229 | 220 | " backend=\"matplotlib\",\n", |
230 | 221 | " title=\"Face centered data on Primal Mesh\",\n", |
231 | | - " cmap=ux.cmaps.sequential_green_blue,\n", |
| 222 | + " cmap=\"Blues\",\n", |
232 | 223 | " projection=ccrs.Orthographic(),\n", |
233 | 224 | " )\n", |
234 | 225 | " + uxds_dual_node.plot.polygons(\n", |
235 | 226 | " rasterize=True,\n", |
236 | 227 | " backend=\"matplotlib\",\n", |
237 | 228 | " title=\"Node Centered Data on Dual Mesh\",\n", |
238 | | - " cmap=ux.cmaps.sequential_green_blue,\n", |
| 229 | + " cmap=\"Blues\",\n", |
239 | 230 | " projection=ccrs.Orthographic(),\n", |
240 | 231 | " )\n", |
241 | 232 | ").cols(1).opts(fig_size=125)" |
242 | | - ] |
| 233 | + ], |
| 234 | + "outputs": [], |
| 235 | + "execution_count": null |
243 | 236 | }, |
244 | 237 | { |
245 | 238 | "cell_type": "markdown", |
|
275 | 268 | }, |
276 | 269 | { |
277 | 270 | "cell_type": "code", |
278 | | - "execution_count": null, |
279 | 271 | "id": "97a884d0-5966-4bfc-b505-ceb3c37c4b47", |
280 | 272 | "metadata": {}, |
281 | | - "outputs": [], |
282 | 273 | "source": [ |
283 | 274 | "uxds" |
284 | | - ] |
| 275 | + ], |
| 276 | + "outputs": [], |
| 277 | + "execution_count": null |
285 | 278 | }, |
286 | 279 | { |
287 | 280 | "cell_type": "markdown", |
|
293 | 286 | }, |
294 | 287 | { |
295 | 288 | "cell_type": "code", |
296 | | - "execution_count": null, |
297 | 289 | "id": "9c14a1bd-d06a-4ccb-92a5-9054e063e740", |
298 | 290 | "metadata": {}, |
299 | | - "outputs": [], |
300 | 291 | "source": [ |
301 | 292 | "uxds_dual = uxds.get_dual()" |
302 | | - ] |
| 293 | + ], |
| 294 | + "outputs": [], |
| 295 | + "execution_count": null |
303 | 296 | }, |
304 | 297 | { |
305 | 298 | "cell_type": "code", |
306 | | - "execution_count": null, |
307 | 299 | "id": "7c039b32-03cd-4b83-b41e-dc5e06d118a0", |
308 | 300 | "metadata": {}, |
309 | | - "outputs": [], |
310 | 301 | "source": [ |
311 | 302 | "uxds_dual" |
312 | | - ] |
| 303 | + ], |
| 304 | + "outputs": [], |
| 305 | + "execution_count": null |
313 | 306 | }, |
314 | 307 | { |
315 | 308 | "cell_type": "markdown", |
|
321 | 314 | }, |
322 | 315 | { |
323 | 316 | "cell_type": "code", |
324 | | - "execution_count": null, |
325 | 317 | "id": "85dedc57-f179-43b9-a55c-c0b469330988", |
326 | 318 | "metadata": {}, |
327 | | - "outputs": [], |
328 | 319 | "source": [ |
329 | 320 | "uxds_dual[\"latVertex\"].plot.polygons(\n", |
330 | 321 | " rasterize=True,\n", |
331 | 322 | " backend=\"matplotlib\",\n", |
332 | 323 | " title=\"latVertex from UxDataset dual mesh\",\n", |
333 | | - " cmap=ux.cmaps.sequential_green_blue,\n", |
| 324 | + " cmap=\"Blues\",\n", |
334 | 325 | " projection=ccrs.Orthographic(),\n", |
335 | 326 | ").opts(fig_size=120)" |
336 | | - ] |
| 327 | + ], |
| 328 | + "outputs": [], |
| 329 | + "execution_count": null |
337 | 330 | } |
338 | 331 | ], |
339 | 332 | "metadata": { |
|
0 commit comments