aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-09-23 23:49:47 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-09-23 23:49:47 +0200
commitba741f1c2e0e6a9c90c1eedf0caca6bd68b41c57 (patch)
tree9e32b57b261000ddb7f647c3cbeaa907a3e30ca3
parent459b4665e436a23a55202ccdfdaf5b3bb9c83416 (diff)
downloadmeteo_toolbox-ba741f1c2e0e6a9c90c1eedf0caca6bd68b41c57.tar.gz
add custom gpm and gpdm units
metpy's gpm is defined as m, we need the correct 9.81 * J/kg
-rwxr-xr-xrun.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/run.py b/run.py
index 7439bfb..9ba7024 100755
--- a/run.py
+++ b/run.py
@@ -4,6 +4,13 @@ import sys
import yaml
import matplotlib.pyplot as plt
+from metpy.units import units
+
+# Define custom gpm and gpdm units. The default gpm in metpy is aliased to meter.
+# We need the correct definition
+units.define('_gpm = 9.80665 * J/kg')
+units.define('_gpdm = 10 * _gpm')
+
FILE = 'config.yaml'
if len(sys.argv) > 1:
FILE = sys.argv[1]