Commit b74e1711 authored by Evans, Katherine's avatar Evans, Katherine
Browse files

name change in the clouds modules to be more generic to model and add e3sm...

name change in the clouds modules to be more generic to model and add e3sm modules that are notiworking yet
parent 33fdabf0
{
"clouds_cesm" : {
"module" : "clouds/clouds_cesm.py",
"references" : "clouds/clouds_cesm.bib",
"references" : "clouds/clouds_model.bib",
"cesm_atm_climos": "data/cesm/atm",
"cism_data": "data/cism/glissade",
"cloud_data": "data/clouds",
......
......@@ -39,9 +39,9 @@ from livvkit.util import functions as fn
with fn.temp_sys_path(os.path.dirname(__file__)):
import clouds.utils as utils
import clouds.cesm_cldhgh_ann as clouds_high
import clouds.cesm_cldlow_ann as clouds_low
import clouds.cesm_cldtot_ann as clouds_total
import clouds.model_cldhgh_ann as clouds_high
import clouds.model_cldlow_ann as clouds_low
import clouds.model_cldtot_ann as clouds_total
import clouds.yearly_cycle_cldhgh as yrly_high
import clouds.yearly_cycle_cldlow as yrly_low
import clouds.yearly_cycle_cldtot as yrly_total
......
{
"clouds_e3sm" : {
"module" : "clouds/clouds_e3sm.py",
"references" : "clouds/clouds_model.bib",
"e3sm_atm_climos": "data/e3sm/atm",
"cism_data": "data/cism/glissade",
"cloud_data": "data/clouds",
"image_height" : 300
}
}
# Copyright (c) 2015,2016, UT-BATTELLE, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""An analysis of CESM's cloud cover over Greenland."""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import livvkit
from livvkit.util import elements as el
from livvkit.util import functions as fn
with fn.temp_sys_path(os.path.dirname(__file__)):
import clouds.utils as utils
import clouds.model_cldhgh_ann as clouds_high
import clouds.model_cldlow_ann as clouds_low
import clouds.model_cldtot_ann as clouds_total
import clouds.yearly_cycle_cldhgh as yrly_high
import clouds.yearly_cycle_cldlow as yrly_low
import clouds.yearly_cycle_cldtot as yrly_total
def run(name, config):
"""
Runs the extension.
Args:
name: The name of the extension
config: A dictionary representation of the configuration file
Returns:
A LIVVkit page element containing the LIVVkit elements to display on a webpage
"""
img_dir = os.path.join(livvkit.output_dir, 'validation', 'imgs', name)
fn.mkdir_p(img_dir)
# PLOTS
img_list = []
img_list.extend(clouds_high.make_plot(config, out_path=img_dir))
img_list.extend(clouds_low.make_plot(config, out_path=img_dir))
img_list.extend(clouds_total.make_plot(config, out_path=img_dir))
img_list.extend(yrly_high.make_plot(config, out_path=img_dir))
img_list.extend(yrly_low.make_plot(config, out_path=img_dir))
img_list.extend(yrly_total.make_plot(config, out_path=img_dir))
element_list = [el.gallery('Figures', img_list)]
ref_bib = utils.bib2html(config['references'])
element_list.append(el.html(' '.join(['<div class="references"><h3>References</h3>',
'If you use this LIVVkit extension for any part of your',
'modeling or analyses, please cite:' + ref_bib + '</div>',
])
))
return el.page(name, __doc__, element_list)
def print_summary(summary):
"""
Print out a summary generated by this module's summarize_result method
"""
raise NotImplementedError
def summarize_result(result):
"""
Provides a snapshot of the extension's results to be provided on the
summary webpage and printed to STDOUT via the print_summary method
"""
raise NotImplementedError
def populate_metadata():
"""
Generates the metadata needed for the output summary page
"""
raise NotImplementedError
{
"energy_cesm" : {
"module" : "energy/energy_cesm.py",
"references" : "energy/energy_cesm.bib",
"references" : "energy/energy_model.bib",
"cesm_atm_climos": "data/cesm/atm",
"cesm_lnd_climos": "data/cesm/lnd",
"cesm_glc_climos": "data/cesm/glc",
......
{
"energy_e3sm" : {
"module" : "energy/energy_e3sm.py",
"references" : "energy/energy_model.bib",
"e3sm_atm_climos": "data/e3sm/atm",
"e3sm_lnd_climos": "data/e3sm/lnd",
"cism_data": "data/cism/glissade",
"racmo_data": "data/racmo",
"image_height" : 300
}
}
# Copyright (c) 2015,2016, UT-BATTELLE, LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""An analysis of E3SM's energy balance over Greenland."""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from collections import OrderedDict
import livvkit
from livvkit.util import elements as el
from livvkit.util import functions as fn
with fn.temp_sys_path(os.path.dirname(__file__)):
import energy.utils as utils
import energy.model_racmo23_albedo as e3sm_albedo
import energy.model_racmo23_latf as e3sm_latf
import energy.model_racmo23_lwsd as e3sm_lwsd
import energy.model_racmo23_lwsn as e3sm_lwsn
import energy.model_racmo23_rnet as e3sm_rnet
import energy.model_racmo23_senf as e3sm_senf
import energy.model_racmo23_smb as e3sm_smb
import energy.model_racmo23_swsd as e3sm_swsd
import energy.model_racmo23_swsn as e3sm_swsn
import energy.model_racmo23_t2m_ann as t2m_ann
import energy.model_racmo23_t2m_djf as t2m_djf
import energy.model_racmo23_t2m_jja as t2m_jja
import energy.rad_aavg_model as e3sm_rad
import energy.rad_aavg_racmo as racmo_rad
import energy.timeseries_trefht as ts_trefht
import energy.timeseries_qice_gt as ts_qice_gt
def run(name, config):
"""
Runs the extension.
Args:
name: The name of the extension
config: A dictionary representation of the configuration file
Returns:
A LIVVkit page element containing the LIVVkit elements to display on a webpage
"""
img_dir = os.path.join(livvkit.output_dir, 'validation', 'imgs', name)
fn.mkdir_p(img_dir)
element_list = []
e3sm_aavg = e3sm_rad.calculate_area_weighted_averages(config)
racmo_aavg = racmo_rad.calculate_area_weighted_averages(config)
table_data = [(key, {'E3SM': e3sm_aavg[key], 'RACMO 2.3': racmo_aavg[key]}) for key in e3sm_aavg.keys()]
table_dict = OrderedDict(table_data)
# FIXME this is using an undocumented LIVVkit table type, developed for EVE.
table_el = {'Type': 'V-H Table',
'Title': 'Validation',
'TableTitle': 'Area weighted averages of energy balance variables.',
'Headers': ['E3SM', 'RACMO 2.3'],
'Data': {'': table_dict}
}
element_list.append(table_el)
img_list = []
img_list.extend(e3sm_albedo.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_latf.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_lwsd.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_lwsn.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_rnet.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_senf.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_smb.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_swsd.make_plot(config, out_path=img_dir))
img_list.extend(e3sm_swsn.make_plot(config, out_path=img_dir))
img_list.extend(t2m_ann.make_plot(config, out_path=img_dir))
img_list.extend(t2m_djf.make_plot(config, out_path=img_dir))
img_list.extend(t2m_jja.make_plot(config, out_path=img_dir))
img_list.extend(ts_trefht.make_plot(config, out_path=img_dir))
img_list.extend(ts_qice_gt.make_plot(config, out_path=img_dir))
element_list.append(el.gallery('Figures', img_list))
ref_bib = utils.bib2html(config['references'])
element_list.append(el.html(' '.join(['<div class="references"><h3>References</h3>',
'If you use this LIVVkit extension for any part of your',
'modeling or analyses, please cite:' + ref_bib + '</div>',
])
))
return el.page(name, __doc__, element_list)
def print_summary(summary):
"""
Print out a summary generated by this module's summarize_result method
"""
raise NotImplementedError
def summarize_result(result):
"""
Provides a snapshot of the extension's results to be provided on the
summary webpage and printed to STDOUT via the print_summary method
"""
raise NotImplementedError
def populate_metadata():
"""
Generates the metadata needed for the output summary page
"""
raise NotImplementedError
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment