def setUp(self): ad1 = atomic.element('carbon') ad2 = atomic.element('li') eq1 = atomic.CollRadEquilibrium(ad1) eq2 = atomic.CollRadEquilibrium(ad2) te = np.logspace(0, 3, 50) ne = 1e19 self.y1 = eq1.ionisation_stage_distribution(te, ne) self.y2 = eq2.ionisation_stage_distribution(te, ne)
def setUp(self): ad = atomic.element('li') eq = atomic.CollRadEquilibrium(ad) self.temperature = np.logspace(0, 3, 50) self.electron_density = 1e19 # y is a FractionalAbundance object. y = eq.ionisation_stage_distribution(self.temperature, self.electron_density) self.elc = atomic.ElectronCooling(y, neutral_fraction=1e-2)
def setUp(self): """This is more of an Integration Test than a unit test.""" self.ad = atomic.element('Li') self.eq = atomic.CollRadEquilibrium(self.ad)
# an electron density of 1e19 m^(-3), and with infinite particle lifetime # (\tau = infinity). # This uses the ADAS scd and acd files to determine the ionisation stage # abundances, and then uses the plt, prb, and prc files to give the amount # of line radiation, recombination / brehmstrahlung, and charge-exchange # radiation for the computed ionisation stage abundances, temperatures, # and densities. # Note that the neutral_fraction which specifies the amount of neutral H # present effects the radiation (via cx_power), but charge exchange # processes on the ionisation stage balance are not modeled. import numpy as np import atomic ad = atomic.element('carbon') eq = atomic.CollRadEquilibrium(ad) temperature = np.logspace(0, 3, 50) electron_density = 1e19 # y is a FractionalAbundance object. y = eq.ionisation_stage_distribution(temperature, electron_density) rad = atomic.Radiation(y, neutral_fraction=1e-2) import matplotlib.pyplot as plt plt.figure(10) plt.clf() lines = rad.plot() customize = True
import numpy as np import matplotlib.pyplot as plt import atomic elements = ['Li', 'C', 'N', 'Ne', 'Ar'] temperature_ranges = { 'Li': np.logspace(-1, 3, 300), 'C': np.logspace(0, 3, 300), 'N': np.logspace(0, 3, 300), 'Ne': np.logspace(0, 4, 300), 'Ar': np.logspace(0, 5, 300), } for element in elements: ad = atomic.element(element) collrad = atomic.CollRadEquilibrium(ad) temperature = temperature_ranges.get(element, np.logspace(0, 3, 300)) y = collrad.ionisation_stage_distribution(temperature, density=1e19) plt.figure() y.plot_vs_temperature() #plt.savefig('collrad_equilibrium_%s.pdf' % element) plt.show()