summaryrefslogtreecommitdiff
path: root/szilagyi/__init__.py
blob: 5f365e198703fb794523c67a704ff21133a7b738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from ._nomogram import calculate_swi as _calculate_swi


def calculate_swi(temperature_difference, convective_cloud_depth):
	"""
	Calculates the Szilagyi Waterspout Index for *temperature_difference* and *convective_cloud_depth*.

	May raise :exc:`ValueError` if the values are not in range of the original nomogram.
	"""
	if temperature_difference < 0 or temperature_difference > 40:
		raise ValueError("temperature_difference must be within <0, 40> range")
	if convective_cloud_depth < 0 or convective_cloud_depth > 50000:
		raise ValueError("convective_cloud_depth must be within <0, 50000> range")
	return _calculate_swi(temperature_difference, convective_cloud_depth)