Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
updated tcc with simc contour values (addressing #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
brancomat committed Jun 22, 2018
1 parent 59a63bd commit 23fa62d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
18 changes: 12 additions & 6 deletions json_fields/mm_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,22 @@
"magic_func": "mcont",
"contour": "off",
"contour_highlight": "off",
"contour_hilo": "off",
"contour_interpolation_ceiling": 8.0,
"contour_label": "off",
"contour_level_list": [0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0],
"contour_level_selection_type": "level_list",
"contour_level_list": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
"contour_level_selection_type": "list",
"contour_shade": "on",
"contour_shade_max_level_colour": "rgba(192,192,192,0.7)",
"contour_shade_min_level_colour": "rgba(255,255,255,0.0)",
"contour_shade_colour_list": [ "rgb(0.96,0.96,1.0)", "rgb(0.88,0.89,0.95)",
"rgb(0.8,0.83,0.9)", "rgb(0.72,0.76,0.86)",
"rgb(0.64,0.69,0.81)", "rgb(0.56,0.62,0.76)",
"rgb(0.49,0.56,0.71)"],
"contour_shade_colour_method": "list",
"contour_shade_method": "area_fill",
"contour_shade_technique": "polygon_shading",
"contour_shade_max_level": 8.0,
"contour_shade_min_level": 1.0,
"legend": "on"},

"hcc": {"nameECMF": "High Cloud Cover",
"magic_func": "mcont",
"contour": "off",
Expand Down
12 changes: 11 additions & 1 deletion json_fields/plot_grib.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ def get_grib_metadata(filename, shortname, level=None):
scaling_offset=-273.15
units = '°C'

# precipitations should be in mm
# converting total cloud cover for cosmo in okta
if units == '%' and grib_get_or_none(gid, "cfVarName") == 'tcc':
scaling_factor = 0.08
units = 'okta'

# converting total cloud cover for ifs-ecmwf in okta
if units == '(0 - 1)' and grib_get_or_none(gid, "cfVarName") == 'tcc':
scaling_factor = 8.0
units = 'okta'

# converting precipitations in mm
if units == 'm' and grib_get_or_none(gid, "cfVarName") != 'hzerocl':
scaling_factor = 0.001
units = 'mm'
Expand Down

0 comments on commit 23fa62d

Please sign in to comment.