def test_plot_data(save_pdf=False, verbose=verbose): """ This function try to make the dataplot (As and Omegas) for any of the available atoms """ plt.ion() atom_list = pn.atomicData.getAllAtoms() atom_list.remove('3He2') for atom in atom_list: if verbose: print('Doing {0}'.format(atom)) dp = pn.DataPlot(atom=atom, OmegaInterp='Linear') dp.atom_n_max = np.min((dp.atom_n_max, 7)) if len(dp.atom_data) > 1: if verbose: print('Plotting {0}'.format(atom)) dp.plotAllA(save=save_pdf) plt.close() dp.coll_n_max = np.min((dp.coll_n_max, 7)) if len(dp.coll_data) > 1: if verbose: print('Plotting {0}'.format(atom)) dp.plotOmega(save=save_pdf) plt.close()
def p5(): # this will plot all the available data in pyneb for the omegas ions = [ 'C2', 'C3', 'N2', 'N3', 'O2', 'O3', 'O4', 'Ne2', 'Ne3', 'Ne5', 'S2', 'S3', 'S4', 'Cl3', 'Ar2', 'Ar3', 'Ar4', 'Ar5', ] for ion in ions: # split ion into elem and spec, e.g 'O3' into 'O' and 3 elem, spec = parseAtom(ion) # instanciate the corresponding Atom object atom = pn.Atom(elem, spec) # print information including transition probabilities #atom.printIonic(printA = True) dp = pn.DataPlot(elem, spec) dp.plotOmega(save=True)
O2.getEnergy(2) # energy of first excited level (ground = 1) in Angstrom^-1 O2.getA(2, 1) # transition probability of 2->1 # set temperature and density tem = 15000. den = 1000. O2.getPopulations(tem, den) # compute populations O2.getCritDensity(tem, level=2) # critical density of level 2 at tem O2.getOmega(tem, 2, 1) # effective collision strength of transition 2->1 at T=10000K O2.getOmegaArray( 2, 1) # array of effective collision strengths for 2->1 as a function of T O2.getTemArray() # print array of temperatures of tabulated Omegas O2.getCollRates(tem) # print collisional Rates at T=tem # This bit calls the script DataPlot.py to plot atomic data. dataplot = pn.DataPlot('O', 3) dataplot.plotA() # transition probabilities plot dataplot.plotRelA() # relative transition probabilities plot dataplot.plotOmega() # collision strength plot # customize atomic data # First step: check which directories are searched for atomic data files pn.atomicData.getAllDataFilePaths() # Add your selected directory to the list pn.atomicData.addDataFilePath('./') # Check if it's been added pn.atomicData.getAllDataFilePaths() # Remove it if you gave the wrong dir pn.atomicData.removeDataFilePath('./') # Set 'o_iii_TEST.fits' to be the OIII atom file pn.atomicData.setDataFile('o_iii_TEST.fits', 'O3', 'atom')
def p7b(): dataplot = pn.DataPlot('O', 3) # defines the ion for which atomic data data will be plotted dataplot.plotOmega() # plots the omega values in the range where they are calculated by atomic physics