mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/SPATZ.git
synced 2025-06-10 01:55:59 +00:00
73 lines
1.6 KiB
Python
73 lines
1.6 KiB
Python
import numpy as np
|
|
|
|
from spatz.simulations.advanceable import Advanceable
|
|
|
|
from numpy.typing import NDArray
|
|
from abc import abstractmethod
|
|
from typing import Literal
|
|
|
|
from ambiance import Atmosphere
|
|
|
|
|
|
class DataSource(Advanceable):
|
|
def __init__(self) -> None:
|
|
super().__init__()
|
|
|
|
def get_speed_of_sound(self) -> float:
|
|
return Atmosphere(self.get_altitude()).speed_of_sound
|
|
|
|
def get_mach_number(self) -> float:
|
|
speed = np.linalg.norm(self.get_velocity('global'))
|
|
|
|
return speed / self.get_speed_of_sound()
|
|
|
|
def get_temperature(self) -> float:
|
|
return Atmosphere(self.get_altitude()).temperature
|
|
|
|
@abstractmethod
|
|
def get_length(self) -> float:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_position(self) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_velocity(self, frame: Literal['global', 'local']) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_acceleration(self, frame: Literal['global', 'local']) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_attitude(self) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def local_to_global(self) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def global_to_local(self) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_angular_velocity(self) -> NDArray:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_static_pressure(self) -> float:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_longitude(self) -> float:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_latitude(self) -> float:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_altitude(self) -> float:
|
|
pass |