radis.api.kuruczapi module

Summary

Kurucz database parser

Based largely on the Exojax code

class KuruczDatabaseManager(name, molecule, local_databases, engine='default', verbose=True, parallel=True)[source]

Bases: DatabaseManager

fetch_urlnames()[source]

returns the possible urls of the desired linelist file, pending confirmation upon attempting download as to which is correct

get_possible_files(urlnames=None)[source]

returns the urls from fetch_urlnames and the derived file paths at which each would be saved after downloading and parsing

parse_to_local_file(opener, urlname, local_file, pbar_active=True, pbar_t0=0, pbar_Ntot_estimate_factor=None, pbar_Nlines_already=0, pbar_last=True)[source]

overwrites parent class method as required

register(get_main_files)[source]
get_atomic_number(species)[source]

Extracts the atomic number from the species given in spectroscopic notation

get_ionization_state(species)[source]

Extracts the ionization state from the species given in spectroscopic notation

pick_ionE(ielem, charge)[source]

Pick out the ionization energy of a specific atomic species from NIST.

Parameters:
  • ielem (int) – atomic number (e.g., Fe=26)

  • charge (int) – charge of the species

Returns:

ionE – ionization energy

Return type:

float

read_kurucz(kuruczf, preserve_orig_levels=False)[source]

Parse a Kurucz linelist, process its columns as required, and return as a Pandas DataFrame

Inspired by: https://github.com/rasmus98/NLTE-Helium/blob/fc6161a30ebecfcf59f36386b1dc7f02ff749905/Grotrian_diagram_Helium.ipynb cell 2. Also see:

Parameters:
  • kuruczf (str) – file path

  • preserve_orig_levels (boolean) – whether to preserve the original columns pertaining to the levels prior to transforming them, with ‘_orig’ appended to their name; note the columns are still reversed so that the database index increases in wavenumber rather than wavelength

Return type:

Pandas DataFrame containing the required columns for the Kurucz linelist database