From 9d10e30786856acd8d85b69bc607d45fc5a71390 Mon Sep 17 00:00:00 2001 From: Edward Byers Date: Sat, 11 Nov 2023 00:50:06 +0100 Subject: [PATCH] fixes to map_transform functions and plot_dashboard --- rime/Untitled.ipynb | 1313 ---------------------------------------- rime/process_config.py | 4 +- rime/process_maps.py | 58 +- rime/rime_functions.py | 160 ++--- rime/test_map.html | 71 --- 5 files changed, 126 insertions(+), 1480 deletions(-) delete mode 100644 rime/Untitled.ipynb delete mode 100644 rime/test_map.html diff --git a/rime/Untitled.ipynb b/rime/Untitled.ipynb deleted file mode 100644 index 2f8a6a2..0000000 --- a/rime/Untitled.ipynb +++ /dev/null @@ -1,1313 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "cb10c199-e9bf-4846-bf38-fd943a13f611", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\byers\\Anaconda3\\envs\\py310\\lib\\site-packages\\pyproj\\__init__.py:89: UserWarning: pyproj unable to set database path.\n", - " _pyproj_global_context_initialize()\n" - ] - }, - { - "data": { - "application/javascript": [ - "if (typeof IPython !== 'undefined') { IPython.OutputArea.prototype._should_scroll = function(lines){ return false; }}" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "import pyam" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "f694b80e-6fb1-4efe-b107-8d52fdb6dc09", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "pyam.core - INFO: Reading file C:\\Users\\byers\\IIASA\\ECE.prog - Documents\\Research Theme - NEXUS\\Hotspots_Explorer_2p0\\rcre_testing\\testing_2\\emissions_temp_AR6_small.xlsx\n", - "pyam.core - INFO: Found column 'exclude' in sheet 'meta', moved to attribute `IamDataFrame.exclude`.\n" - ] - } - ], - "source": [ - "df = pyam.IamDataFrame('C:\\\\Users\\\\byers\\\\IIASA\\\\ECE.prog - Documents\\\\Research Theme - NEXUS\\\\Hotspots_Explorer_2p0\\\\rcre_testing\\\\testing_2\\\\emissions_temp_AR6_small.xlsx')" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "959b3cdb-0c91-4b78-8cce-70e43a83f10e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "\n", - "Index:\n", - " * model : AIM/CGE 2.0, AIM/CGE 2.1, AIM/CGE 2.2, ... WITCH-GLOBIOM 4.4 (44)\n", - " * scenario : 1.5C, 2.5C, 2C, 2CNow_Gradual, ... WB2C (559)\n", - "Timeseries data coordinates:\n", - " region : World (1)\n", - " variable : AR6 climate diagnostics|Infilled|Emissions|CO2, ... (3)\n", - " unit : K, Mt CO2/yr (2)\n", - " year : 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, ... 2100 (86)\n", - "Meta indicators:\n", - " Category (object) C3, C5, C6, C7, C4, C1, C2, C8 (8)\n", - " Category_name (object) C3: limit warming to 2°C (>67%), ... (8)\n", - " Category_subset (object) C3y_+veGHGs, C5, C6, C7, C4, C1a_NZGHGs, ... C8 (10)\n", - " Subset_Ch4 (object) Limit to 2C (>67%) immediate 2020 action, ... (6)\n", - " Category_Vetting_historical (object) C3, C5, C6, C7, C4, C1, C2, C8 (8)\n", - " ..." - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "0533c3bd-2689-4d9d-a2d8-754aac00ee52", - "metadata": {}, - "outputs": [], - "source": [ - "dft = df.timeseries(iamc_index=False)\n", - "dft.join(" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "744f336d-d924-4a80-8f56-1d8cf8ae416c", - "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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
2015201620172018201920202021202220232024...209220932094209520962097209820992100Ssp_family
modelscenario
AIM/CGE 2.0SSP1-2639152.72630038814.58550038476.50914438138.49723337800.54976737462.66674636683.89231135905.86547935128.58624934352.054622...-138.597038-188.421413-238.245789-288.070164-337.894539-387.718914-437.543289-487.367665-537.1920401.0
SSP1-261.1156981.1350781.1553811.1767371.2001061.2252771.2564031.2921581.3247281.353267...1.6369291.6378521.6350121.6319041.6251391.6177981.6135841.6117861.6095741.0
SSP1-26NaNNaNNaNNaNNaN37181.33850036442.25551035703.17252034964.08953034225.006540...505.121540444.198560383.275580322.352600261.429620200.506640139.58366078.66068017.7377001.0
SSP1-3439152.72630038814.58550038476.50914438138.49723337800.54976737462.66674637246.80758337030.95746136815.11638036599.284340...9869.5919429696.2494579522.9069719349.5644869176.2220019002.8795168829.5370318656.1945458482.8520601.0
SSP1-341.1156981.1350781.1554031.1768341.2002721.2252681.2556911.2911991.3224281.352320...2.0850472.0886222.0890802.0890552.0889862.0887092.0864822.0874862.0902441.0
.....................................................................
WITCH-GLOBIOM 4.4CD-LINKS_NPi2020_4001.1154941.1308551.1492481.1662581.1864031.2108101.2450771.2820831.3170861.344960...1.0838681.0781641.0689211.0574991.0492961.0392941.0310901.0244441.0182602.0
CD-LINKS_NPi2020_40037811.00745538380.11127238949.21508939518.31890640087.42272340656.52654037575.64347034494.76039931413.87732828332.994258...-14623.033715-14573.025928-14523.018140-14473.010353-14423.002565-14372.994777-14322.986990-14272.979202-14222.9714152.0
CD-LINKS_NoPolicy39152.72630040112.72729041072.22146142031.20881442989.68934743947.66306144954.23450945960.29268346965.83758447970.869211...83737.81993083361.66693282985.51393582609.36093782233.20794081857.05494281480.90194481104.74894780728.5959492.0
CD-LINKS_NoPolicy1.1154851.1315151.1502051.1684731.1904671.2126121.2391861.2690671.2989151.327518...3.7086403.7485623.7856193.8194063.8485183.8803853.9154873.9530173.9913282.0
CD-LINKS_NoPolicy37866.23507038824.19625939782.15744940740.11863841698.07982742656.04101643662.91634744669.79167745676.66700846683.542338...83435.47839083064.53817782693.59796582322.65775281951.71754081580.77732881209.83711580838.89690380467.9566902.0
\n", - "

3606 rows × 87 columns

\n", - "
" - ], - "text/plain": [ - " 2015 2016 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 39152.726300 38814.585500 \n", - " SSP1-26 1.115698 1.135078 \n", - " SSP1-26 NaN NaN \n", - " SSP1-34 39152.726300 38814.585500 \n", - " SSP1-34 1.115698 1.135078 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.115494 1.130855 \n", - " CD-LINKS_NPi2020_400 37811.007455 38380.111272 \n", - " CD-LINKS_NoPolicy 39152.726300 40112.727290 \n", - " CD-LINKS_NoPolicy 1.115485 1.131515 \n", - " CD-LINKS_NoPolicy 37866.235070 38824.196259 \n", - "\n", - " 2017 2018 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 38476.509144 38138.497233 \n", - " SSP1-26 1.155381 1.176737 \n", - " SSP1-26 NaN NaN \n", - " SSP1-34 38476.509144 38138.497233 \n", - " SSP1-34 1.155403 1.176834 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.149248 1.166258 \n", - " CD-LINKS_NPi2020_400 38949.215089 39518.318906 \n", - " CD-LINKS_NoPolicy 41072.221461 42031.208814 \n", - " CD-LINKS_NoPolicy 1.150205 1.168473 \n", - " CD-LINKS_NoPolicy 39782.157449 40740.118638 \n", - "\n", - " 2019 2020 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 37800.549767 37462.666746 \n", - " SSP1-26 1.200106 1.225277 \n", - " SSP1-26 NaN 37181.338500 \n", - " SSP1-34 37800.549767 37462.666746 \n", - " SSP1-34 1.200272 1.225268 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.186403 1.210810 \n", - " CD-LINKS_NPi2020_400 40087.422723 40656.526540 \n", - " CD-LINKS_NoPolicy 42989.689347 43947.663061 \n", - " CD-LINKS_NoPolicy 1.190467 1.212612 \n", - " CD-LINKS_NoPolicy 41698.079827 42656.041016 \n", - "\n", - " 2021 2022 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 36683.892311 35905.865479 \n", - " SSP1-26 1.256403 1.292158 \n", - " SSP1-26 36442.255510 35703.172520 \n", - " SSP1-34 37246.807583 37030.957461 \n", - " SSP1-34 1.255691 1.291199 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.245077 1.282083 \n", - " CD-LINKS_NPi2020_400 37575.643470 34494.760399 \n", - " CD-LINKS_NoPolicy 44954.234509 45960.292683 \n", - " CD-LINKS_NoPolicy 1.239186 1.269067 \n", - " CD-LINKS_NoPolicy 43662.916347 44669.791677 \n", - "\n", - " 2023 2024 ... \\\n", - "model scenario ... \n", - "AIM/CGE 2.0 SSP1-26 35128.586249 34352.054622 ... \n", - " SSP1-26 1.324728 1.353267 ... \n", - " SSP1-26 34964.089530 34225.006540 ... \n", - " SSP1-34 36815.116380 36599.284340 ... \n", - " SSP1-34 1.322428 1.352320 ... \n", - "... ... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.317086 1.344960 ... \n", - " CD-LINKS_NPi2020_400 31413.877328 28332.994258 ... \n", - " CD-LINKS_NoPolicy 46965.837584 47970.869211 ... \n", - " CD-LINKS_NoPolicy 1.298915 1.327518 ... \n", - " CD-LINKS_NoPolicy 45676.667008 46683.542338 ... \n", - "\n", - " 2092 2093 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 -138.597038 -188.421413 \n", - " SSP1-26 1.636929 1.637852 \n", - " SSP1-26 505.121540 444.198560 \n", - " SSP1-34 9869.591942 9696.249457 \n", - " SSP1-34 2.085047 2.088622 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.083868 1.078164 \n", - " CD-LINKS_NPi2020_400 -14623.033715 -14573.025928 \n", - " CD-LINKS_NoPolicy 83737.819930 83361.666932 \n", - " CD-LINKS_NoPolicy 3.708640 3.748562 \n", - " CD-LINKS_NoPolicy 83435.478390 83064.538177 \n", - "\n", - " 2094 2095 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 -238.245789 -288.070164 \n", - " SSP1-26 1.635012 1.631904 \n", - " SSP1-26 383.275580 322.352600 \n", - " SSP1-34 9522.906971 9349.564486 \n", - " SSP1-34 2.089080 2.089055 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.068921 1.057499 \n", - " CD-LINKS_NPi2020_400 -14523.018140 -14473.010353 \n", - " CD-LINKS_NoPolicy 82985.513935 82609.360937 \n", - " CD-LINKS_NoPolicy 3.785619 3.819406 \n", - " CD-LINKS_NoPolicy 82693.597965 82322.657752 \n", - "\n", - " 2096 2097 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 -337.894539 -387.718914 \n", - " SSP1-26 1.625139 1.617798 \n", - " SSP1-26 261.429620 200.506640 \n", - " SSP1-34 9176.222001 9002.879516 \n", - " SSP1-34 2.088986 2.088709 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.049296 1.039294 \n", - " CD-LINKS_NPi2020_400 -14423.002565 -14372.994777 \n", - " CD-LINKS_NoPolicy 82233.207940 81857.054942 \n", - " CD-LINKS_NoPolicy 3.848518 3.880385 \n", - " CD-LINKS_NoPolicy 81951.717540 81580.777328 \n", - "\n", - " 2098 2099 \\\n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 -437.543289 -487.367665 \n", - " SSP1-26 1.613584 1.611786 \n", - " SSP1-26 139.583660 78.660680 \n", - " SSP1-34 8829.537031 8656.194545 \n", - " SSP1-34 2.086482 2.087486 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.031090 1.024444 \n", - " CD-LINKS_NPi2020_400 -14322.986990 -14272.979202 \n", - " CD-LINKS_NoPolicy 81480.901944 81104.748947 \n", - " CD-LINKS_NoPolicy 3.915487 3.953017 \n", - " CD-LINKS_NoPolicy 81209.837115 80838.896903 \n", - "\n", - " 2100 Ssp_family \n", - "model scenario \n", - "AIM/CGE 2.0 SSP1-26 -537.192040 1.0 \n", - " SSP1-26 1.609574 1.0 \n", - " SSP1-26 17.737700 1.0 \n", - " SSP1-34 8482.852060 1.0 \n", - " SSP1-34 2.090244 1.0 \n", - "... ... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 1.018260 2.0 \n", - " CD-LINKS_NPi2020_400 -14222.971415 2.0 \n", - " CD-LINKS_NoPolicy 80728.595949 2.0 \n", - " CD-LINKS_NoPolicy 3.991328 2.0 \n", - " CD-LINKS_NoPolicy 80467.956690 2.0 \n", - "\n", - "[3606 rows x 87 columns]" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "dft.merge(df.meta['Ssp_family'], left_on=['model','scenario'], right_on=['model','scenario'])" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "8be13116-01bf-4450-9445-fcd907ae42ed", - "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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
2015201620172018201920202021202220232024...209220932094209520962097209820992100Ssp_family
modelscenarioregionvariableunit
AIM/CGE 2.0SSP1-26WorldAR6 climate diagnostics|Infilled|Emissions|CO2Mt CO2/yr39152.72630038814.58550038476.50914438138.49723337800.54976737462.66674636683.89231135905.86547935128.58624934352.054622...-138.597038-188.421413-238.245789-288.070164-337.894539-387.718914-437.543289-487.367665-537.1920401.0
AR6 climate diagnostics|Surface Temperature (GSAT)|MAGICCv7.5.3|50.0th PercentileK1.1156981.1350781.1553811.1767371.2001061.2252771.2564031.2921581.3247281.353267...1.6369291.6378521.6350121.6319041.6251391.6177981.6135841.6117861.6095741.0
Emissions|CO2Mt CO2/yrNaNNaNNaNNaNNaN37181.33850036442.25551035703.17252034964.08953034225.006540...505.121540444.198560383.275580322.352600261.429620200.506640139.58366078.66068017.7377001.0
SSP1-34WorldAR6 climate diagnostics|Infilled|Emissions|CO2Mt CO2/yr39152.72630038814.58550038476.50914438138.49723337800.54976737462.66674637246.80758337030.95746136815.11638036599.284340...9869.5919429696.2494579522.9069719349.5644869176.2220019002.8795168829.5370318656.1945458482.8520601.0
AR6 climate diagnostics|Surface Temperature (GSAT)|MAGICCv7.5.3|50.0th PercentileK1.1156981.1350781.1554031.1768341.2002721.2252681.2556911.2911991.3224281.352320...2.0850472.0886222.0890802.0890552.0889862.0887092.0864822.0874862.0902441.0
..............................................................................
WITCH-GLOBIOM 4.4CD-LINKS_NPi2020_400WorldAR6 climate diagnostics|Surface Temperature (GSAT)|MAGICCv7.5.3|50.0th PercentileK1.1154941.1308551.1492481.1662581.1864031.2108101.2450771.2820831.3170861.344960...1.0838681.0781641.0689211.0574991.0492961.0392941.0310901.0244441.0182602.0
Emissions|CO2Mt CO2/yr37811.00745538380.11127238949.21508939518.31890640087.42272340656.52654037575.64347034494.76039931413.87732828332.994258...-14623.033715-14573.025928-14523.018140-14473.010353-14423.002565-14372.994777-14322.986990-14272.979202-14222.9714152.0
CD-LINKS_NoPolicyWorldAR6 climate diagnostics|Infilled|Emissions|CO2Mt CO2/yr39152.72630040112.72729041072.22146142031.20881442989.68934743947.66306144954.23450945960.29268346965.83758447970.869211...83737.81993083361.66693282985.51393582609.36093782233.20794081857.05494281480.90194481104.74894780728.5959492.0
AR6 climate diagnostics|Surface Temperature (GSAT)|MAGICCv7.5.3|50.0th PercentileK1.1154851.1315151.1502051.1684731.1904671.2126121.2391861.2690671.2989151.327518...3.7086403.7485623.7856193.8194063.8485183.8803853.9154873.9530173.9913282.0
Emissions|CO2Mt CO2/yr37866.23507038824.19625939782.15744940740.11863841698.07982742656.04101643662.91634744669.79167745676.66700846683.542338...83435.47839083064.53817782693.59796582322.65775281951.71754081580.77732881209.83711580838.89690380467.9566902.0
\n", - "

3606 rows × 87 columns

\n", - "
" - ], - "text/plain": [ - " 2015 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 39152.726300 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.115698 \n", - " Emissions|CO2 Mt CO2/yr NaN \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 39152.726300 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.115698 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.115494 \n", - " Emissions|CO2 Mt CO2/yr 37811.007455 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 39152.726300 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.115485 \n", - " Emissions|CO2 Mt CO2/yr 37866.235070 \n", - "\n", - " 2016 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 38814.585500 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.135078 \n", - " Emissions|CO2 Mt CO2/yr NaN \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 38814.585500 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.135078 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.130855 \n", - " Emissions|CO2 Mt CO2/yr 38380.111272 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 40112.727290 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.131515 \n", - " Emissions|CO2 Mt CO2/yr 38824.196259 \n", - "\n", - " 2017 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 38476.509144 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.155381 \n", - " Emissions|CO2 Mt CO2/yr NaN \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 38476.509144 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.155403 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.149248 \n", - " Emissions|CO2 Mt CO2/yr 38949.215089 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 41072.221461 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.150205 \n", - " Emissions|CO2 Mt CO2/yr 39782.157449 \n", - "\n", - " 2018 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 38138.497233 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.176737 \n", - " Emissions|CO2 Mt CO2/yr NaN \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 38138.497233 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.176834 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.166258 \n", - " Emissions|CO2 Mt CO2/yr 39518.318906 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 42031.208814 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.168473 \n", - " Emissions|CO2 Mt CO2/yr 40740.118638 \n", - "\n", - " 2019 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 37800.549767 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.200106 \n", - " Emissions|CO2 Mt CO2/yr NaN \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 37800.549767 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.200272 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.186403 \n", - " Emissions|CO2 Mt CO2/yr 40087.422723 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 42989.689347 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.190467 \n", - " Emissions|CO2 Mt CO2/yr 41698.079827 \n", - "\n", - " 2020 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 37462.666746 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.225277 \n", - " Emissions|CO2 Mt CO2/yr 37181.338500 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 37462.666746 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.225268 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.210810 \n", - " Emissions|CO2 Mt CO2/yr 40656.526540 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 43947.663061 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.212612 \n", - " Emissions|CO2 Mt CO2/yr 42656.041016 \n", - "\n", - " 2021 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 36683.892311 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.256403 \n", - " Emissions|CO2 Mt CO2/yr 36442.255510 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 37246.807583 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.255691 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.245077 \n", - " Emissions|CO2 Mt CO2/yr 37575.643470 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 44954.234509 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.239186 \n", - " Emissions|CO2 Mt CO2/yr 43662.916347 \n", - "\n", - " 2022 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 35905.865479 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.292158 \n", - " Emissions|CO2 Mt CO2/yr 35703.172520 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 37030.957461 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.291199 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.282083 \n", - " Emissions|CO2 Mt CO2/yr 34494.760399 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 45960.292683 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.269067 \n", - " Emissions|CO2 Mt CO2/yr 44669.791677 \n", - "\n", - " 2023 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 35128.586249 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.324728 \n", - " Emissions|CO2 Mt CO2/yr 34964.089530 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 36815.116380 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.322428 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.317086 \n", - " Emissions|CO2 Mt CO2/yr 31413.877328 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 46965.837584 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.298915 \n", - " Emissions|CO2 Mt CO2/yr 45676.667008 \n", - "\n", - " 2024 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 34352.054622 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.353267 \n", - " Emissions|CO2 Mt CO2/yr 34225.006540 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 36599.284340 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.352320 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.344960 \n", - " Emissions|CO2 Mt CO2/yr 28332.994258 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 47970.869211 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.327518 \n", - " Emissions|CO2 Mt CO2/yr 46683.542338 \n", - "\n", - " ... \\\n", - "model scenario region variable unit ... \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr ... \n", - " AR6 climate diagnostics|Surface Temperature (GS... K ... \n", - " Emissions|CO2 Mt CO2/yr ... \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr ... \n", - " AR6 climate diagnostics|Surface Temperature (GS... K ... \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K ... \n", - " Emissions|CO2 Mt CO2/yr ... \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr ... \n", - " AR6 climate diagnostics|Surface Temperature (GS... K ... \n", - " Emissions|CO2 Mt CO2/yr ... \n", - "\n", - " 2092 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -138.597038 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.636929 \n", - " Emissions|CO2 Mt CO2/yr 505.121540 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 9869.591942 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.085047 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.083868 \n", - " Emissions|CO2 Mt CO2/yr -14623.033715 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 83737.819930 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.708640 \n", - " Emissions|CO2 Mt CO2/yr 83435.478390 \n", - "\n", - " 2093 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -188.421413 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.637852 \n", - " Emissions|CO2 Mt CO2/yr 444.198560 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 9696.249457 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.088622 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.078164 \n", - " Emissions|CO2 Mt CO2/yr -14573.025928 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 83361.666932 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.748562 \n", - " Emissions|CO2 Mt CO2/yr 83064.538177 \n", - "\n", - " 2094 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -238.245789 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.635012 \n", - " Emissions|CO2 Mt CO2/yr 383.275580 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 9522.906971 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.089080 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.068921 \n", - " Emissions|CO2 Mt CO2/yr -14523.018140 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 82985.513935 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.785619 \n", - " Emissions|CO2 Mt CO2/yr 82693.597965 \n", - "\n", - " 2095 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -288.070164 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.631904 \n", - " Emissions|CO2 Mt CO2/yr 322.352600 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 9349.564486 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.089055 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.057499 \n", - " Emissions|CO2 Mt CO2/yr -14473.010353 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 82609.360937 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.819406 \n", - " Emissions|CO2 Mt CO2/yr 82322.657752 \n", - "\n", - " 2096 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -337.894539 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.625139 \n", - " Emissions|CO2 Mt CO2/yr 261.429620 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 9176.222001 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.088986 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.049296 \n", - " Emissions|CO2 Mt CO2/yr -14423.002565 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 82233.207940 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.848518 \n", - " Emissions|CO2 Mt CO2/yr 81951.717540 \n", - "\n", - " 2097 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -387.718914 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.617798 \n", - " Emissions|CO2 Mt CO2/yr 200.506640 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 9002.879516 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.088709 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.039294 \n", - " Emissions|CO2 Mt CO2/yr -14372.994777 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 81857.054942 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.880385 \n", - " Emissions|CO2 Mt CO2/yr 81580.777328 \n", - "\n", - " 2098 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -437.543289 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.613584 \n", - " Emissions|CO2 Mt CO2/yr 139.583660 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 8829.537031 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.086482 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.031090 \n", - " Emissions|CO2 Mt CO2/yr -14322.986990 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 81480.901944 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.915487 \n", - " Emissions|CO2 Mt CO2/yr 81209.837115 \n", - "\n", - " 2099 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -487.367665 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.611786 \n", - " Emissions|CO2 Mt CO2/yr 78.660680 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 8656.194545 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.087486 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.024444 \n", - " Emissions|CO2 Mt CO2/yr -14272.979202 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 81104.748947 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.953017 \n", - " Emissions|CO2 Mt CO2/yr 80838.896903 \n", - "\n", - " 2100 \\\n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr -537.192040 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.609574 \n", - " Emissions|CO2 Mt CO2/yr 17.737700 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 8482.852060 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.090244 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 1.018260 \n", - " Emissions|CO2 Mt CO2/yr -14222.971415 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 80728.595949 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 3.991328 \n", - " Emissions|CO2 Mt CO2/yr 80467.956690 \n", - "\n", - " Ssp_family \n", - "model scenario region variable unit \n", - "AIM/CGE 2.0 SSP1-26 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 1.0 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.0 \n", - " Emissions|CO2 Mt CO2/yr 1.0 \n", - " SSP1-34 World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 1.0 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 1.0 \n", - "... ... \n", - "WITCH-GLOBIOM 4.4 CD-LINKS_NPi2020_400 World AR6 climate diagnostics|Surface Temperature (GS... K 2.0 \n", - " Emissions|CO2 Mt CO2/yr 2.0 \n", - " CD-LINKS_NoPolicy World AR6 climate diagnostics|Infilled|Emissions|CO2 Mt CO2/yr 2.0 \n", - " AR6 climate diagnostics|Surface Temperature (GS... K 2.0 \n", - " Emissions|CO2 Mt CO2/yr 2.0 \n", - "\n", - "[3606 rows x 87 columns]" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "669eba10-c925-493b-8aa8-898064999aa7", - "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.10.8" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/rime/process_config.py b/rime/process_config.py index 396f3ee..5e58a32 100644 --- a/rime/process_config.py +++ b/rime/process_config.py @@ -48,7 +48,7 @@ # ============================================================================= -yaml_path = "indicator_params.yml" +yaml_path = "rime\\indicator_params.yml" landmask_path = git_path+"climate_impacts_processing\\landareamaskmap0.nc" kg_class_path = git_path+"climate_impacts_processing\\kg_class.nc" @@ -68,7 +68,7 @@ fname_input_climate = f"{wd}{wd2}{folder_input_climate}*_{region}*.nc" # Input IAMC scenarios file, must have a temperature variable - fname_input_scenarios = f"emissions_temp_AR6_small.xlsx" + fname_input_scenarios = f"rime\\emissions_temp_AR6_small.xlsx" # Directory of map files to read as input # impact_data_dir = f"{wd}\\data\\4_split_files_for_geoserver" diff --git a/rime/process_maps.py b/rime/process_maps.py index 0284a82..e18b0b3 100644 --- a/rime/process_maps.py +++ b/rime/process_maps.py @@ -4,7 +4,7 @@ Created on Thu Apr 6 11:36:24 2023 @author: werning, byers -Execute this script ideally in the top level of the RIME directory +Execute this script ideally in GitHub/rime folder To Do: @@ -24,6 +24,7 @@ # from dask.distributed import Client from rime.process_config import * from rime.rime_functions import * +from rime.utils import * # from dask.diagnostics import Profiler, ResourceProfiles, CacheProfiler @@ -42,14 +43,7 @@ df_scens_in = pyam.IamDataFrame(fname_input_scenarios) dft = df_scens_in.filter(variable=temp_variable) -dft = np.round(dft.as_pandas()[pyam.IAMC_IDX + ["year", "value", "Ssp_family"]], 2) -# Replace & fill missing SSP scenario allocation -# dft.Ssp_family.replace(sspdic, inplace=True) # metadata must have Ssp_faily column. If not SSP2 automatically chosen -dft.loc[dft.Ssp_family.isnull(), ssp_meta_col] = "ssp2" - -dft = pyam.IamDataFrame(dft) - -# % interpolate maps +dft = ssp_helper(dft) # %% Test multiple scenarios, 1 indicator @@ -103,16 +97,18 @@ print("Test 1 scenario, multiple indicators") start = time.time() ssp = "ssp2" +# year=2055 mapdata = xr.Dataset() indicators = [ "cdd", "precip", "dri", - "dri_qtot", - "ia_var", - "ia_var_qtot", - "sdd_18p3", + # "dri_qtot", + # "iavar", + # "ia_var_qtot", + # "sdd_18p3", "sdd_24p0", + 'wsi', ] #'heatwave'] for ind in indicators: @@ -126,17 +122,23 @@ files, preprocess=remove_ssp_from_ds, combine="nested", concat_dim="gmt" )[short] +dvs = mapdata.data_vars +mapdata = mapdata.rename({'threshold':'gmt'}) +mapdata = mapdata.set_index({'lon':'lon','lat':'lat','gmt':'gmt'}).reset_coords() +mapdata = mapdata.drop_vars([x for x in mapdata.data_vars if x not in dvs]) + map_out_MI = map_transform_gmt_multi_dask( - dft.filter(model="AIM*", scenario="SSP1-34"), - mapdata, - years, - use_dask=False, - gmt_name="threshold", -) + dft.filter(model="AIM*", scenario="SSP1-34"), + mapdata, + years=years, + use_dask=False, + gmt_name="gmt", + ) comp = dict(zlib=True, complevel=5) encoding = {var: comp for var in map_out_MI.data_vars} filename = f"{output_folder_maps}scenario_maps_multiindicator_{ftype}.nc" +dask.config.set(scheduler="single-threaded") map_out_MI.to_netcdf(filename, encoding=encoding) print("FINISHED 1 scenario, multiple indicators") @@ -146,3 +148,21 @@ # 1 scenario, 8 indis = 22s, = 1.8s/s dask=False # 1 scenario, 12 indis = 62s, = 5s/s dask=False, 24 workers. # 1... 32s dask=True + +#%% Test plot dashboard + +indicators = ['cdd','dri'] + +filename = 'test_map.html' +plot_maps_dashboard(map_out_MI, indicators=indicators, + filename=filename, year=2055, cmap='magma_r', + shared_axes=True, clim=None, ) +os.startfile(filename) + +#%% + +filename = 'test_map.html' +plot_maps_dashboard(map_out_MI, + filename=filename, year=2055, cmap='magma_r', + shared_axes=True, clim=None, ) +os.startfile(filename) \ No newline at end of file diff --git a/rime/rime_functions.py b/rime/rime_functions.py index 6c1118d..843eeac 100644 --- a/rime/rime_functions.py +++ b/rime/rime_functions.py @@ -163,18 +163,18 @@ def calculate_impacts_gmt( def map_transform_gmt( df1, mapdata, - var_name, years, + var_name=None, map_array=xr.Dataset(), caution_checks=True, drawdown_max=0.15, - gmt_name="threshold", + gmt_name="gmt", interpolation=0.01, temp_min=1.2, temp_max=3.5, ): """ - Takes in a set of scenarios of GMT and dataset of climate impacts by GWL, + Takes in one scenario of GMT and dataset of climate impacts by GWL, and returns a table of climate impacts per scenario through time. Parameters @@ -182,15 +182,15 @@ def map_transform_gmt( df1 : dask.DataFrame dask.DataFrame in the format of an IAMC table (see pyam.IamDataFrame) with scenario(s) as rows and only 1 variable for the global mean temperature timeseries. Needs to have a column specifying the SSP to be assumed. mapdata : xarray.Dataset - dimensions ['gmt','year','ssp','region'] and each variable is a climate indicator + dimensions ['gmt','lat','lon'] and each variable is a climate indicator ..... .... ... Returns ------- - idf : pyam.IamDataFrame - pyam.IamDataFrame with variables for the impact indicators for each scenario(s). + idf : xarray.Dataset + xarray.Dataset with variables for the impact indicators for each scenario(s) through time """ @@ -198,8 +198,10 @@ def map_transform_gmt( raise Exception("Error: more than 1 variable in DataFrame") if len(df1.meta) > 1: raise Exception("Error: more than 1 model-scenario in DataFrame") + # Should only be 1 scenario + # Currently only works for 1 climate indicator for model, scenario in df1.index: # Get the GMT values from df gmt_values = df1.filter(year=years).data["value"].values @@ -210,12 +212,12 @@ def map_transform_gmt( drawdown = np.round(gmt_values.max() - gmt_values[-1], 2) if drawdown > drawdown_max: print(f"Warning! Overshoot drawdown: {drawdown}. Scenario SKIPPED") - continue + # continue if gmt_values.max() > temp_max: print( f"Warning! Max temperature above {temp_max}°C {gmt_values.max()}, data thereafter not possible" ) - continue + # continue if gmt_values.min() < temp_min: print( f"Warning! Min temperature below {temp_min}°C {gmt_values.min()}, data before not possible" @@ -234,55 +236,73 @@ def map_transform_gmt( # print("") # Get indicator name - short = list(mapdata.data_vars)[0] + # short = list(mapdata.data_vars)[0] # provide new interpolated vector (e.g. 0.01 gmt resolution) new_thresholds = np.arange( mapdata.gmt.min(), mapdata.gmt.max() + interpolation, interpolation ) new_thresholds = [round(i, 2) for i in new_thresholds] - data_interp = mapdata.interp(gmt=new_thresholds) + mapdata_interp = mapdata.interp(gmt=new_thresholds) # Add dummy data for out of range values to last slice 999 # last_slice = data_interp.isel(gmt=-1) new_slice = xr.DataArray([999], dims=("gmt",), coords={"gmt": [999]}) - data_interp = xr.concat([data_interp[short], new_slice], dim="gmt") - data_interp["gmt"] = data_interp["gmt"].assign_coords( - gmt=data_interp["gmt"].values - ) - data_interp = data_interp.to_dataset() - - # Create new empty dataarray for the new data. - map_array = map_array.assign( - variables={ - var_name: ( - ("lat", "lon", "year"), - np.full( - [len(data_interp.lat), len(data_interp.lon), len(years)], np.nan - ), + data_interp = xr.Dataset() + for var_name in mapdata_interp.data_vars: + data_interp[var_name] = xr.concat([mapdata_interp[var_name], new_slice], dim="gmt") + + + # data_interp["gmt"] = data_interp["gmt"].assign_coords( + # gmt=data_interp["gmt"].values + # ) + # data_interp = data_interp.to_dataset() + + + # Here todo: loop through variables in data_interp + # Create new empty dataset called map_array for the new data. + + # map_array = + for var_name in data_interp.data_vars: + map_array = map_array.assign( + variables={ + var_name: ( + ("lat", "lon", "year"), + np.full( + [len(data_interp.lat), len(data_interp.lon), len(years)], np.nan + ), + ) + } ) - } - ) - data_interp[short][ - -1, - :, - :, - ] = np.full([len(data_interp.lat), len(data_interp.lon)], np.nan) + + + # for var_name in map_array.data_vars: + # data_interp[var_name][ + # -1, + # :, + # :, + # ] = np.full([len(data_interp.lat), len(data_interp.lon)], np.nan) # Create an array to store the updated data - updated_data = data_interp[short].sel(gmt=gmt_values) - - # Update map_array - map_array[var_name][:, :, : len(years)] = updated_data.transpose( - "lat", "lon", "gmt" + updated_data = data_interp.sel(gmt=gmt_values) #[short] + updated_data = updated_data.transpose("lat", "lon", "gmt") + updated_data = updated_data.rename_dims({'gmt':'year'}) + updated_data = updated_data.assign_coords( + coords={"lon": updated_data.lon, "lat": updated_data.lat, "year": years} ) + + map_array = updated_data # Drop other coords - dc = [x for x in map_array.coords if x not in ["lon", "lat", "year"]] + dc = [x for x in map_array.coords if x not in ["lon", "lat", "year","gmt"]] if len(dc) > 0: map_array.drop(dc) + + return map_array + + def map_transform_gmt_multi_dask( df, mapdata, @@ -295,33 +315,18 @@ def map_transform_gmt_multi_dask( interpolation=0.01, ): """ - Takes in a set of scenarios of GMT and dataset of climate impacts by GWL, - and returns a table of climate impacts per scenario through time. + Takes in either: (finish) + - a set of IAM scenarios of GMT and and one netcdf climate impact indicator by GWL, and returns a netcdf of climate indicators per scenario through time. Parameters ---------- - df : dask.DataFrame - dask.DataFrame in the format of an IAMC table (see pyam.IamDataFrame) with scenario(s) as rows and only 1 variable for the global mean temperature timeseries. Needs to have a column specifying the SSP to be assumed. - mapdata : xarray.Dataset - dimensions ['gmt','year','ssp','region'] and each variable is a climate indicator - filename : str, optional - DESCRIPTION. The default is NONE. output filename as .csv (utf-8), otherwise returns idf - # prefix_indicator : str, optional - # DESCRIPTION. The default is 'RIME|'. Use this to change the output indicator prefix. - # ssp_meta_col : str, optional - # DESCRIPTION. The default is 'Ssp_family'. Use this to change the name of the meta column used to assin the SSP per scenario - # gmt_below : float, optional - # DESCRIPTION. The default is 1.5. Assign all gmt values below gmt_below to the value of gmt_below (in case not enough data) + Returns ------- - idf : pyam.IamDataFrame - pyam.IamDataFrame with variables for the impact indicators for each scenario(s). - - """ - + """ if len(df.index) > 1: if len(mapdata.dims)>2: @@ -334,7 +339,7 @@ def map_transform_gmt_multi_dask( # ============================================================================= # 1 indicator, multi-scenario mode # ============================================================================= - print("Single indicator mode") + print("Single indicator mode (multi-scenarios possible)") delayed_tasks = [] for model, scenario in df.index: @@ -350,12 +355,12 @@ def map_transform_gmt_multi_dask( if use_dask: # Create delayed task for map_transform_gmt delayed_map_transform = delayed(map_transform_gmt)( - df1, mapdata, var_name, years, map_array + df1, mapdata, years, var_name, map_array ) delayed_tasks.append(delayed_map_transform) else: map_array = map_transform_gmt( - df1, mapdata, var_name, years, map_array + df1, mapdata, years, map_array ) if use_dask: # Compute delayed tasks concurrently @@ -375,32 +380,37 @@ def map_transform_gmt_multi_dask( # ============================================================================= # 1 scenario, multi-indicator mode # ============================================================================= - print("Single scenario mode") + print("Single scenario mode, multiple indicators possible") model = df.model[0] scenario = df.scenario[0] - - delayed_tasks = [] if len(mapdata.dims)>2: map_array = mapdata.isel({gmt_name:0}).reset_coords(drop=True) map_array = map_array.drop_vars(map_array.data_vars) else: map_array = xr.full_like(mapdata, np.nan).drop_vars(mapdata.data_vars) + # needs to be outsite loop + delayed_tasks = [] - # Iterate through spatial indicators in DataSet - for var_name in mapdata.data_vars: - print(var_name) - df1 = df - if use_dask: + + df1 = df + + # use_dask not working here + if use_dask: + # Iterate through spatial indicators in DataSet + for var_name in mapdata.data_vars: + print(var_name) # Create delayed task for map_transform_gmt_dask delayed_map_transform = delayed(map_transform_gmt)( - df1, mapdata[var_name], var_name, years, map_array + df1, mapdata[var_name], years, var_name, map_array ) delayed_tasks.append(delayed_map_transform) - else: - map_array = map_transform_gmt(df1, mapdata[var_name], var_name, years, map_array) + else: + map_array = map_transform_gmt(df1, mapdata, years, map_array) + + # use_dask not working here if use_dask: # Compute delayed tasks concurrently computed_results = dask.compute(*delayed_tasks) @@ -409,9 +419,9 @@ def map_transform_gmt_multi_dask( for result in computed_results: map_array.update(result) - map_array = map_array.assign_coords( - coords={"lon": map_array.lon, "lat": map_array.lat, "year": years} - ) + # map_array = map_array.assign_coords( + # coords={"lon": map_array.lon, "lat": map_array.lat, "year": years} + # ) map_array.attrs['model'] = model map_array.attrs['scenario'] = scenario return map_array @@ -659,7 +669,6 @@ def plot_maps_dashboard(ds, filename=None, indicators=None, year=2050, raise Exception(f"Error: Year not a dimension and more than 2 dimensions in dataset") - plot_list = [] # Import cartopy if a crs is provided if not isinstance(crs, type(None)): @@ -668,6 +677,7 @@ def plot_maps_dashboard(ds, filename=None, indicators=None, year=2050, except: print('Error importing Cartopy') + plot_list = [] # Run loop through indicators (variables) and plot for i in indicators: @@ -690,7 +700,7 @@ def plot_maps_dashboard(ds, filename=None, indicators=None, year=2050, else: model = 'unknown' scenario = 'scenario' - if isinstance(layout_title, type(None))==False: + if isinstance(layout_title, type(str))==False: layout_title = f'Climate impacts in {year} ({model}, {scenario})' diff --git a/rime/test_map.html b/rime/test_map.html deleted file mode 100644 index 2c4c4e7..0000000 --- a/rime/test_map.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - test_map - - - - - - - - - - - - - - -
- - - - - \ No newline at end of file