summaryrefslogtreecommitdiff
path: root/szilagyi/plots.py
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-09-08 18:40:56 +0200
committerAki <please@ignore.pl>2022-09-08 18:40:56 +0200
commitb5600cca811eabb5a731380d07f30ffabffe6ce1 (patch)
treecf983432f42379e9050b76500a0c679ff7aa4e11 /szilagyi/plots.py
parent53ea2c8356f1d849f907343344c20b7a6c855ca7 (diff)
downloadszilagyi-b5600cca811eabb5a731380d07f30ffabffe6ce1.zip
szilagyi-b5600cca811eabb5a731380d07f30ffabffe6ce1.tar.gz
szilagyi-b5600cca811eabb5a731380d07f30ffabffe6ce1.tar.bz2
Defined maximums for the nomogram in the nomogram module
Diffstat (limited to 'szilagyi/plots.py')
-rw-r--r--szilagyi/plots.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/szilagyi/plots.py b/szilagyi/plots.py
index b21a07b..924eeee 100644
--- a/szilagyi/plots.py
+++ b/szilagyi/plots.py
@@ -3,11 +3,8 @@ import math
import matplotlib.pyplot as plot
from . import _dataset
-from ._nomogram import calculate_swi
-
-
-MAX_X = 40
-MAX_Y = 50000
+from ._nomogram import calculate_swi as _calculate_swi
+from ._nomogram import MAX_TEMPERATURE_DIFFERENCE, MAX_CONVECTIVE_CLOUD_DEPTH
def _grid(start, end, steps):
@@ -26,12 +23,12 @@ def _scaled_range(steps, maximum):
def colorful(width=1000, height=1000):
C = []
- X = list(_grid(0, MAX_X, width))
- Y = list(_grid(0, MAX_Y, height))
- for y in _scaled_range(height, MAX_Y):
+ X = list(_grid(0, MAX_TEMPERATURE_DIFFERENCE, width))
+ Y = list(_grid(0, MAX_CONVECTIVE_CLOUD_DEPTH, height))
+ for y in _scaled_range(height, MAX_CONVECTIVE_CLOUD_DEPTH):
row = []
- for x in _scaled_range(width, MAX_X):
- row.append(calculate_swi(x, y))
+ for x in _scaled_range(width, MAX_TEMPERATURE_DIFFERENCE):
+ row.append(_calculate_swi(x, y))
C.append(row)
plot.pcolormesh(X, Y, C, cmap='viridis', vmin=-10, vmax=10, rasterized=True)
for _, data in _dataset.INDICES: