1 from builtins
import object
8 from full_physics
import *
10 from nose.plugins.skip
import Skip, SkipTest
12 if(
not have_full_physics_swig):
18 '''This class uses pressure sigma levels to determine the pressure 19 levels we do the RT on.''' 20 def __init__(self, a, b, surface_pressure, pressure_flag = True):
21 coef = np.array([surface_pressure])
22 flag = np.array([pressure_flag])
23 PressureImpBase.__init__(self,coef, flag)
28 res = PressureSigma(self.
a, self.
b,
29 self.coefficient().
value()[0],
30 self.used_flag_value()[0])
34 t = self.
b * self.coefficient()[0] + self.
a 35 self.pgrid.reference(np_to_array_ad(t))
38 return "Surface Pressure (Pascals)" 41 '''Function just to make sure we have an object this type.''' 51 ''' %(self.coefficient().
value()[0], self.used_flag_value()[0].__str__(),
52 self.
a.__str__(), self.
b.__str__())
55 '''Test returning a C++ class''' 56 if(
not have_full_physics_swig):
58 psigma = PressureSigma([0,0,0], [0.3, 0.6, 1.0], 10,
True)
59 pwrap = PressureHolder(psigma)
61 assert_almost_equal(pwrap.p.b, [0.3, 0.6, 1.0])
62 pinp = PressureLevelInput([1, 2, 3])
63 plevel = PressureFixedLevel(
False, pinp, 2.5)
66 assert pwrap.p.number_active_level == 3
68 @raises(AttributeError)
70 '''Test returning a C++ class''' 71 if(
not have_full_physics_swig):
73 psigma = PressureSigma([0,0,0], [0.3, 0.6, 1.0], 10,
True)
74 pwrap = PressureHolder(psigma)
75 pinp = PressureLevelInput([1, 2, 3])
76 plevel = PressureFixedLevel(
False, pinp, 2.5)
82 '''Make sure we handle classes that are actually python correctly.''' 83 if(
not have_full_physics_swig):
86 pwrap = PressureHolder(psigma)
87 assert pwrap.p.my_func() == 102
def state_vector_name_i(self, i)
def test_cast_cpp_excep()
def calc_pressure_grid(self)
double value(const FullPhysics::AutoDerivative< double > &Ad)
def __init__(self, a, b, surface_pressure, pressure_flag=True)