From 3f0b2d92754d3d638c87147a7d42c05cb6cc1bd6 Mon Sep 17 00:00:00 2001 From: Matthew Iannucci Date: Tue, 30 Jul 2024 14:46:51 -0400 Subject: [PATCH] Working selector class before api improvements --- examples/fvcom.ipynb | 1214 ++++++++----------- xarray_subset_grid/grids/regular_grid.py | 48 +- xarray_subset_grid/grids/regular_grid_2d.py | 49 +- xarray_subset_grid/grids/sgrid.py | 63 +- xarray_subset_grid/grids/ugrid.py | 79 +- xarray_subset_grid/selector.py | 7 + 6 files changed, 734 insertions(+), 726 deletions(-) create mode 100644 xarray_subset_grid/selector.py diff --git a/examples/fvcom.ipynb b/examples/fvcom.ipynb index dd5af93..c4ab38f 100644 --- a/examples/fvcom.ipynb +++ b/examples/fvcom.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 1, "id": "29314777-4fff-4f63-ac75-65620ba193e0", "metadata": {}, "outputs": [ @@ -388,18 +388,18 @@ " stroke: currentColor;\n", " fill: currentColor;\n", "}\n", - "
<xarray.Dataset> Size: 21GB\n",
-       "Dimensions:             (time: 835, four: 4, nele: 569405, node: 303714,\n",
+       "
<xarray.Dataset> Size: 25GB\n",
+       "Dimensions:             (time: 979, four: 4, nele: 569405, node: 303714,\n",
        "                         three: 3, maxnode: 10, maxelem: 8)\n",
        "Coordinates:\n",
        "    lat                 (node) float32 1MB dask.array<chunksize=(303714,), meta=np.ndarray>\n",
        "    latc                (nele) float32 2MB dask.array<chunksize=(569405,), meta=np.ndarray>\n",
        "    lon                 (node) float32 1MB dask.array<chunksize=(303714,), meta=np.ndarray>\n",
        "    lonc                (nele) float32 2MB dask.array<chunksize=(569405,), meta=np.ndarray>\n",
-       "  * time                (time) datetime64[ns] 7kB 2024-06-21T21:00:00 ... 202...\n",
+       "  * time                (time) datetime64[ns] 8kB 2024-06-21T21:00:00 ... 202...\n",
        "Dimensions without coordinates: four, nele, node, three, maxnode, maxelem\n",
        "Data variables: (12/37)\n",
-       "    Times               (time) object 7kB dask.array<chunksize=(1,), meta=np.ndarray>\n",
+       "    Times               (time) object 8kB dask.array<chunksize=(1,), meta=np.ndarray>\n",
        "    a1u                 (four, nele) float32 9MB dask.array<chunksize=(4, 569405), meta=np.ndarray>\n",
        "    a2u                 (four, nele) float32 9MB dask.array<chunksize=(4, 569405), meta=np.ndarray>\n",
        "    art1                (node) float32 1MB dask.array<chunksize=(303714,), meta=np.ndarray>\n",
@@ -425,7 +425,7 @@
        "    institution:                 School for Marine Science and Technology\n",
        "    references:                  http://fvcom.smast.umassd.edu, https://githu...\n",
        "    source:                      FVCOM_4.4.7\n",
-       "    title:                       NGOFS2