def test_add_pressure_to_height(array_type): """Test the height at pressure above height calculation.""" mask = [False, True, False] height_in = array_type([110.8286757, 250., 500.], 'meter', mask=mask) pressure = array_type([100., 200., 300.], 'hPa', mask=mask) height_out = add_pressure_to_height(height_in, pressure) truth = array_type([987.971601, 2114.957, 3534.348], 'meter', mask=mask) assert_array_almost_equal(height_out, truth, 3)
def test_add_pressure_to_height(): """Test the height at pressure above height calculation.""" height = add_pressure_to_height(110.8286757 * units.m, 100 * units.hPa) assert_almost_equal(height, 988.0028867 * units.meter, 5)