Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arctic GWL analyses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gieße, Dr. Céline
Arctic GWL analyses
Commits
19c6c8c9
Commit
19c6c8c9
authored
Aug 2, 2024
by
Gieße, Dr. Céline
Browse files
Options
Downloads
Patches
Plain Diff
delete joypy install
parent
1e4bb2c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Arctic_SAT.ipynb
+0
-34
0 additions, 34 deletions
Arctic_SAT.ipynb
with
0 additions
and
34 deletions
Arctic_SAT.ipynb
+
0
−
34
View file @
19c6c8c9
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "e4e31af2-b088-4035-a13a-06d7ddcdfb25",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: joypy in /home/u/u241297/.local/lib/python3.10/site-packages (0.2.6)\n",
"Requirement already satisfied: numpy>=1.16.5 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (1.23.4)\n",
"Requirement already satisfied: matplotlib in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (3.5.3)\n",
"Requirement already satisfied: pandas>=0.20.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (2.0.0)\n",
"Requirement already satisfied: scipy>=0.11.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (1.8.1)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from pandas>=0.20.0->joypy) (2.8.2)\n",
"Requirement already satisfied: pytz>=2020.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from pandas>=0.20.0->joypy) (2023.3)\n",
"Requirement already satisfied: tzdata>=2022.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from pandas>=0.20.0->joypy) (2023.3)\n",
"Requirement already satisfied: pillow>=6.2.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (9.2.0)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (4.39.3)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (1.4.4)\n",
"Requirement already satisfied: pyparsing>=2.2.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (3.0.9)\n",
"Requirement already satisfied: packaging>=20.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (23.1)\n",
"Requirement already satisfied: cycler>=0.10 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (0.11.0)\n",
"Requirement already satisfied: six>=1.5 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas>=0.20.0->joypy) (1.16.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install joypy"
]
},
{
"cell_type": "code",
"execution_count": 2,
...
...
%% Cell type:code id:e4e31af2-b088-4035-a13a-06d7ddcdfb25 tags:
```
python
pip
install
joypy
```
%% Output
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: joypy in /home/u/u241297/.local/lib/python3.10/site-packages (0.2.6)
Requirement already satisfied: numpy>=1.16.5 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (1.23.4)
Requirement already satisfied: matplotlib in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (3.5.3)
Requirement already satisfied: pandas>=0.20.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (2.0.0)
Requirement already satisfied: scipy>=0.11.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from joypy) (1.8.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from pandas>=0.20.0->joypy) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from pandas>=0.20.0->joypy) (2023.3)
Requirement already satisfied: tzdata>=2022.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from pandas>=0.20.0->joypy) (2023.3)
Requirement already satisfied: pillow>=6.2.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (9.2.0)
Requirement already satisfied: fonttools>=4.22.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (4.39.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (1.4.4)
Requirement already satisfied: pyparsing>=2.2.1 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (3.0.9)
Requirement already satisfied: packaging>=20.0 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (23.1)
Requirement already satisfied: cycler>=0.10 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from matplotlib->joypy) (0.11.0)
Requirement already satisfied: six>=1.5 in /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas>=0.20.0->joypy) (1.16.0)
Note: you may need to restart the kernel to use updated packages.
%% Cell type:code id:fb7d6d3e-7726-49d2-a8c5-85bad5854f10 tags:
```
python
import
numpy
as
np
import
xarray
as
xr
import
matplotlib.pyplot
as
plt
import
pandas
as
pd
import
joypy
from
scipy
import
signal
SMALL_SIZE
=
10
MEDIUM_SIZE
=
12
BIGGER_SIZE
=
14
plt
.
rc
(
'
font
'
,
size
=
MEDIUM_SIZE
)
# controls default text sizes
plt
.
rc
(
'
axes
'
,
titlesize
=
MEDIUM_SIZE
)
# fontsize of the axes title
plt
.
rc
(
'
axes
'
,
labelsize
=
MEDIUM_SIZE
)
# fontsize of the x and y labels
plt
.
rc
(
'
xtick
'
,
labelsize
=
SMALL_SIZE
)
# fontsize of the tick labels
plt
.
rc
(
'
ytick
'
,
labelsize
=
SMALL_SIZE
)
# fontsize of the tick labels
plt
.
rc
(
'
legend
'
,
fontsize
=
MEDIUM_SIZE
)
# legend fontsize
plt
.
rc
(
'
figure
'
,
titlesize
=
BIGGER_SIZE
)
# fontsize of the figure title
plt
.
rc
(
'
font
'
,
size
=
MEDIUM_SIZE
)
#colors
colors_gwl
=
[
'
black
'
,(
253
/
255
,
141
/
255
,
60
/
255
),(
189
/
255
,
0
/
255
,
38
/
255
)]
years
=
np
.
linspace
(
1850
,
2100
,
251
)
Tglob
=
[
"
T0
"
,
"
T15
"
,
"
T27
"
]
Tglob_values
=
[
0
,
1.5
,
2.7
]
data_path
=
'
/work/uo1075/u241297/data/large_ensembles/CMIP6/MPI-ESM1-2-LR/
'
```
%% Cell type:markdown id:6528eeee-cbb0-44f2-9621-1fb397b2fb3d tags:
# Global warming levels
%% Cell type:code id:88e247a5-07b5-4210-9e78-46f9c663d96c tags:
```
python
#MPI-ESM
path
=
data_path
+
'
global-mean/
'
GSAT
=
np
.
zeros
((
50
,
251
))
for
i
in
range
(
50
):
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_global-mean.nc
"
GSAT
[
i
,:]
=
np
.
squeeze
(
xr
.
open_dataset
(
file
)[
'
tas
'
])
-
273.15
GSAT_rm
=
np
.
array
(
pd
.
DataFrame
(
GSAT
).
rolling
(
20
,
axis
=
1
,
center
=
True
).
mean
())
Tzero_GSAT
=
np
.
mean
(
GSAT
[:,
0
:
51
])
#1850-1900
GSATa
=
GSAT
-
Tzero_GSAT
GSATa_rm
=
GSAT_rm
-
Tzero_GSAT
```
%% Cell type:code id:fe024f74-6e29-4b7f-a60d-7214aa82e639 tags:
```
python
GWLcross_ind
=
dict
()
for
Ti
in
range
(
3
):
GWLcross_ind
[
Tglob
[
Ti
]]
=
np
.
empty
(
50
,
dtype
=
int
)
GWLcross_ind
[
"
T0
"
]
=
50
*
[
20
]
for
Ti
in
range
(
1
,
3
):
for
i
in
range
(
50
):
j
=
20
while
(
GSATa_rm
[
i
,
j
]
<
Tglob_values
[
Ti
]):
j
=
j
+
1
GWLcross_ind
[
Tglob
[
Ti
]][
i
]
=
j
GWL_ind
=
dict
()
for
Ti
in
range
(
3
):
GWL_ind
[
Tglob
[
Ti
]]
=
np
.
zeros
((
50
,
20
),
dtype
=
int
)
for
Ti
in
range
(
3
):
for
i
in
range
(
50
):
GWL_ind
[
Tglob
[
Ti
]][
i
,:]
=
np
.
linspace
(
GWLcross_ind
[
Tglob
[
Ti
]][
i
]
-
10
,
GWLcross_ind
[
Tglob
[
Ti
]][
i
]
+
9
,
20
)
```
%% Cell type:markdown id:01777080-578e-45d5-b047-8a94556cd51d tags:
# Daily Arctic temperatures
%% Cell type:code id:d95e9c5a-7b80-4e46-a023-d1e669faffbc tags:
```
python
gridarea
=
np
.
array
(
xr
.
open_dataset
(
data_path
+
'
gridarea.nc
'
)[
'
cell_area
'
])
```
%% Cell type:code id:4834ae76-c68e-4492-9046-a5f3187952a6 tags:
```
python
path
=
data_path
+
'
arctic/
'
ASATday
=
np
.
zeros
((
50
,
251
,
365
,
13
,
192
))
for
i
in
range
(
50
):
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_arctic.nc
"
ASATday
[
i
,:,:]
=
np
.
array
(
xr
.
open_dataset
(
file
)[
'
tas
'
]).
reshape
((
251
,
365
,
13
,
192
))
-
273.15
```
%% Cell type:code id:d91655c0-91ba-407a-bf4e-5e8bfc6d925f tags:
```
python
ASATday_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_samples
[
Tglob
[
Ti
]]
=
list
()
for
i
in
range
(
50
):
ASATday_samples
[
Tglob
[
Ti
]].
append
(
ASATday
[
i
,
GWL_ind
[
Tglob
[
Ti
]][
i
,:],:,:,:])
#free up space
del
ASATday
```
%% Cell type:markdown id:a51c44c0-cd57-40c6-bef8-42436a92585d tags:
## Detrending
%% Cell type:code id:8b52e180-52d4-4a5a-9818-4523855b0d02 tags:
```
python
#ensemble mean
ASATday_ensmean_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_ensmean_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATday_samples
[
Tglob
[
Ti
]],
axis
=
0
)
#daily trend
ASATday_trend_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_trend_samples
[
Tglob
[
Ti
]]
=
ASATday_ensmean_samples
[
Tglob
[
Ti
]]
-
signal
.
detrend
(
ASATday_ensmean_samples
[
Tglob
[
Ti
]],
axis
=
0
)
-
np
.
mean
(
ASATday_ensmean_samples
[
Tglob
[
Ti
]],
axis
=
0
)[
np
.
newaxis
,:,:,:]
#daily detrended
ASATday_detrend_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_detrend_samples
[
Tglob
[
Ti
]]
=
ASATday_samples
[
Tglob
[
Ti
]]
-
ASATday_trend_samples
[
Tglob
[
Ti
]][
np
.
newaxis
,:,:,:,:]
```
%% Cell type:markdown id:d62c36b9-0912-42dc-b769-529b18510167 tags:
## Arctic mean + seasonal samples
%% Cell type:code id:2f131159-f470-4068-a7e1-329ce67462f6 tags:
```
python
#area-weighted Arctic mean
ASATday_detrend_arcticmean_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]]
=
np
.
average
(
ASATday_detrend_samples
[
Tglob
[
Ti
]].
reshape
(
50
,
20
,
365
,
13
*
192
),
axis
=
3
,
weights
=
np
.
ravel
(
gridarea
))
```
%% Cell type:code id:ec372a8d-4bd8-45fa-8887-2a3b7a1fa43f tags:
```
python
#seasonal
ASATday_detrend_arcticmean_DJF_samples
=
dict
()
ASATday_detrend_arcticmean_MAM_samples
=
dict
()
ASATday_detrend_arcticmean_JJA_samples
=
dict
()
ASATday_detrend_arcticmean_SON_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]]
=
np
.
append
(
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]][:,:,
-
31
:],
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]][:,:,:
59
],
axis
=
2
)
ASATday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]][:,:,
59
:
151
]
ASATday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]][:,:,
151
:
243
]
ASATday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]][:,:,
243
:
334
]
```
%% Cell type:markdown id:5607d7f9-6410-4453-94ef-8b45cde1200b tags:
## Anomalies
%% Cell type:code id:9a37cbc2-a542-4d62-9892-0c357a1f73c5 tags:
```
python
#MPI-ESM1-2-LR
path
=
data_path
+
'
arctic-mean/
'
ASATday
=
np
.
zeros
((
50
,
251
,
365
))
ASATday_DJF
=
np
.
zeros
((
50
,
251
,
90
))
ASATday_MAM
=
np
.
zeros
((
50
,
251
,
92
))
ASATday_JJA
=
np
.
zeros
((
50
,
251
,
92
))
ASATday_SON
=
np
.
zeros
((
50
,
251
,
91
))
for
i
in
range
(
50
):
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_arctic-mean.nc
"
ASATday
[
i
,:,:]
=
np
.
array
(
xr
.
open_dataset
(
file
)[
'
tas
'
]).
reshape
((
251
,
365
))
-
273.15
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_arctic-mean_DJF.nc
"
ASATday_DJF
[
i
,:]
=
np
.
array
(
xr
.
open_dataset
(
file
)[
'
tas
'
]).
reshape
((
251
,
90
))
-
273.15
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_arctic-mean_MAM.nc
"
ASATday_MAM
[
i
,:]
=
np
.
array
(
xr
.
open_dataset
(
file
)[
'
tas
'
]).
reshape
((
251
,
92
))
-
273.15
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_arctic-mean_JJA.nc
"
ASATday_JJA
[
i
,:]
=
np
.
array
(
xr
.
open_dataset
(
file
)[
'
tas
'
]).
reshape
((
251
,
92
))
-
273.15
file
=
path
+
"
tas_hist_ssp585_r
"
+
str
(
i
+
1
)
+
"
_arctic-mean_SON.nc
"
ASATday_SON
[
i
,:]
=
np
.
array
(
xr
.
open_dataset
(
file
)[
'
tas
'
]).
reshape
((
251
,
91
))
-
273.15
Tzero_ASATday
=
np
.
mean
(
ASATday
[:,
0
:
51
,:])
ASATaday
=
ASATday
-
Tzero_ASATday
Tzero_ASATday_DJF
=
np
.
mean
(
ASATday_DJF
[:,
0
:
51
,:])
ASATaday_DJF
=
ASATday_DJF
-
Tzero_ASATday_DJF
Tzero_ASATday_MAM
=
np
.
mean
(
ASATday_MAM
[:,
0
:
51
,:])
ASATaday_MAM
=
ASATday_MAM
-
Tzero_ASATday_MAM
Tzero_ASATday_JJA
=
np
.
mean
(
ASATday_JJA
[:,
0
:
51
,:])
ASATaday_JJA
=
ASATday_JJA
-
Tzero_ASATday_JJA
Tzero_ASATday_SON
=
np
.
mean
(
ASATday_SON
[:,
0
:
51
,:])
ASATaday_SON
=
ASATday_SON
-
Tzero_ASATday_SON
#anomalies
ASATaday_detrend_arcticmean_samples
=
dict
()
ASATaday_detrend_arcticmean_DJF_samples
=
dict
()
ASATaday_detrend_arcticmean_MAM_samples
=
dict
()
ASATaday_detrend_arcticmean_JJA_samples
=
dict
()
ASATaday_detrend_arcticmean_SON_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATaday_detrend_arcticmean_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]]
-
Tzero_ASATday
ASATaday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]]
-
Tzero_ASATday_DJF
ASATaday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]]
-
Tzero_ASATday_MAM
ASATaday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]]
-
Tzero_ASATday_JJA
ASATaday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]]
=
ASATday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]]
-
Tzero_ASATday_SON
```
%% Cell type:markdown id:4bf105f6-6ca9-42aa-97aa-2de480671210 tags:
## Remove seasonal cycle
%% Cell type:code id:dfce4f1b-72a1-4011-994b-4a2b92e7952a tags:
```
python
#seasonal cycle detrend_arcticmeaned
ASATaday_detrend_arcticmean_SC_samples
=
dict
()
ASATaday_detrend_arcticmean_SC_DJF_samples
=
dict
()
ASATaday_detrend_arcticmean_SC_MAM_samples
=
dict
()
ASATaday_detrend_arcticmean_SC_JJA_samples
=
dict
()
ASATaday_detrend_arcticmean_SC_SON_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATaday_detrend_arcticmean_SC_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATaday_detrend_arcticmean_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATaday_detrend_arcticmean_SC_DJF_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATaday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATaday_detrend_arcticmean_SC_MAM_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATaday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATaday_detrend_arcticmean_SC_JJA_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATaday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATaday_detrend_arcticmean_SC_SON_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATaday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
#seasonal cycle detrend_arcticmeaned (anomalies)
ASATday_detrend_arcticmean_SC_samples
=
dict
()
ASATday_detrend_arcticmean_SC_DJF_samples
=
dict
()
ASATday_detrend_arcticmean_SC_MAM_samples
=
dict
()
ASATday_detrend_arcticmean_SC_JJA_samples
=
dict
()
ASATday_detrend_arcticmean_SC_SON_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATday_detrend_arcticmean_SC_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATday_detrend_arcticmean_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATday_detrend_arcticmean_SC_DJF_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATday_detrend_arcticmean_SC_MAM_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATday_detrend_arcticmean_SC_JJA_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
ASATday_detrend_arcticmean_SC_SON_samples
[
Tglob
[
Ti
]]
=
np
.
mean
(
ASATday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]],
axis
=
(
0
,
1
))
#subtract seasonal cycle
ASATaday_detrend_arcticmean_deseasonalized_samples
=
dict
()
ASATaday_detrend_arcticmean_deseasonalized_DJF_samples
=
dict
()
ASATaday_detrend_arcticmean_deseasonalized_MAM_samples
=
dict
()
ASATaday_detrend_arcticmean_deseasonalized_JJA_samples
=
dict
()
ASATaday_detrend_arcticmean_deseasonalized_SON_samples
=
dict
()
for
Ti
in
range
(
3
):
ASATaday_detrend_arcticmean_deseasonalized_samples
[
Tglob
[
Ti
]]
=
ASATaday_detrend_arcticmean_samples
[
Tglob
[
Ti
]]
-
ASATaday_detrend_arcticmean_SC_samples
[
Tglob
[
Ti
]][
np
.
newaxis
,
np
.
newaxis
,:]
+
np
.
mean
(
ASATaday_detrend_arcticmean_samples
[
Tglob
[
Ti
]])
ASATaday_detrend_arcticmean_deseasonalized_DJF_samples
[
Tglob
[
Ti
]]
=
ASATaday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]]
-
ASATaday_detrend_arcticmean_SC_DJF_samples
[
Tglob
[
Ti
]][
np
.
newaxis
,
np
.
newaxis
,:]
+
np
.
mean
(
ASATaday_detrend_arcticmean_DJF_samples
[
Tglob
[
Ti
]])
ASATaday_detrend_arcticmean_deseasonalized_MAM_samples
[
Tglob
[
Ti
]]
=
ASATaday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]]
-
ASATaday_detrend_arcticmean_SC_MAM_samples
[
Tglob
[
Ti
]][
np
.
newaxis
,
np
.
newaxis
,:]
+
np
.
mean
(
ASATaday_detrend_arcticmean_MAM_samples
[
Tglob
[
Ti
]])
ASATaday_detrend_arcticmean_deseasonalized_JJA_samples
[
Tglob
[
Ti
]]
=
ASATaday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]]
-
ASATaday_detrend_arcticmean_SC_JJA_samples
[
Tglob
[
Ti
]][
np
.
newaxis
,
np
.
newaxis
,:]
+
np
.
mean
(
ASATaday_detrend_arcticmean_JJA_samples
[
Tglob
[
Ti
]])
ASATaday_detrend_arcticmean_deseasonalized_SON_samples
[
Tglob
[
Ti
]]
=
ASATaday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]]
-
ASATaday_detrend_arcticmean_SC_SON_samples
[
Tglob
[
Ti
]][
np
.
newaxis
,
np
.
newaxis
,:]
+
np
.
mean
(
ASATaday_detrend_arcticmean_SON_samples
[
Tglob
[
Ti
]])
```
%% Cell type:markdown id:763c3184-d121-457d-9ca3-07079b1b9779 tags:
# PDF plots
%% Cell type:code id:b7b745bf-25b4-4345-962f-56fb7cd4dc0d tags:
```
python
df_annual
=
pd
.
DataFrame
(
data
=
{
'
T0
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_samples
[
"
T0
"
]),
'
T15
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_samples
[
"
T15
"
]),
'
T27
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_samples
[
"
T27
"
]),
'
Data
'
:
'
annual
'
})
df_DJF
=
pd
.
DataFrame
(
data
=
{
'
T0
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_DJF_samples
[
"
T0
"
]),
'
T15
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_DJF_samples
[
"
T15
"
]),
'
T27
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_DJF_samples
[
"
T27
"
]),
'
Data
'
:
'
DJF
'
})
df_MAM
=
pd
.
DataFrame
(
data
=
{
'
T0
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_MAM_samples
[
"
T0
"
]),
'
T15
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_MAM_samples
[
"
T15
"
]),
'
T27
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_MAM_samples
[
"
T27
"
]),
'
Data
'
:
'
MAM
'
})
df_JJA
=
pd
.
DataFrame
(
data
=
{
'
T0
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_JJA_samples
[
"
T0
"
]),
'
T15
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_JJA_samples
[
"
T15
"
]),
'
T27
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_JJA_samples
[
"
T27
"
]),
'
Data
'
:
'
JJA
'
})
df_SON
=
pd
.
DataFrame
(
data
=
{
'
T0
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_SON_samples
[
"
T0
"
]),
'
T15
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_SON_samples
[
"
T15
"
]),
'
T27
'
:
np
.
ravel
(
ASATaday_detrend_arcticmean_deseasonalized_SON_samples
[
"
T27
"
]),
'
Data
'
:
'
SON
'
})
df
=
pd
.
concat
([
df_annual
,
df_DJF
,
df_MAM
,
df_JJA
,
df_SON
])
df
=
df
.
groupby
(
'
Data
'
,
sort
=
False
)
# Draw Plot
plt
.
figure
()
fig
,
axes
=
joypy
.
joyplot
(
df
,
column
=
[
'
T0
'
,
'
T15
'
,
'
T27
'
],
by
=
'
Data
'
,
x_range
=
[
-
7
,
17
],
color
=
colors_gwl
,
overlap
=
0.2
,
alpha
=
0.5
,
figsize
=
(
8
,
6
))
plt
.
text
(
-
6.5
,
0.95
,
'
Global warming level:
'
,
ha
=
'
center
'
,
color
=
'
black
'
,
fontsize
=
12
)
plt
.
text
(
-
0.2
,
0.95
,
'
pre-industrial
'
,
ha
=
'
center
'
,
color
=
colors_gwl
[
0
],
fontsize
=
12
,
fontweight
=
'
bold
'
)
plt
.
text
(
4
,
0.95
,
'
1.5°C
'
,
ha
=
'
center
'
,
color
=
colors_gwl
[
1
],
fontsize
=
12
,
fontweight
=
'
bold
'
)
plt
.
text
(
7
,
0.95
,
'
2.7°C
'
,
ha
=
'
center
'
,
color
=
colors_gwl
[
2
],
fontsize
=
12
,
fontweight
=
'
bold
'
)
plt
.
xlabel
(
'
Arctic mean SAT anomaly [°C]
'
)
#plt.savefig('ASATaday_pdfs_allseasons.png',dpi=300)
plt
.
show
()
```
%% Output
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment