Example #1
0
 def test_time_evolution_non_negative(self):
     isotope = PQ.Isotope(29, "Si")
     data = {
         "det1":
         OrderedDict([(isotope, StoredData(PQ.ProductionYield(10., 2.)))])
     }
     config = {"irr_time": "1 m", "cool_time": "10 y"}
     time_evo = TimeEvolution(**config)
     time_evo.invoke(data)
     self.assertTrue(data["det1"][PQ.Isotope(29, "Si", 0)]
                     ["ProductionYield"] >= PQ.ProductionYield(0.))
Example #2
0
 def test_time_evolution_simple(self):
     isotope = PQ.Isotope(3, 1, 0)
     data = {
         "det1":
         OrderedDict([(isotope, StoredData(PQ.ProductionYield(10., 2.)))])
     }
     time_evo = TimeEvolution(**self.config)
     time_evo.invoke(data)
     res = (1 - exp(-log(2) * PQ.Time(1, unit=ureg.year) / _dh._hl[isotope])) \
           * exp(-log(2) * PQ.Time(1, unit=ureg.year)/ _dh._hl[isotope]) * PQ.ProductionYield(10., 2.)
     self.assertEqual(data["det1"][PQ.Isotope(3, 1, 0)]["ProductionYield"],
                      res)
 def test_dict_multiplication_global_data(self):
     d = {
         "type": "scalar",
         "multiplier": "ProductionYield",
         "multiplicand": "global:NoOfPrimaries",
         "product": "Activity"
     }
     _global_data.add("NoOfPrimaries", 10.)
     data = {
         "det1":
         OrderedDict([(PQ.Isotope(3, 1, 0),
                       StoredData(PQ.ProductionYield(10., 0.)))])
     }
     mul_op = MultiplicationOperator(**d)
     mul_op.invoke(data)
     res = {
         "det1":
         OrderedDict([(PQ.Isotope(3, 1, 0),
                       StoredData(PQ.ProductionYield(10., 0.),
                                  PQ.Activity(100., 0.)))])
     }
     self.assertEqual(data, res)
 def test_production_yield_create(self):
     prod_yield = PQ.ProductionYield(10., 2.)
     res = ureg.Quantity(10., 1./ureg.second)
     self.assertEqual(prod_yield.val, res)