Exemplo n.º 1
0
 def test_pt_hs_k_param(self):
     pthsk = pt_hs_k.PTHSKParameter()
     self.assertIsNotNone(pthsk)
     self.assertEqual(pthsk.size(), 10)
     pthsk.snow.lw = 0.23
     self.assertAlmostEqual(pthsk.snow.lw, 0.23)
     snow = api.HbvSnowParameter(tx=0.2)  # orderded .. keyword does work now! TODO: verify if we can have boost provide real kwargs
     self.assertIsNotNone(snow)
     snow.lw = 0.2
     self.assertAlmostEqual(snow.lw, 0.2);
Exemplo n.º 2
0
 def test_pt_hs_k_param(self):
     pthsk_size = 12
     pthsk = pt_hs_k.PTHSKParameter()
     self.assertIsNotNone(pthsk)
     self.assertEqual(pthsk.size(), pthsk_size)
     pthsk.hs.lw = 0.23
     self.assertAlmostEqual(pthsk.hs.lw, 0.23)
     snow = api.HbvSnowParameter(
         tx=0.2
     )  # ordered .. keyword does work now! TODO: verify if we can have boost provide real kwargs
     self.assertIsNotNone(snow)
     snow.lw = 0.2
     self.assertAlmostEqual(snow.lw, 0.2)
     valid_names = [
         "kirchner.c1", "kirchner.c2", "kirchner.c3", "ae.ae_scale_factor",
         "hs.lw", "hs.tx", "hs.cx", "hs.ts", "hs.cfr",
         "p_corr.scale_factor", "pt.albedo", "pt.alpha"
     ]
     self.verify_parameter_for_calibration(pthsk, pthsk_size, valid_names)