Move units conversion to units.py

This commit is contained in:
XANTRONIX 2025-03-17 22:15:18 -04:00
parent 1b7952b94e
commit a231954de1

View file

@ -3,6 +3,7 @@ import math
from typing import Callable
from xmet.series import Series
from xmet.units import rad, kelvin, celsius
LAPSE_RATE_DRY = 9.8 / 1000 # degrees C per km
@ -11,12 +12,6 @@ PRESSURE_MSL = 1013.25
PRESSURE_MIN = 100
PRESSURE_STEP = 50
def kelvin(c: float) -> float:
return 273.15 + c
def celsius(k: float) -> float:
return k - 273.15
def virtual_temp(temp: float, dewpoint: float, pressure: float) -> float:
a = 7.5 * dewpoint
b = 237.3 + dewpoint