def test2_geometric2geopotential(): z = 86000.0 h = geometric2geopotential(z) expected_h = 84854.57642868205 assert_almost_equal(h, expected_h)
def test1_geometric2geopotential(): z = 0.0 h = geometric2geopotential(z) expected_h = 0.0 assert_almost_equal(h, expected_h)
def update(self, state): """Update atmosphere state for the given system state. Parameters ---------- state : System object System object with attribute alt_geop (geopotential altitude. Returns ------- T : float Temperature (K). p : float Pressure (Pa). rho : float Density (kg/m³) a : float Sound speed at flight level (m/s) Raises ------ ValueError If the value of the altitude is outside the defined layers. Notes ----- Check layers and reference values in [2]. References ---------- .. [1] U.S. Standard Atmosphere, 1976, U.S. Government Printing Office, Washington, D.C., 1976 .. [2] https://en.wikipedia.org/wiki/U.S._Standard_Atmosphere """ # Geopotential altitude self._geopotential_alt = geometric2geopotential(state.position.height) T, p, rho, a = self.__call__(self._geopotential_alt) self._T = T self._p = p self._rho = rho self._a = a