summaryrefslogtreecommitdiff
path: root/szilagyi/plots.py
blob: 44782d6047faca21cd383f869ee74843ad03f2f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os

import matplotlib.pyplot as plot

from . import _dataset
from .nomogram import *


def grid(start, end, steps):
	step = (end - start) / steps
	i = start
	while i <= end:
		yield i
		i += step


if __name__ == "__main__":
	C = []
	X = list(grid(0, 40, 1000))
	Y = list(grid(0, 50000, 1000))
	for y_scaled in range(0, 1000):
		y = y_scaled * 50
		row = []
		for x_scaled in range(0, 1000):
			x = x_scaled / 25
			try:
				swi = calculate_swi(x, y)
			except (IndexError, RuntimeError):
				swi = -10
			row.append(swi)
		C.append(row)
	plot.pcolormesh(X, Y, C, cmap='viridis', vmin=-10, vmax=10, rasterized=True)
	for _, data in _dataset.INDICES:
		plot.plot([x.x for x in data], [x.y for x in data])
	plot.show()