Pyatomdb Relevant Module¶
A series of codes to deal with atomdb data.
Currently used atomdb version: 3.0.9
The temporary version only provides atomic data within [0.01, 100] keV. To check the details, see 2.0.2 release notes in http://www.atomdb.org/download.php
- XIGrM.prepare_pyatomdb.AG89_abundances(atomic_numbers)[source]¶
Get AG89 abundances of the given input atomic numbers. Based on pyatomdb.atomdb.get_abundance().
- XIGrM.prepare_pyatomdb.calculate_continuum_emission(energy_bins, specific_elements=array([], shape=(11, 0), dtype=float64), return_spectra=False)[source]¶
Calculate continuum emissions and cooling rates for individual atoms in atomdb.
- Parameters
- energy_bins
Energy_bins to calculate cooling rates and generate spectra on, must be in keV in the range of [0.01, 100].
- specfic_elements
Atomic numbers of elements to be individually listed in the result. All the other elements in atomdb will also be calculated but will be added together as the last element of the result.
- return_spectra
Whether to return generated spectra.
- Returns
- dict
A dictionary consists of Cooling rates (key: ‘CoolingRate’) and spectra (key: ‘Emissivity’) if chosen contributed by continuum for different elements at different temperatures.
- XIGrM.prepare_pyatomdb.calculate_line_emission(energy_bins, specific_elements=array([], shape=(11, 0), dtype=float64), return_spectra=False)[source]¶
Calculate line emissions and cooling rates for individual atoms in atomdb.
- Parameters
- energy_bins
Energy_bins to calculate cooling rates and generate spectra on, must be in keV in the range of [0.01, 100].
- specfic_elements
Atomic numbers of elements to be individually listed in the result. All the other elements in atomdb will also be calculated but will be added together as the last element of the result.
- return_spectra
Whether to return generated spectra.
- Returns
- dict
A dictionary consists of Cooling rates (key: ‘CoolingRate’) and spectra (key: ‘Emissivity’) if chosen contributed by emission lines for different elements at different temperatures.
- XIGrM.prepare_pyatomdb.elsymbs_to_z0s(elements)[source]¶
Convert element symbols to atomic numbers. Based on pyatomdb.atomic.elsymb_to_z0().
- XIGrM.prepare_pyatomdb.get_atomic_masses(atomic_numbers)[source]¶
Get atomic masses of the input atomic numbers. Based on pyatomdb.atomic.Z_to_mass().
- XIGrM.prepare_pyatomdb.get_index(te, teunits='K', logscale=False)[source]¶
Finds indexes in the calculated table with kT closest ro desired kT.
- Parameters
- tenumpy.ndarray
Temperatures in keV or K
- teunits{‘keV’ , ‘K’}
Units of te (kev or K, default keV)
- logscalebool
Search on a log scale for nearest temperature if set.
- Returns
- numpy.adarray
Indexes in the Temperature list.
- XIGrM.prepare_pyatomdb.load_emissivity_file(filename, specific_elements=None, energy_band=[0.5, 2.0], n_bins=1000)[source]¶
Load the emissivity file calculated based on pyatomdb. If filename can’t be loaded, then will calculate and save the emissivity information based on supplied specific_elements.
- Parameters
- filenamestr
File name of the emissivity file to load.
- specific_elements
List of element symbols to include in calculation. If set to None, will automatically calculate all elements included in pyatomdb.
- energy_band
[min, max] energy range in keV to calculate emissivity within.
- n_binsint
Number of bins when calculating emissivity.