Commits

Devin Silvia committed 3449b2e

fixing an issue in with running carbon or oxygen networks from CIE.

Comments (0)

Files changed (2)

examples/run_carbon_network.py

     else:
         # Unless neutral is desired, we'll start in a perturbed CIE solution
         import chianti.core as ch
+        import chianti.util as chu
 
         # populate initial fractional values for the species
         for s in sorted(carbon.required_species):
                 if s.name == 'de':
                     continue
                 else:
-                    ion = ch.ion(s.name, temperature=init_values['T'])
+                    ion_name = chu.zion2name(s.number, s.free_electrons + 1)
+                    ion = ch.ion(ion_name, temperature=init_values['T'])
                     ion.ioneqOne()
                     ion_frac = ion.IoneqOne
                     if ion_frac == 0.0:

examples/run_oxygen_network.py

     else:
         # Unless neutral is desired, we'll start in a perturbed CIE solution
         import chianti.core as ch
+        import chianti.util as chu
 
         # populate initial fractional values for the species
         for s in sorted(oxygen.required_species):
                 if s.name == 'de':
                     continue
                 else:
-                    ion = ch.ion(s.name, temperature=init_values['T'])
+                    ion_name = chu.zion2name(s.number, s.free_electrons + 1)
+                    ion = ch.ion(ion_name, temperature=init_values['T'])
                     ion.ioneqOne()
                     ion_frac = ion.IoneqOne
                     if ion_frac == 0.0: