aboutsummaryrefslogtreecommitdiff
path: root/run.py
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-10-19 00:32:28 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-10-19 00:32:28 +0200
commitf94fbf99dc0bf9fd8d5d8b2181636d6fd2d007e4 (patch)
treed88543fbc4a6fac4a3093ae95f11daf3597504ce /run.py
parent436a3d3eaebcca11d8da6d8b1bb4f6f543e135e4 (diff)
downloadmeteo_toolbox-f94fbf99dc0bf9fd8d5d8b2181636d6fd2d007e4.tar.gz
first wip meteogram
Diffstat (limited to 'run.py')
-rwxr-xr-xrun.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/run.py b/run.py
index fa0f598..d0a004a 100755
--- a/run.py
+++ b/run.py
@@ -4,6 +4,8 @@ import sys
import yaml
import json
import matplotlib.pyplot as plt
+import matplotlib as mpl
+from matplotlib.colors import LinearSegmentedColormap
from metpy.units import units
@@ -12,6 +14,27 @@ from metpy.units import units
units.define('_gpm = 9.80665 * J/kg')
units.define('_gpdm = 10 * _gpm')
+# Define custom colormap
+clcov_cmap = {
+ 'red': (
+ (0.0, 0.0, 0.0),
+ (0.1, 0.9, 0.9),
+ (1.0, 0.3, 0.3),
+ ),
+ 'green': (
+ (0.0, 0.5, 0.5),
+ (0.1, 0.9, 0.9),
+ (1.0, 0.3, 0.3),
+ ),
+ 'blue': (
+ (0.0, 0.9, 0.9),
+ (0.1, 0.9, 0.9),
+ (1.0, 0.3, 0.3),
+ ),
+}
+
+mpl.colormaps.register(LinearSegmentedColormap('clcov', clcov_cmap))
+
FILE = 'config.yaml'
if len(sys.argv) > 1:
FILE = sys.argv[1]