{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "5c810d7a-423e-454a-b766-619bc3be9811", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2022-07-20 13:54:34: oggm.cfg: Reading default parameters from the OGGM `params.cfg` configuration file.\n", "2022-07-20 13:54:34: oggm.cfg: Multiprocessing switched OFF according to the parameter file.\n", "2022-07-20 13:54:34: oggm.cfg: Multiprocessing: using all available processors (N=32)\n", "2022-07-20 13:54:34: oggm.cfg: PARAMS['continue_on_error'] changed from `False` to `True`.\n", "2022-07-20 13:54:34: oggm.cfg: Multiprocessing switched ON after user settings.\n", "2022-07-20 13:54:34: oggm.cfg: Multiprocessing: using the requested number of processors (N=2)\n", "2022-07-20 13:54:34: oggm.cfg: PARAMS['dl_verify'] changed from `True` to `False`.\n" ] } ], "source": [ "# Locals\n", "import oggm.cfg as cfg\n", "import geopandas as gpd\n", "from oggm import utils, workflow, tasks, graphics\n", "\n", "# Initialize OGGM and set up the default run parameters\n", "cfg.initialize(logging_level='WORKFLOW', future=True)\n", "rgi_version = '62'\n", "\n", "cfg.PARAMS['continue_on_error'] = True\n", "cfg.PARAMS['use_multiprocessing'] = True\n", "cfg.PARAMS['mp_processes'] = 2\n", "cfg.PARAMS['dl_verify'] = False\n", "\n", "rgi_ids = ['RGI60-16.02539']\n", "\n", "# RGI glaciers\n", "rgi_ids = gpd.read_file(utils.get_rgi_region_file('16'))" ] }, { "cell_type": "code", "execution_count": 2, "id": "96bba262-ed32-405b-b665-45c1c70105e1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2939" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(rgi_ids)" ] }, { "cell_type": "code", "execution_count": 3, "id": "d4fe57ca-aac2-42c5-b676-eea8b611ca43", "metadata": {}, "outputs": [], "source": [ "# Geometrical centerline\n", "# Where to store the data\n", "cfg.PATHS['working_dir'] = utils.mkdir('OGGM_16/', reset=True)" ] }, { "cell_type": "code", "execution_count": 4, "id": "5996c3fd-8c4e-4366-b134-4d4f4b18b42a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2022-07-20 13:54:37: oggm.workflow: init_glacier_directories from prepro level 2 on 2939 glaciers.\n", "2022-07-20 13:54:37: oggm.workflow: Execute entity tasks [gdir_from_prepro] on 2939 glaciers\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/site-packages/salem/datasets.py:171: RuntimeWarning: x0 out of bounds\n", " warnings.warn('x0 out of bounds', RuntimeWarning)\n", "Process ForkPoolWorker-3:\n", "Process ForkPoolWorker-2:\n", "Traceback (most recent call last):\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n", " self.run()\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/process.py\", line 108, in run\n", " self._target(*self._args, **self._kwargs)\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n", " task = get()\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/queues.py\", line 365, in get\n", " res = self._reader.recv_bytes()\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/connection.py\", line 221, in recv_bytes\n", " buf = self._recv_bytes(maxlength)\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/connection.py\", line 419, in _recv_bytes\n", " buf = self._recv(4)\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/process.py\", line 108, in run\n", " self._target(*self._args, **self._kwargs)\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/connection.py\", line 384, in _recv\n", " chunk = read(handle, remaining)\n", "KeyboardInterrupt\n", "Traceback (most recent call last):\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/process.py\", line 315, in _bootstrap\n", " self.run()\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/pool.py\", line 114, in worker\n", " task = get()\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/queues.py\", line 364, in get\n", " with self._rlock:\n", " File \"/home/users/fmaussion/.miniconda3/envs/oggm_env_20200608/lib/python3.9/multiprocessing/synchronize.py\", line 95, in __enter__\n", " return self._semlock.__enter__()\n", "KeyboardInterrupt\n" ] } ], "source": [ "# Go - get the pre-processed glacier directories\n", "base_url = 'https://cluster.klima.uni-bremen.de/~oggm/gdirs/oggm_v1.4/L1-L2_files/elev_bands'\n", "gdirs = workflow.init_glacier_directories(rgi_ids, from_prepro_level=2, prepro_base_url=base_url)" ] }, { "cell_type": "code", "execution_count": null, "id": "df76d788-6427-475a-8a17-7478cc6be110", "metadata": {}, "outputs": [], "source": [ "# gdirs = workflow.init_glacier_directories(rgi_ids)" ] }, { "cell_type": "code", "execution_count": 5, "id": "86b6f85d-39ef-4e1e-9ff9-a35f5c6989c1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Done\n" ] } ], "source": [ "print('Done')" ] }, { "cell_type": "code", "execution_count": 6, "id": "1c46b27e-edff-4395-9504-3121777abab0", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2022-07-20 13:56:07: oggm.workflow: Execute entity tasks [add_millan_thickness] on 2939 glaciers\n" ] } ], "source": [ "from oggm.shop.millan22 import add_millan_thickness\n", "workflow.execute_entity_task(add_millan_thickness, gdirs);" ] }, { "cell_type": "code", "execution_count": null, "id": "affae451-e30c-43b7-b27b-75c849aafdd0", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 35, "id": "66f17780-7b16-4e2b-9708-be576edf6d76", "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "import numpy as np\n", "import pandas as pd\n", "import progressbar" ] }, { "cell_type": "code", "execution_count": 33, "id": "7c16d6a5-a182-4185-96da-881d6537480b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.016" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [] }, { "cell_type": "code", "execution_count": 65, "id": "0830162f-581c-4ec7-b202-030160e90ced", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100% (2939 of 2939) |####################| Elapsed Time: 0:01:15 Time: 0:01:15\n" ] } ], "source": [ "odf = pd.DataFrame()\n", "for gdir in progressbar.progressbar(gdirs):\n", " odf.loc[gdir.rgi_id, 'rgi_area_km2'] = gdir.rgi_area_km2\n", " with xr.open_dataset(gdir.get_filepath('gridded_data')) as ds:\n", " if 'millan_ice_thickness' not in ds:\n", " odf.loc[gdir.rgi_id, 'millan_vol_km3'] = np.NaN\n", " odf.loc[gdir.rgi_id, 'millan_area_km2'] = 0\n", " odf.loc[gdir.rgi_id, 'perc_cov'] = 0\n", " continue\n", " thick = ds.millan_ice_thickness.where(ds.glacier_mask, np.NaN).load()\n", " odf.loc[gdir.rgi_id, 'millan_vol_km3'] = thick.sum() * gdir.grid.dx**2 * 1e-9\n", " odf.loc[gdir.rgi_id, 'millan_area_km2'] = (~thick.isnull()).sum() * gdir.grid.dx**2 * 1e-6\n", " odf.loc[gdir.rgi_id, 'perc_cov'] = odf.loc[gdir.rgi_id, 'millan_area_km2'] / gdir.rgi_area_km2" ] }, { "cell_type": "code", "execution_count": 39, "id": "121a9f09-4733-46ba-a596-a8e2812bff25", "metadata": {}, "outputs": [], "source": [ "odf = odf.fillna(0)" ] }, { "cell_type": "code", "execution_count": 40, "id": "b2914356-12a2-414d-97fa-117c86441a1c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "millan_vol_km3 69.063594\n", "millan_area_km2 1953.406538\n", "perc_cov 1798.739867\n", "dtype: float64" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# \t2039.8200 \t72.157018\n", "odf.sum()" ] }, { "cell_type": "markdown", "id": "ba233876-91f8-44d0-afe8-f62f979bd701", "metadata": {}, "source": [ "From the total volume we need to correct by:" ] }, { "cell_type": "code", "execution_count": 41, "id": "dd10995d-8e26-4e19-b332-b05b67605cb0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0447909502074277" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "72.157018 / 69.063594" ] }, { "cell_type": "code", "execution_count": 42, "id": "102bb071-d213-4910-8854-0f7f465fb7a8", "metadata": {}, "outputs": [], "source": [ "odf['millan_vol_km3_cor'] = odf['millan_vol_km3'] * 72.157018 / 69.063594" ] }, { "cell_type": "code", "execution_count": 43, "id": "3174ac15-4dec-419a-9de0-bf7cf4e3ec7a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "millan_vol_km3 69.063594\n", "millan_area_km2 1953.406538\n", "perc_cov 1798.739867\n", "millan_vol_km3_cor 72.157018\n", "dtype: float64" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "odf.sum()" ] }, { "cell_type": "code", "execution_count": 45, "id": "9a41cdef-dc5e-4f9c-a414-499f1e76620e", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAD4CAYAAAAdIcpQAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9t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BxwCfAdYe0edS4IMMPudxEfCJSdc94vF+P3B6t/yCpTzevmMe6vf3wAeAn5h03WP4PZ8G3Aac262fNem6xzDm1wK/2y2vAP4DeMykaz+BMf8QcAHw+aM8v+jvXbN8ZNFnCpH1wHU1cBNwWpKV4y50kTTHW1X/WFVf7VZvYvB5lqWs7zQxvwz8JXBgnMWNSJ8x/yTw3qraC1BVS33cfcZcwBOSBHg8g7A4NN4yF09VfYzBGI5m0d+7Zjks5ptCZNUC+iwVxzuWKxj8Z7KUNcecZBXwEuCNY6xrlPr8nr8HOD3JR5LcnOTlY6tuNPqM+Y+ApzD4MO/ngFdX1TfHU95ELPp715L4nMWI9JlCpNc0I0tE77EkeS6DsPiBkVY0en3G/HrgNVV1ePBP55LXZ8zLgWcCFwMnA/+U5Kaq+pdRFzcifcb8fOAW4HnAdwM3Jvl4Vd034tomZdHfu2Y5LPpMIfJImmak11iSPA14E/CCqvrKmGoblT5jXgdc3wXFmcClSQ5V1fvGUuHi6/t3/eWquh+4P8nHgKcDSzUs+oz5FcA1NTihvyfJncCTgV3jKXHsFv29a5ZPQ/WZQmQH8PLuzoKLgP+qqv3jLnSRNMeb5FzgvcDPLOH/Moc1x1xV51XVXFXNAe8BfnEJBwX0+7u+AfjBJMuTnMJgBufbx1znYuoz5r0MjqRIcjbwJOCLY61yvBb9vWtmjyzqKFOIJPn57vk3Mrg75lJgD/A/DP47WZJ6jve3gG8Hru3+0z5US3jGzp5jfkTpM+aquj3J3wKfBb4JvKmq5r0Fcyno+Xv+HeAtST7H4BTNa6pqyU5dnuSdwHOAM5PsA64GHg2je+9yug9JUtMsn4aSJPVkWEiSmgwLSVKTYSFJajIsJElNhoUkqcmwkCQ1/S9Y/Vrv1I85gQAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "8546f7bb-a401-4c40-a93a-6ccb08a3ee0a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 46, "id": "4f337452-0689-42f4-a124-7599f4230c73", "metadata": {}, "outputs": [], "source": [ "fdf = pd.read_hdf('/home/www/oggm/g2ti/rgi62_era5_itmix_df.h5')\n", "fdf['rgi_reg'] = [s.split('-')[1].split('.')[0] for s in fdf.index]" ] }, { "cell_type": "code", "execution_count": 48, "id": "7e2bcf90-a33f-4d1d-be49-ccf076ccf364", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
CenLonCenLatera5_avg_pcpAreaera5_avg_temp_at_zmedZmedvol_bsl_itmix_m3vol_itmix_m3era5_trendrgi_reg
RGIId
RGI60-01.00001-146.823063.6890763.1293120.360-12.13072923850.000007.638771e+060.14438301
RGI60-01.00002-146.668063.4040801.4642390.558-10.55040220050.000001.697646e+070.15957001
RGI60-01.00003-146.080063.3760823.3469291.685-9.56704918680.000005.969346e+070.13394301
RGI60-01.00004-146.120063.3810823.3469293.681-10.06104919440.000001.952248e+080.13394301
RGI60-01.00005-147.057063.5510871.8608502.573-9.36584919140.000001.221541e+080.17051301
.................................
RGI60-19.02748-37.7325-53.98601121.4661840.0428.030344-9990.000005.502906e+050.08666019
RGI60-19.02749-36.1361-54.83101505.1466300.5677.204056-9990.000001.300672e+070.12957119
RGI60-19.02750-37.3018-54.18841264.3780204.1187.943137-999359846.649172.506893e+080.10541119
RGI60-19.02751-90.4266-68.8656667.0998590.0111.584250-9990.000001.068206e+05-0.09588419
RGI60-19.0275237.7140-46.89721205.9848000.52812.359629-9990.000001.489316e+070.00686919
\n", "

216502 rows × 10 columns

\n", "
" ], "text/plain": [ " CenLon CenLat era5_avg_pcp Area era5_avg_temp_at_zmed \\\n", "RGIId \n", "RGI60-01.00001 -146.8230 63.6890 763.129312 0.360 -12.130729 \n", "RGI60-01.00002 -146.6680 63.4040 801.464239 0.558 -10.550402 \n", "RGI60-01.00003 -146.0800 63.3760 823.346929 1.685 -9.567049 \n", "RGI60-01.00004 -146.1200 63.3810 823.346929 3.681 -10.061049 \n", "RGI60-01.00005 -147.0570 63.5510 871.860850 2.573 -9.365849 \n", "... ... ... ... ... ... \n", "RGI60-19.02748 -37.7325 -53.9860 1121.466184 0.042 8.030344 \n", "RGI60-19.02749 -36.1361 -54.8310 1505.146630 0.567 7.204056 \n", "RGI60-19.02750 -37.3018 -54.1884 1264.378020 4.118 7.943137 \n", "RGI60-19.02751 -90.4266 -68.8656 667.099859 0.011 1.584250 \n", "RGI60-19.02752 37.7140 -46.8972 1205.984800 0.528 12.359629 \n", "\n", " Zmed vol_bsl_itmix_m3 vol_itmix_m3 era5_trend rgi_reg \n", "RGIId \n", "RGI60-01.00001 2385 0.00000 7.638771e+06 0.144383 01 \n", "RGI60-01.00002 2005 0.00000 1.697646e+07 0.159570 01 \n", "RGI60-01.00003 1868 0.00000 5.969346e+07 0.133943 01 \n", "RGI60-01.00004 1944 0.00000 1.952248e+08 0.133943 01 \n", "RGI60-01.00005 1914 0.00000 1.221541e+08 0.170513 01 \n", "... ... ... ... ... ... \n", "RGI60-19.02748 -999 0.00000 5.502906e+05 0.086660 19 \n", "RGI60-19.02749 -999 0.00000 1.300672e+07 0.129571 19 \n", "RGI60-19.02750 -999 359846.64917 2.506893e+08 0.105411 19 \n", "RGI60-19.02751 -999 0.00000 1.068206e+05 -0.095884 19 \n", "RGI60-19.02752 -999 0.00000 1.489316e+07 0.006869 19 \n", "\n", "[216502 rows x 10 columns]" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fdf" ] }, { "cell_type": "code", "execution_count": 49, "id": "f0bda5a7-213f-4054-87d6-719a42d99873", "metadata": {}, "outputs": [], "source": [ "odf['f19_vol_km3'] = fdf['vol_itmix_m3'] * 1e-9" ] }, { "cell_type": "code", "execution_count": 55, "id": "d3622bfb-4bfb-4f46-90ca-4c71bf74203c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "millan_vol_km3 69.063594\n", "millan_area_km2 1953.406538\n", "perc_cov 1798.739867\n", "millan_vol_km3_cor 72.157018\n", "f19_vol_km3 98.363146\n", "dtype: float64" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ss = odf.sum()\n", "ss" ] }, { "cell_type": "code", "execution_count": 58, "id": "0f73acb0-b477-4446-a3bc-50e334dbbc1f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-0.266422224584831" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ss['millan_vol_km3_cor'] / ss['f19_vol_km3'] - 1" ] }, { "cell_type": "code", "execution_count": 62, "id": "84f7a1d5-bbf5-41e1-a3c3-b3434b325334", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "millan_vol_km3 68.481680\n", "millan_area_km2 1901.407432\n", "perc_cov 1397.817642\n", "millan_vol_km3_cor 71.549039\n", "f19_vol_km3 85.721461\n", "dtype: float64" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ss = odf.loc[odf.perc_cov > 0.8].sum()\n", "ss" ] }, { "cell_type": "code", "execution_count": 60, "id": "5888fb4d-cd75-43ec-8a6f-f7dac82a8093", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-0.16533107815653092" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ss['millan_vol_km3_cor'] / ss['f19_vol_km3'] - 1" ] }, { "cell_type": "code", "execution_count": 61, "id": "c6277c8d-89cb-49bd-bf3e-87a345631ad1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-0.15815383449422526" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ss = odf.loc[odf.perc_cov > 0.9].sum()\n", "ss['millan_vol_km3_cor'] / ss['f19_vol_km3'] - 1" ] }, { "cell_type": "code", "execution_count": 63, "id": "93235b80-52c0-4d71-a99f-63ec496dbade", "metadata": {}, "outputs": [], "source": [ "sel = odf.loc[odf.perc_cov > 0.8]" ] }, { "cell_type": "code", "execution_count": 64, "id": "4e48d9c0-f1bf-4ebf-ad3a-cadfe229da33", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
millan_vol_km3millan_area_km2perc_covmillan_vol_km3_corf19_vol_km3
RGI60-16.002160.0910132.8657240.9482870.0950900.106108
RGI60-16.002180.0394861.9278000.9815680.0412550.050802
RGI60-16.002190.0015780.2002770.8901200.0016490.005468
RGI60-16.002210.0029820.2436270.8891500.0031160.005050
RGI60-16.002220.0070420.4504000.9706900.0073580.015978
..................
RGI60-16.028840.0021330.3230950.8348710.0022280.010547
RGI60-16.029420.0432711.4935200.9549360.0452090.056698
RGI60-16.029430.0062160.2447831.0073370.0064940.005517
RGI60-16.029440.3292368.9916090.9630080.3439830.528070
RGI60-16.029450.0609022.4698880.9777860.0636300.100562
\n", "

1509 rows × 5 columns

\n", "
" ], "text/plain": [ " millan_vol_km3 millan_area_km2 perc_cov millan_vol_km3_cor \\\n", "RGI60-16.00216 0.091013 2.865724 0.948287 0.095090 \n", "RGI60-16.00218 0.039486 1.927800 0.981568 0.041255 \n", "RGI60-16.00219 0.001578 0.200277 0.890120 0.001649 \n", "RGI60-16.00221 0.002982 0.243627 0.889150 0.003116 \n", "RGI60-16.00222 0.007042 0.450400 0.970690 0.007358 \n", "... ... ... ... ... \n", "RGI60-16.02884 0.002133 0.323095 0.834871 0.002228 \n", "RGI60-16.02942 0.043271 1.493520 0.954936 0.045209 \n", "RGI60-16.02943 0.006216 0.244783 1.007337 0.006494 \n", "RGI60-16.02944 0.329236 8.991609 0.963008 0.343983 \n", "RGI60-16.02945 0.060902 2.469888 0.977786 0.063630 \n", "\n", " f19_vol_km3 \n", "RGI60-16.00216 0.106108 \n", "RGI60-16.00218 0.050802 \n", "RGI60-16.00219 0.005468 \n", "RGI60-16.00221 0.005050 \n", "RGI60-16.00222 0.015978 \n", "... ... \n", "RGI60-16.02884 0.010547 \n", "RGI60-16.02942 0.056698 \n", "RGI60-16.02943 0.005517 \n", "RGI60-16.02944 0.528070 \n", "RGI60-16.02945 0.100562 \n", "\n", "[1509 rows x 5 columns]" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sel.plot.scatter(x='f19_vol_km3')" ] }, { "cell_type": "code", "execution_count": null, "id": "79ecef4e-73e4-44d8-9ade-a932183ac496", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }