Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LIVVkit
lex
Commits
49953e91
Commit
49953e91
authored
Apr 25, 2018
by
Kennedy, Joseph H
Browse files
Add figure captions to the energy extension
For #20
parent
eb17b655
Changes
14
Hide whitespace changes
Inline
Side-by-side
energy/energy/cesm_racmo23_albedo.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy.ma
as
ma
import
numpy.ma
as
ma
...
@@ -7,7 +9,14 @@ from netCDF4 import Dataset
...
@@ -7,7 +9,14 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_albedo plot."""
describe
=
"""
Average of the annual average surface albedo over Greenland
for every summer (June-July-August; JJA) from 1980--1999
for CESM (left) and RACMO 2.3 (middle), and the difference between them (right; CESM -
RACMO 2.3). The black solid lines denote the 0, 1000, 2000, and 3000 meter
Greenland ice sheet elevation contours as seen by the models (CESM's contours
shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_latf.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_laft plot."""
describe
=
"""
Average of the annual average latent heat flux (W m^-2) over Greenland
for every summer (June-July-August; JJA) from 1980--1999
for CESM (left) and RACMO 2.3 (middle), and the difference between them (right; CESM -
RACMO 2.3). The black solid lines denote the 0, 1000, 2000, and 3000 meter
Greenland ice sheet elevation contours as seen by the models (CESM's contours
shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_lwsd.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_lwsd plot."""
describe
=
"""
Average of the annual average downward longwave radiation (W m^-2) over Greenland
for every summer (June-July-August; JJA) from 1980--1999
for CESM (left) and RACMO 2.3 (middle), and the difference between them (right; CESM -
RACMO 2.3). The black solid lines denote the 0, 1000, 2000, and 3000 meter
Greenland ice sheet elevation contours as seen by the models (CESM's contours
shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_lwsn.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_lwsn plot."""
describe
=
"""
Average of the annual average net longwave radiation (W m^-2) over Greenland
for every summer (June-July-August; JJA) from 1980--1999
for CESM (left) and RACMO 2.3 (middle), and the difference between them (right; CESM -
RACMO 2.3). The black solid lines denote the 0, 1000, 2000, and 3000 meter
Greenland ice sheet elevation contours as seen by the models (CESM's contours
shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_rnet.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_rnet plot."""
describe
=
"""
Average of the summer (June-July-August; JJA) average net radiation (W m^-2)
over Greenland for every summer (June-July-August; JJA) from 1980--1999
for CESM (left) and RACMO 2.3 (middle), and the difference between them (right; CESM -
RACMO 2.3). The black solid lines denote the 0, 1000, 2000, and 3000 meter
Greenland ice sheet elevation contours as seen by the models (CESM's contours
shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_senf.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,14 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_senf plot."""
describe
=
"""
Average of the annual average sensible heat flux (W m^-2) over Greenland for
every summer (June-July-August; JJA) from 1980--1999 for CESM (left) and RACMO
2.3 (middle), and the difference between them (right; CESM - RACMO 2.3). The
black solid lines denote the 0, 1000, 2000, and 3000 meter Greenland ice sheet
elevation contours as seen by the models (CESM's contours shown in the
difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_smb.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
...
@@ -9,7 +11,13 @@ from netCDF4 import Dataset
...
@@ -9,7 +11,13 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_smb plot."""
describe
=
"""
Average of the annual average surface mass balance (kg m^-2 a^-1) over Greenland for every
summer (June-July-August; JJA) from 1980--1999 for CESM (left) and RACMO 2.3 (middle),
and the difference between them (right; CESM - RACMO 2.3). The black solid lines denote
the 0, 1000, 2000, and 3000 meter Greenland ice sheet elevation contours as seen by
the models (CESM's contours shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_swsd.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_swsd plot."""
describe
=
"""
Average of the annual average downward shortwave radiation (W m^-2) over Greenland
for every summer (June-July-August; JJA) from 1980--1999 for CESM (left) and
RACMO 2.3 (middle), and the difference between them (right; CESM - RACMO 2.3).
The black solid lines denote the 0, 1000, 2000, and 3000 meter Greenland ice sheet
elevation contours as seen by the models (CESM's contours shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_swsn.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_swsn plot."""
describe
=
"""
Average of the average net shortwave radiation (W m^-2)
over Greenland for every summer (June-July-August; JJA) from 1980--1999 for CESM (left)
and RACMO 2.3 (middle), and the difference between them (right; CESM - RACMO 2.3).
The black solid lines denote the 0, 1000, 2000, and 3000 meter Greenland ice sheet
elevation contours as seen by the models (CESM's contours shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_t2m_ann.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_t2m_ann plot."""
describe
=
"""
Average of the annual average 2-meter air temperature (°C) over Greenland from 1980--1999
for CESM (left) and RACMO 2.3 (middle), and the difference between them (right; CESM -
RACMO 2.3). The black solid lines denote the 0, 1000, 2000, and 3000 meter
Greenland ice sheet elevation contours as seen by the models (CESM's contours
shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_t2m_djf.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_t2m_djf plot."""
describe
=
"""
Average of the 2-meter air temperature (°C) over Greenland for every winter
(December-January-Feburary; DJF) from 1980--1999 for CESM (left) and RACMO 2.3 (middle), and the
difference between them (right; CESM - RACMO 2.3). The black solid lines denote
the 0, 1000, 2000, and 3000 meter Greenland ice sheet elevation contours as seen
by the models (CESM's contours shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/cesm_racmo23_t2m_jja.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
Ngl
import
Ngl
import
numpy
as
np
import
numpy
as
np
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
...
@@ -8,7 +10,13 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""CESM_RACMO23_t2m_jja plot."""
describe
=
"""
Average of the 2-meter air temperature (°C) over Greenland for every summer
(June-July-August; JJA) from 1980--1999 for CESM (left) and RACMO 2.3 (middle), and the
difference between them (right; CESM - RACMO 2.3). The black solid lines denote
the 0, 1000, 2000, and 3000 meter Greenland ice sheet elevation contours as seen
by the models (CESM's contours shown in the difference plot).
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
...
energy/energy/timeseries_qice_gt.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
numpy
as
np
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
...
@@ -6,7 +8,20 @@ from netCDF4 import Dataset
...
@@ -6,7 +8,20 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""TimeSeries_QICE_GT and BoxPlot_QICE_GT plot."""
describe_ts
=
"""
Time series of the ({model_color}) CESM surface mass balance (Gt a^-1) for the
entire {model_start:.0f}--{model_end:.0f} simulation compared to the ({obs_color})
{obs_start:.0f}--{obs_end:.0f} RACMO 2.3 surface mass balance.
"""
describe_bx
=
"""
Box plot of the CESM surface mass balance (Gt a^-1) for the entire
{model_start:.0f}--{model_end:.0f} simulation compared to the {obs_start:.0f}--{obs_end:.0f}
RACMO 2.3 surface mass balance. Here, the colored lines represent the median
values, the boxes are drawn from the first quartile to the third quartile
(covering the interqartile range, or IQR), and the whiskers cover 1.5x the IQR.
Diamonds outside the whiskers represent suspected outliers.
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
@@ -69,7 +84,6 @@ def make_plot(config, out_path='.'):
...
@@ -69,7 +84,6 @@ def make_plot(config, out_path='.'):
ax
.
set_ylabel
(
'Surface mass balance (Gt a$^{-1}$)'
,
fontsize
=
14
)
ax
.
set_ylabel
(
'Surface mass balance (Gt a$^{-1}$)'
,
fontsize
=
14
)
ax
.
set_xlabel
(
'time'
,
fontsize
=
14
)
ax
.
set_xlabel
(
'time'
,
fontsize
=
14
)
plt
.
tight_layout
()
plt
.
tight_layout
()
ts_img_path
=
os
.
path
.
join
(
out_path
,
'TimeSeries_QICE_GT.png'
)
ts_img_path
=
os
.
path
.
join
(
out_path
,
'TimeSeries_QICE_GT.png'
)
plt
.
savefig
(
ts_img_path
)
plt
.
savefig
(
ts_img_path
)
...
@@ -78,7 +92,13 @@ def make_plot(config, out_path='.'):
...
@@ -78,7 +92,13 @@ def make_plot(config, out_path='.'):
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
os
.
path
.
basename
(
ts_img_path
))
os
.
path
.
basename
(
ts_img_path
))
img_elem
=
el
.
image
(
'TimeSeries_QICE_GT'
,
img_elem
=
el
.
image
(
'TimeSeries_QICE_GT'
,
' '
.
join
(
describe
.
split
()),
' '
.
join
(
describe_ts
.
format
(
model_color
=
'blue'
,
model_start
=
time
[
0
],
model_end
=
time
[
-
1
],
obs_color
=
'orange'
,
obs_start
=
time2
[
0
],
obs_end
=
time2
[
-
1
],
).
split
()),
img_link
)
img_link
)
if
config
:
if
config
:
img_elem
[
'Height'
]
=
config
[
'image_height'
]
img_elem
[
'Height'
]
=
config
[
'image_height'
]
...
@@ -112,7 +132,11 @@ def make_plot(config, out_path='.'):
...
@@ -112,7 +132,11 @@ def make_plot(config, out_path='.'):
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
os
.
path
.
basename
(
bx_img_path
))
os
.
path
.
basename
(
bx_img_path
))
img_elem
=
el
.
image
(
'BoxPlot_QICE_GT'
,
img_elem
=
el
.
image
(
'BoxPlot_QICE_GT'
,
' '
.
join
(
describe
.
split
()),
' '
.
join
(
describe_bx
.
format
(
model_start
=
time
[
0
],
model_end
=
time
[
-
1
],
obs_start
=
time2
[
0
],
obs_end
=
time2
[
-
1
],
).
split
()),
img_link
)
img_link
)
img_elem
[
'Height'
]
=
config
[
'image_height'
]
img_elem
[
'Height'
]
=
config
[
'image_height'
]
img_list
.
append
(
img_elem
)
img_list
.
append
(
img_elem
)
...
...
energy/energy/timeseries_trefht.py
View file @
49953e91
# coding=utf-8
import
os
import
os
import
numpy
as
np
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
...
@@ -6,7 +8,20 @@ from netCDF4 import Dataset
...
@@ -6,7 +8,20 @@ from netCDF4 import Dataset
from
livvkit.util
import
elements
as
el
from
livvkit.util
import
elements
as
el
describe
=
"""TimeSeries_T2M and BoxPlot_T2M plot."""
describe_ts
=
"""
Time series of the ({model_color}) CESM 2-meter air temperature (°C) for the
entire {model_start:.0f}--{model_end:.0f} simulation compared to the ({obs_color})
{obs_start:.0f}--{obs_end:.0f} RACMO 2.3 2-meter air temperature.
"""
describe_bx
=
"""
Box plot of the CESM 2-meter air temperature (°C) for the entire
{model_start:.0f}--{model_end:.0f} simulation compared to the {obs_start:.0f}--{obs_end:.0f}
RACMO 2.3 2-meter air temperature. Here, the colored lines represent the median
values, the boxes are drawn from the first quartile to the third quartile
(covering the interqartile range, or IQR), and the whiskers cover 1.5x the IQR.
Diamonds outside the whiskers represent suspected outliers.
"""
def
make_plot
(
config
,
out_path
=
'.'
):
def
make_plot
(
config
,
out_path
=
'.'
):
...
@@ -63,7 +78,6 @@ def make_plot(config, out_path='.'):
...
@@ -63,7 +78,6 @@ def make_plot(config, out_path='.'):
ax
.
set_ylabel
(
'2-meter air temperature ($^{\circ}$C)'
,
fontsize
=
14
)
ax
.
set_ylabel
(
'2-meter air temperature ($^{\circ}$C)'
,
fontsize
=
14
)
ax
.
set_xlabel
(
'time'
,
fontsize
=
14
)
ax
.
set_xlabel
(
'time'
,
fontsize
=
14
)
ts_img_path
=
os
.
path
.
join
(
out_path
,
'TimeSeries_T2M.png'
)
ts_img_path
=
os
.
path
.
join
(
out_path
,
'TimeSeries_T2M.png'
)
plt
.
savefig
(
ts_img_path
)
plt
.
savefig
(
ts_img_path
)
plt
.
close
()
plt
.
close
()
...
@@ -71,7 +85,13 @@ def make_plot(config, out_path='.'):
...
@@ -71,7 +85,13 @@ def make_plot(config, out_path='.'):
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
os
.
path
.
basename
(
ts_img_path
))
os
.
path
.
basename
(
ts_img_path
))
img_elem
=
el
.
image
(
'TimeSeries_T2M'
,
img_elem
=
el
.
image
(
'TimeSeries_T2M'
,
' '
.
join
(
describe
.
split
()),
' '
.
join
(
describe_ts
.
format
(
model_color
=
'blue'
,
model_start
=
time
[
0
],
model_end
=
time
[
-
1
],
obs_color
=
'orange'
,
obs_start
=
time2
[
0
],
obs_end
=
time2
[
-
1
],
).
split
()),
img_link
)
img_link
)
if
config
:
if
config
:
img_elem
[
'Height'
]
=
config
[
'image_height'
]
img_elem
[
'Height'
]
=
config
[
'image_height'
]
...
@@ -98,7 +118,6 @@ def make_plot(config, out_path='.'):
...
@@ -98,7 +118,6 @@ def make_plot(config, out_path='.'):
ax
.
set_ylim
(
-
24
,
-
14
)
ax
.
set_ylim
(
-
24
,
-
14
)
ax
.
grid
(
False
)
ax
.
grid
(
False
)
plt
.
tight_layout
()
plt
.
tight_layout
()
bx_img_path
=
os
.
path
.
join
(
out_path
,
'BoxPlot_T2M.png'
)
bx_img_path
=
os
.
path
.
join
(
out_path
,
'BoxPlot_T2M.png'
)
plt
.
savefig
(
bx_img_path
)
plt
.
savefig
(
bx_img_path
)
...
@@ -107,7 +126,11 @@ def make_plot(config, out_path='.'):
...
@@ -107,7 +126,11 @@ def make_plot(config, out_path='.'):
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
img_link
=
os
.
path
.
join
(
os
.
path
.
basename
(
out_path
),
os
.
path
.
basename
(
bx_img_path
))
os
.
path
.
basename
(
bx_img_path
))
img_elem
=
el
.
image
(
'BoxPlot_T2M'
,
img_elem
=
el
.
image
(
'BoxPlot_T2M'
,
' '
.
join
(
describe
.
split
()),
' '
.
join
(
describe_bx
.
format
(
model_start
=
time
[
0
],
model_end
=
time
[
-
1
],
obs_start
=
time2
[
0
],
obs_end
=
time2
[
-
1
],
).
split
()),
img_link
)
img_link
)
img_elem
[
'Height'
]
=
config
[
'image_height'
]
img_elem
[
'Height'
]
=
config
[
'image_height'
]
img_list
.
append
(
img_elem
)
img_list
.
append
(
img_elem
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment