Better atmosphere model

This commit is contained in:
dario 2024-04-21 22:16:42 +02:00
parent d1f24f0201
commit cadfb29272

View File

@ -2,6 +2,7 @@ from typing import Any
import numpy as np
from enum import Enum
from ambiance import Atmosphere
class PressUnit:
@ -42,3 +43,11 @@ class AltitudeModel:
press = to_hpa[unit]
return 44330 * (1 - (press / self.__press_0)**(1 / 5.255))
class StandardAtmosphere:
def __init__(self) -> None:
pass
def predict(self, press: float, unit: PressUnit = PressUnit.Pa) -> float:
return Atmosphere.from_pressure(press).h[0]