@@ -21,6 +21,15 @@ def verify_chunk_without_transitions( self, chunk ) :
2121 self .assertEqual ( False , chunk .has_non_radiative_transitions )
2222 self .assertEqual ( False , chunk .has_transitions )
2323
24+ self .assertEqual ( False , chunk .has_radiative_transition ( ElectronSubshellID ( 'L1' ) ) )
25+ self .assertEqual ( False , chunk .has_radiative_transition ( ElectronSubshellID ( 'L2' ) ) )
26+ self .assertEqual ( False , chunk .has_radiative_transition ( ElectronSubshellID ( 'L3' ) ) )
27+
28+ self .assertEqual ( False , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L1' ) ) )
29+ self .assertEqual ( False , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L2' ) ) )
30+ self .assertEqual ( False , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L3' ) ) )
31+ self .assertEqual ( False , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'M1' ), ElectronSubshellID ( 'L1' ) ) )
32+
2433 self .assertEqual ( 0 , chunk .number_radiative_transitions )
2534 self .assertEqual ( 0 , chunk .number_non_radiative_transitions )
2635 self .assertEqual ( 0 , chunk .number_transitions )
@@ -29,6 +38,8 @@ def verify_chunk_without_transitions( self, chunk ) :
2938
3039 self .assertAlmostEqual ( 0 , chunk .total_radiative_probability )
3140 self .assertAlmostEqual ( 0 , chunk .total_non_radiative_probability )
41+ self .assertAlmostEqual ( 0 , chunk .average_radiative_energy )
42+ self .assertAlmostEqual ( 0 , chunk .average_non_radiative_energy )
3243
3344def verify_chunk ( self , chunk , normalise ) :
3445
@@ -40,6 +51,15 @@ def verify_chunk( self, chunk, normalise ) :
4051 self .assertEqual ( True , chunk .has_non_radiative_transitions )
4152 self .assertEqual ( True , chunk .has_transitions )
4253
54+ self .assertEqual ( False , chunk .has_radiative_transition ( ElectronSubshellID ( 'L1' ) ) )
55+ self .assertEqual ( True , chunk .has_radiative_transition ( ElectronSubshellID ( 'L2' ) ) )
56+ self .assertEqual ( True , chunk .has_radiative_transition ( ElectronSubshellID ( 'L3' ) ) )
57+
58+ self .assertEqual ( True , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L1' ) ) )
59+ self .assertEqual ( True , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L2' ) ) )
60+ self .assertEqual ( True , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L3' ) ) )
61+ self .assertEqual ( False , chunk .has_non_radiative_transition ( ElectronSubshellID ( 'M1' ), ElectronSubshellID ( 'L1' ) ) )
62+
4363 self .assertEqual ( 2 , chunk .number_radiative_transitions )
4464 self .assertEqual ( 6 , chunk .number_non_radiative_transitions )
4565 self .assertEqual ( 8 , chunk .number_transitions )
@@ -48,6 +68,54 @@ def verify_chunk( self, chunk, normalise ) :
4868
4969 normalisation = 1.00000015 if normalise else 1.0
5070
71+ radiative0 = chunk .radiative_transition ( ElectronSubshellID ( 'L2' ) )
72+ radiative1 = chunk .radiative_transition ( ElectronSubshellID ( 'L3' ) )
73+ self .assertEqual ( TransitionType .Radiative , radiative0 .type )
74+ self .assertEqual ( TransitionType .Radiative , radiative1 .type )
75+ self .assertEqual ( ElectronSubshellID ( 'L2' ), radiative0 .originating_shell )
76+ self .assertEqual ( ElectronSubshellID ( 'L3' ), radiative1 .originating_shell )
77+ self .assertAlmostEqual ( 0.00190768 / normalisation , radiative0 .probability )
78+ self .assertAlmostEqual ( 0.00380027 / normalisation , radiative1 .probability )
79+ self .assertAlmostEqual ( 523.09 , radiative0 .energy )
80+ self .assertAlmostEqual ( 523.13 , radiative1 .energy )
81+
82+ nonradiative0 = chunk .non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L1' ) )
83+ nonradiative1 = chunk .non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L2' ) )
84+ nonradiative2 = chunk .non_radiative_transition ( ElectronSubshellID ( 'L1' ), ElectronSubshellID ( 'L3' ) )
85+ nonradiative3 = chunk .non_radiative_transition ( ElectronSubshellID ( 'L2' ), ElectronSubshellID ( 'L2' ) )
86+ nonradiative4 = chunk .non_radiative_transition ( ElectronSubshellID ( 'L2' ), ElectronSubshellID ( 'L3' ) )
87+ nonradiative5 = chunk .non_radiative_transition ( ElectronSubshellID ( 'L3' ), ElectronSubshellID ( 'L3' ) )
88+ self .assertEqual ( TransitionType .NonRadiative , nonradiative0 .type )
89+ self .assertEqual ( TransitionType .NonRadiative , nonradiative1 .type )
90+ self .assertEqual ( TransitionType .NonRadiative , nonradiative2 .type )
91+ self .assertEqual ( TransitionType .NonRadiative , nonradiative3 .type )
92+ self .assertEqual ( TransitionType .NonRadiative , nonradiative4 .type )
93+ self .assertEqual ( TransitionType .NonRadiative , nonradiative5 .type )
94+ self .assertEqual ( ElectronSubshellID ( 'L1' ), nonradiative0 .originating_shell )
95+ self .assertEqual ( ElectronSubshellID ( 'L1' ), nonradiative1 .originating_shell )
96+ self .assertEqual ( ElectronSubshellID ( 'L1' ), nonradiative2 .originating_shell )
97+ self .assertEqual ( ElectronSubshellID ( 'L2' ), nonradiative3 .originating_shell )
98+ self .assertEqual ( ElectronSubshellID ( 'L2' ), nonradiative4 .originating_shell )
99+ self .assertEqual ( ElectronSubshellID ( 'L3' ), nonradiative5 .originating_shell )
100+ self .assertEqual ( ElectronSubshellID ( 'L1' ), nonradiative0 .emitting_shell )
101+ self .assertEqual ( ElectronSubshellID ( 'L2' ), nonradiative1 .emitting_shell )
102+ self .assertEqual ( ElectronSubshellID ( 'L3' ), nonradiative2 .emitting_shell )
103+ self .assertEqual ( ElectronSubshellID ( 'L2' ), nonradiative3 .emitting_shell )
104+ self .assertEqual ( ElectronSubshellID ( 'L3' ), nonradiative4 .emitting_shell )
105+ self .assertEqual ( ElectronSubshellID ( 'L3' ), nonradiative5 .emitting_shell )
106+ self .assertAlmostEqual ( 0.178644 / normalisation , nonradiative0 .probability )
107+ self .assertAlmostEqual ( 0.116224 / normalisation , nonradiative1 .probability )
108+ self .assertAlmostEqual ( 0.230418 / normalisation , nonradiative2 .probability )
109+ self .assertAlmostEqual ( 0.0110822 / normalisation , nonradiative3 .probability )
110+ self .assertAlmostEqual ( 0.291115 / normalisation , nonradiative4 .probability )
111+ self .assertAlmostEqual ( 0.166809 / normalisation , nonradiative5 .probability )
112+ self .assertAlmostEqual ( 478.82 , nonradiative0 .energy )
113+ self .assertAlmostEqual ( 493.86 , nonradiative1 .energy )
114+ self .assertAlmostEqual ( 493.9 , nonradiative2 .energy )
115+ self .assertAlmostEqual ( 508.9 , nonradiative3 .energy )
116+ self .assertAlmostEqual ( 508.94 , nonradiative4 .energy )
117+ self .assertAlmostEqual ( 508.98 , nonradiative5 .energy )
118+
51119 self .assertEqual ( TransitionType .Radiative , chunk .radiative_transitions [0 ].type )
52120 self .assertEqual ( TransitionType .Radiative , chunk .radiative_transitions [1 ].type )
53121 self .assertEqual ( ElectronSubshellID ( 'L2' ), chunk .radiative_transitions [0 ].originating_shell )
@@ -90,6 +158,8 @@ def verify_chunk( self, chunk, normalise ) :
90158
91159 self .assertAlmostEqual ( 0.00570795 / normalisation , chunk .total_radiative_probability )
92160 self .assertAlmostEqual ( 0.9942922 / normalisation , chunk .total_non_radiative_probability )
161+ self .assertAlmostEqual ( 523.116631417584 , chunk .average_radiative_energy )
162+ self .assertAlmostEqual ( 498.286519214372 , chunk .average_non_radiative_energy )
93163
94164class Test_ElectronSubshellConfiguration ( unittest .TestCase ) :
95165 """Unit test for the ElectronSubshellConfiguration class."""
0 commit comments