diff --git a/docs/notebooks/gis.ipynb b/docs/notebooks/gis.ipynb index e38d57e6..e5c37ecd 100644 --- a/docs/notebooks/gis.ipynb +++ b/docs/notebooks/gis.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -44,9 +44,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cf842a08bd53459e97fc4abac8259033", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Map(center=[48.63, -74.71], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_…" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "m = leafmap.Map(center=(48.63, -74.71), \n", " zoom=3,\n", @@ -70,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -95,7 +111,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -108,9 +124,91 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 4.15 s, sys: 574 ms, total: 4.72 s\n", + "Wall time: 4.68 s\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
HYBAS_IDUpstream Area (sq. km).geometrycategorycolor
0712003433087595.8POLYGON ((-74.37864 48.88141, -74.37452 48.886...3#41b6c4
17120398781144026.8POLYGON ((-80.07991 46.77860, -80.08529 46.782...5#081d58
2712038286023717.7POLYGON ((-73.77437 43.36757, -73.77557 43.388...1#ffffd9
\n", + "
" + ], + "text/plain": [ + " HYBAS_ID Upstream Area (sq. km). \\\n", + "0 7120034330 87595.8 \n", + "1 7120398781 144026.8 \n", + "2 7120382860 23717.7 \n", + "\n", + " geometry category color \n", + "0 POLYGON ((-74.37864 48.88141, -74.37452 48.886... 3 #41b6c4 \n", + "1 POLYGON ((-80.07991 46.77860, -80.08529 46.782... 5 #081d58 \n", + "2 POLYGON ((-73.77437 43.36757, -73.77557 43.388... 1 #ffffd9 " + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "%%time\n", "\n", @@ -121,7 +219,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -134,7 +232,88 @@ "source": [ "### c) From [xdatasets](https://github.com/hydrologie/xdatasets) (Not implemented yet)\n", "\n", - "This functionality fetches a list of basins from [xdatasets](https://github.com/hydrologie/xdatasets)' supported datasets, and upon request, [xdatasets](https://github.com/hydrologie/xdatasets) provides a `gpd.GeoDataFrame` containing the precalculated boundaries for these basins." + "This functionality fetches a list of basins from [xdatasets](https://github.com/hydrologie/xdatasets)' supported datasets, and upon request, [xdatasets](https://github.com/hydrologie/xdatasets) provides a `gpd.GeoDataFrame` containing the precalculated boundaries for these basins. The user is encouraged to use official watershed boundaries if they exist rather than creating new ones." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
StationSuperficiegeometry
0031101111.713104POLYGON ((-73.98519 45.21072, -73.98795 45.209...
1042102623.479187POLYGON ((-78.57120 46.70742, -78.57112 46.707...
2042103579.479614POLYGON ((-78.49014 46.64514, -78.49010 46.645...
\n", + "
" + ], + "text/plain": [ + " Station Superficie geometry\n", + "0 031101 111.713104 POLYGON ((-73.98519 45.21072, -73.98795 45.209...\n", + "1 042102 623.479187 POLYGON ((-78.57120 46.70742, -78.57112 46.707...\n", + "2 042103 579.479614 POLYGON ((-78.49014 46.64514, -78.49010 46.645..." + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gdf = xd.Query(\n", + " **{\n", + " \"datasets\": {\n", + " \"deh_polygons\": {\n", + " \"id\": [\"031101\",\"0421*\"],\n", + " \"regulated\": [\"Natural\"],\n", + " }\n", + " }\n", + " }\n", + ").data.reset_index()\n", + "\n", + "gdf" ] }, { @@ -153,21 +332,494 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
StationSuperficieareaperimetergraveliuscentroid
0031101111.7131041.117131e+0865169.7724781.739359(-74.14353174932663, 45.17637767020061)
1042102623.4791876.234792e+08291795.7181703.296575(-78.36569866204955, 46.47218010707938)
2042103579.4796145.794796e+08283765.0583903.325331(-78.37036445281987, 46.48287117609677)
\n", + "
" + ], + "text/plain": [ + " Station Superficie area perimeter gravelius \\\n", + "0 031101 111.713104 1.117131e+08 65169.772478 1.739359 \n", + "1 042102 623.479187 6.234792e+08 291795.718170 3.296575 \n", + "2 042103 579.479614 5.794796e+08 283765.058390 3.325331 \n", + "\n", + " centroid \n", + "0 (-74.14353174932663, 45.17637767020061) \n", + "1 (-78.36569866204955, 46.47218010707938) \n", + "2 (-78.37036445281987, 46.48287117609677) " + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "xhgis.watershed_properties(gdf)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset>\n",
+              "Dimensions:    (Station: 3)\n",
+              "Coordinates:\n",
+              "  * Station    (Station) object '031101' '042102' '042103'\n",
+              "Data variables:\n",
+              "    area       (Station) float64 1.117e+08 6.235e+08 5.795e+08\n",
+              "    perimeter  (Station) float64 6.517e+04 2.918e+05 2.838e+05\n",
+              "    gravelius  (Station) float64 1.739 3.297 3.325\n",
+              "    centroid   (Station) object (-74.14353174932663, 45.17637767020061) ... (...
" + ], + "text/plain": [ + "\n", + "Dimensions: (Station: 3)\n", + "Coordinates:\n", + " * Station (Station) object '031101' '042102' '042103'\n", + "Data variables:\n", + " area (Station) float64 1.117e+08 6.235e+08 5.795e+08\n", + " perimeter (Station) float64 6.517e+04 2.918e+05 2.838e+05\n", + " gravelius (Station) float64 1.739 3.297 3.325\n", + " centroid (Station) object (-74.14353174932663, 45.17637767020061) ... (..." + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "xhgis.watershed_properties(gdf[['HYBAS_ID', 'geometry']],\n", - " unique_id='HYBAS_ID',\n", + "xhgis.watershed_properties(gdf[['Station', 'geometry']],\n", + " unique_id='Station',\n", " output_format='xarray')" ] }, @@ -180,27 +832,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], - "source": [ - "# This will be returned by xdatasets ( c) above) eventually\n", - "bucket = Path(\"https://s3.us-east-2.wasabisys.com/watersheds-polygons/MELCC/json\")\n", - "\n", - "paths = [\n", - " bucket.joinpath(\"023003/023003.json\"),\n", - " bucket.joinpath(\"031101/031101.json\"),\n", - "]\n", - "\n", - "gdf = pd.concat([gpd.read_file(path) for path in paths]).reset_index(drop=True)\n", - "gdf" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Spatial operations: processing polygon 042103 with era5_land_reanalysis: : 3it [00:00, 4.62it/s]\n" + ] + } + ], "source": [ "datasets = {\n", " \"era5_land_reanalysis\": {\"variables\": [\"t2m\", \"tp\", \"sd\"]},\n", @@ -217,36 +859,468 @@ " \"timezone\": \"America/Montreal\",\n", "}\n", "\n", - "xds = xd.Query(datasets=datasets, \n", - " space=space, \n", - " time=time)\n", - "\n" + "ds = xd.Query(datasets=datasets, space=space, time=time).data.squeeze()" ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "# This should be what xdatasets returns so users don't have to add it manually\n", - "# We should also consider using xarray-pint to improve units conversion \n", - "\n", - "ds = xds.data.squeeze()\n", - "ds[\"Station\"].attrs[\"cf_role\"] = \"timeseries_id\"\n", - "ds['tas'] = ds.t2m - 273.15\n", - "ds[\"tas\"].attrs = {\"long_name\": \"2 metre temperature\", \"units\": \"C\", \"standard_name\": \"air_temperature\", \"cell_methods\": \"time: mean\"}\n", - "ds[\"tp\"].attrs = {\"long_name\": \"Mean daily precipitation flux\", \"units\": \"kg m-2 s-1\",\n", - " \"standard_name\": \"precipitation_flux\", \"cell_methods\": \"time: mean within days\"}\n", + "Because the next few steps use (xclim)[https://xclim.readthedocs.io/en/stable/index.html] under the hood, the dataset is required to be CF-compliant. At a minimum, the xarray.DataArray used has to follow these principles:\n", "\n", - "ds[\"sd\"].attrs = {\"long_name\": \"Snow depth\", \"units\": \"m\",\n", - " \"standard_name\": \"lwe_thickness_of_surface_snow_amount\", \"cell_methods\": \"time: mean within days\"}\n", + "- The dataset needs a time dimension.\n", + "- If there is a spatial dimension, such as Station in the example below, it needs an attribute cf_role with timeseries_id as its value.\n", + "- The variable will at the very least need a units attribute, although other attributes such as long_name and cell_methods are also expected by xclim and warnings will be generated if they are missing." + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset>\n",
+              "Dimensions:  (time: 262968, Station: 3)\n",
+              "Coordinates:\n",
+              "  * time     (time) datetime64[ns] 1981-01-01 ... 2010-12-31T23:00:00\n",
+              "  * Station  (Station) object '031101' '042102' '042103'\n",
+              "    source   <U20 'era5_land_reanalysis'\n",
+              "Data variables:\n",
+              "    t2m      (Station, time) float64 251.6 251.0 251.3 ... 275.6 275.5 275.5\n",
+              "    tp       (Station, time) float64 1.505e-08 6.174e-08 ... 3.698e-06 6.662e-07\n",
+              "    sd       (Station, time) float64 0.03733 0.03733 0.03733 ... 0.06421 0.06384\n",
+              "    tas      (Station, time) float64 -21.59 -22.17 -21.9 ... 2.455 2.389 2.339
" + ], + "text/plain": [ + "\n", + "Dimensions: (time: 262968, Station: 3)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 1981-01-01 ... 2010-12-31T23:00:00\n", + " * Station (Station) object '031101' '042102' '042103'\n", + " source \n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset>\n",
+              "Dimensions:               (Station: 3, time: 30)\n",
+              "Coordinates:\n",
+              "  * Station               (Station) object '031101' '042102' '042103'\n",
+              "    source                <U20 'era5_land_reanalysis'\n",
+              "  * time                  (time) datetime64[ns] 1981-01-01 ... 2010-01-01\n",
+              "Data variables: (12/75)\n",
+              "    tas_max_01            (Station, time) float64 6.34 4.833 ... -4.901 3.161\n",
+              "    tas_max_02            (Station, time) float64 14.46 4.733 ... 4.389 3.544\n",
+              "    tas_max_03            (Station, time) float64 16.96 14.31 ... 8.564 12.78\n",
+              "    tas_max_04            (Station, time) float64 21.76 21.52 ... 24.34 25.98\n",
+              "    tas_max_05            (Station, time) float64 26.1 29.42 ... 24.25 32.24\n",
+              "    tas_max_06            (Station, time) float64 29.13 28.11 ... 30.66 25.42\n",
+              "    ...                    ...\n",
+              "    sd_mean_10            (Station, time) float64 0.0001856 ... 0.0004031\n",
+              "    sd_mean_11            (Station, time) float64 0.002668 ... 0.007307\n",
+              "    sd_mean_12            (Station, time) float64 0.02428 0.003355 ... 0.05267\n",
+              "    sd_mean_spring        (Station, time) float64 0.003797 0.0567 ... 0.03331\n",
+              "    sd_mean_summer_fall   (Station, time) float64 0.000253 ... 0.0007276\n",
+              "    sd_mean_year          (Station, time) float64 0.008973 0.02961 ... 0.02575\n",
+              "Attributes:\n",
+              "    cat:variable:          ('tas_max_01',)\n",
+              "    cat:xrfreq:            AS-JAN\n",
+              "    cat:frequency:         yr\n",
+              "    cat:processing_level:  indicators\n",
+              "    cat:id:                
" + ], + "text/plain": [ + "\n", + "Dimensions: (Station: 3, time: 30)\n", + "Coordinates:\n", + " * Station (Station) object '031101' '042102' '042103'\n", + " source \n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Station031101042102042103
sourceera5_land_reanalysisera5_land_reanalysisera5_land_reanalysis
tas_max_016.9656023.6423213.640586
tas_max_027.0623664.0356794.044133
tas_max_0314.72713110.50825110.525447
tas_max_0422.0475620.0078819.973493
tas_max_0527.2706225.86150425.819365
tas_max_0630.19302928.8686928.824476
tas_max_0731.17271429.49831929.448428
tas_max_0830.30228.58600928.537646
tas_max_0927.86774525.76482125.724547
tas_max_1021.99548519.76113119.723571
tas_max_1116.10037811.9305411.896061
tas_max_128.9080555.3551785.333868
tas_max_spring29.83430328.43876328.397473
tas_max_summer_fall31.98969730.42872130.377644
tas_max_year32.05501930.73327530.683164
tas_mean_01-9.161036-12.571661-12.603846
tas_mean_02-7.332638-10.592516-10.618004
tas_mean_03-1.968301-5.130622-5.155519
tas_mean_045.7686623.0092242.977892
tas_mean_0512.91893910.57937610.543722
tas_mean_0618.47889115.97216415.93364
tas_mean_0721.1038218.64861918.610954
tas_mean_0820.10095517.67731317.645789
tas_mean_0915.86169713.39440813.367451
tas_mean_108.8886226.4710576.448969
tas_mean_112.655448-0.054042-0.077759
tas_mean_12-4.687524-7.745841-7.776868
tas_mean_spring5.6310362.8558262.825004
tas_mean_summer_fall15.14392412.65759312.628117
tas_mean_year6.9526254.2075344.177412
tas_min_01-26.564171-29.987345-30.041543
tas_min_02-23.371006-26.130093-26.180241
tas_min_03-18.557775-22.222626-22.264767
tas_min_04-6.264949-10.569283-10.628039
tas_min_051.3559-1.621507-1.659695
tas_min_067.4224344.1270834.091024
tas_min_0711.6697759.0337519.005369
tas_min_0810.2490878.6653548.655322
tas_min_095.1740713.4009563.395228
tas_min_10-1.209179-2.293319-2.296447
tas_min_11-7.809751-9.785807-9.818372
tas_min_12-20.882114-25.041538-25.083827
tas_min_spring-22.266255-25.01825-25.060736
tas_min_summer_fall-5.210938-7.181023-7.22109
tas_min_year-27.326234-30.971765-31.024786
tp_sum_010.0734490.0634870.063558
tp_sum_020.0646170.0515760.051602
tp_sum_030.0746490.0644060.064439
tp_sum_040.0973310.0714770.071526
tp_sum_050.0961840.0864410.086512
tp_sum_060.0981780.0890050.089063
tp_sum_070.0956030.0962860.096532
tp_sum_080.094890.0957630.096009
tp_sum_090.0936310.1000990.100346
tp_sum_100.0991990.09580.09603
tp_sum_110.1001860.0941190.094391
tp_sum_120.0858570.0728560.072926
tp_sum_spring0.3733230.3101190.31034
tp_sum_summer_fall0.4834590.4869970.488178
tp_sum_year1.0737730.9813160.982936
sd_mean_010.0383710.0787490.079101
sd_mean_020.0543520.1129210.113426
sd_mean_030.0533570.1296140.130332
sd_mean_040.011170.0586710.059455
sd_mean_050.0000380.0008540.00089
sd_mean_060.00.0000030.000003
sd_mean_07-0.0-0.0-0.0
sd_mean_08-0.0-0.0-0.0
sd_mean_090.00.0000010.000002
sd_mean_100.0001880.0008220.000826
sd_mean_110.0030370.0085660.008643
sd_mean_120.0193630.0391150.039301
sd_mean_spring0.0233240.0615470.061985
sd_mean_summer_fall0.0002440.0009190.000928
sd_mean_year0.0148160.0353930.035613
\n", + "" + ], + "text/plain": [ + "Station 031101 042102 \\\n", + "source era5_land_reanalysis era5_land_reanalysis \n", + "tas_max_01 6.965602 3.642321 \n", + "tas_max_02 7.062366 4.035679 \n", + "tas_max_03 14.727131 10.508251 \n", + "tas_max_04 22.04756 20.00788 \n", + "tas_max_05 27.27062 25.861504 \n", + "tas_max_06 30.193029 28.86869 \n", + "tas_max_07 31.172714 29.498319 \n", + "tas_max_08 30.302 28.586009 \n", + "tas_max_09 27.867745 25.764821 \n", + "tas_max_10 21.995485 19.761131 \n", + "tas_max_11 16.100378 11.93054 \n", + "tas_max_12 8.908055 5.355178 \n", + "tas_max_spring 29.834303 28.438763 \n", + "tas_max_summer_fall 31.989697 30.428721 \n", + "tas_max_year 32.055019 30.733275 \n", + "tas_mean_01 -9.161036 -12.571661 \n", + "tas_mean_02 -7.332638 -10.592516 \n", + "tas_mean_03 -1.968301 -5.130622 \n", + "tas_mean_04 5.768662 3.009224 \n", + "tas_mean_05 12.918939 10.579376 \n", + "tas_mean_06 18.478891 15.972164 \n", + "tas_mean_07 21.10382 18.648619 \n", + "tas_mean_08 20.100955 17.677313 \n", + "tas_mean_09 15.861697 13.394408 \n", + "tas_mean_10 8.888622 6.471057 \n", + "tas_mean_11 2.655448 -0.054042 \n", + "tas_mean_12 -4.687524 -7.745841 \n", + "tas_mean_spring 5.631036 2.855826 \n", + "tas_mean_summer_fall 15.143924 12.657593 \n", + "tas_mean_year 6.952625 4.207534 \n", + "tas_min_01 -26.564171 -29.987345 \n", + "tas_min_02 -23.371006 -26.130093 \n", + "tas_min_03 -18.557775 -22.222626 \n", + "tas_min_04 -6.264949 -10.569283 \n", + "tas_min_05 1.3559 -1.621507 \n", + "tas_min_06 7.422434 4.127083 \n", + "tas_min_07 11.669775 9.033751 \n", + "tas_min_08 10.249087 8.665354 \n", + "tas_min_09 5.174071 3.400956 \n", + "tas_min_10 -1.209179 -2.293319 \n", + "tas_min_11 -7.809751 -9.785807 \n", + "tas_min_12 -20.882114 -25.041538 \n", + "tas_min_spring -22.266255 -25.01825 \n", + "tas_min_summer_fall -5.210938 -7.181023 \n", + "tas_min_year -27.326234 -30.971765 \n", + "tp_sum_01 0.073449 0.063487 \n", + "tp_sum_02 0.064617 0.051576 \n", + "tp_sum_03 0.074649 0.064406 \n", + "tp_sum_04 0.097331 0.071477 \n", + "tp_sum_05 0.096184 0.086441 \n", + "tp_sum_06 0.098178 0.089005 \n", + "tp_sum_07 0.095603 0.096286 \n", + "tp_sum_08 0.09489 0.095763 \n", + "tp_sum_09 0.093631 0.100099 \n", + "tp_sum_10 0.099199 0.0958 \n", + "tp_sum_11 0.100186 0.094119 \n", + "tp_sum_12 0.085857 0.072856 \n", + "tp_sum_spring 0.373323 0.310119 \n", + "tp_sum_summer_fall 0.483459 0.486997 \n", + "tp_sum_year 1.073773 0.981316 \n", + "sd_mean_01 0.038371 0.078749 \n", + "sd_mean_02 0.054352 0.112921 \n", + "sd_mean_03 0.053357 0.129614 \n", + "sd_mean_04 0.01117 0.058671 \n", + "sd_mean_05 0.000038 0.000854 \n", + "sd_mean_06 0.0 0.000003 \n", + "sd_mean_07 -0.0 -0.0 \n", + "sd_mean_08 -0.0 -0.0 \n", + "sd_mean_09 0.0 0.000001 \n", + "sd_mean_10 0.000188 0.000822 \n", + "sd_mean_11 0.003037 0.008566 \n", + "sd_mean_12 0.019363 0.039115 \n", + "sd_mean_spring 0.023324 0.061547 \n", + "sd_mean_summer_fall 0.000244 0.000919 \n", + "sd_mean_year 0.014816 0.035393 \n", + "\n", + "Station 042103 \n", + "source era5_land_reanalysis \n", + "tas_max_01 3.640586 \n", + "tas_max_02 4.044133 \n", + "tas_max_03 10.525447 \n", + "tas_max_04 19.973493 \n", + "tas_max_05 25.819365 \n", + "tas_max_06 28.824476 \n", + "tas_max_07 29.448428 \n", + "tas_max_08 28.537646 \n", + "tas_max_09 25.724547 \n", + "tas_max_10 19.723571 \n", + "tas_max_11 11.896061 \n", + "tas_max_12 5.333868 \n", + "tas_max_spring 28.397473 \n", + "tas_max_summer_fall 30.377644 \n", + "tas_max_year 30.683164 \n", + "tas_mean_01 -12.603846 \n", + "tas_mean_02 -10.618004 \n", + "tas_mean_03 -5.155519 \n", + "tas_mean_04 2.977892 \n", + "tas_mean_05 10.543722 \n", + "tas_mean_06 15.93364 \n", + "tas_mean_07 18.610954 \n", + "tas_mean_08 17.645789 \n", + "tas_mean_09 13.367451 \n", + "tas_mean_10 6.448969 \n", + "tas_mean_11 -0.077759 \n", + "tas_mean_12 -7.776868 \n", + "tas_mean_spring 2.825004 \n", + "tas_mean_summer_fall 12.628117 \n", + "tas_mean_year 4.177412 \n", + "tas_min_01 -30.041543 \n", + "tas_min_02 -26.180241 \n", + "tas_min_03 -22.264767 \n", + "tas_min_04 -10.628039 \n", + "tas_min_05 -1.659695 \n", + "tas_min_06 4.091024 \n", + "tas_min_07 9.005369 \n", + "tas_min_08 8.655322 \n", + "tas_min_09 3.395228 \n", + "tas_min_10 -2.296447 \n", + "tas_min_11 -9.818372 \n", + "tas_min_12 -25.083827 \n", + "tas_min_spring -25.060736 \n", + "tas_min_summer_fall -7.22109 \n", + "tas_min_year -31.024786 \n", + "tp_sum_01 0.063558 \n", + "tp_sum_02 0.051602 \n", + "tp_sum_03 0.064439 \n", + "tp_sum_04 0.071526 \n", + "tp_sum_05 0.086512 \n", + "tp_sum_06 0.089063 \n", + "tp_sum_07 0.096532 \n", + "tp_sum_08 0.096009 \n", + "tp_sum_09 0.100346 \n", + "tp_sum_10 0.09603 \n", + "tp_sum_11 0.094391 \n", + "tp_sum_12 0.072926 \n", + "tp_sum_spring 0.31034 \n", + "tp_sum_summer_fall 0.488178 \n", + "tp_sum_year 0.982936 \n", + "sd_mean_01 0.079101 \n", + "sd_mean_02 0.113426 \n", + "sd_mean_03 0.130332 \n", + "sd_mean_04 0.059455 \n", + "sd_mean_05 0.00089 \n", + "sd_mean_06 0.000003 \n", + "sd_mean_07 -0.0 \n", + "sd_mean_08 -0.0 \n", + "sd_mean_09 0.000002 \n", + "sd_mean_10 0.000826 \n", + "sd_mean_11 0.008643 \n", + "sd_mean_12 0.039301 \n", + "sd_mean_spring 0.061985 \n", + "sd_mean_summer_fall 0.000928 \n", + "sd_mean_year 0.035613 " + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "pd.set_option('display.max_rows', 100)\n", "ds_climatology.mean('time').to_dataframe().T" @@ -319,6 +3954,9 @@ "pygments_lexer": "ipython3", "version": "3.11.7" }, + "nbsphinx": { + "execute": "never" + }, "vscode": { "interpreter": { "hash": "e28391989cdb8b31df72dd917935faad186df3329a743c813090fc6af977a1ca"