VALD

VALD is a database of atomic and molecular transitions used to create accurate synthetic spectra of many astrophysical systems. More information, as well as linelists can be downloaded from the VALD website.

In this example, data was downloaded from the VALD website and extracted to /tmp/vald_sample_linelist.dat

NOTE:

[1]:
from carsus.io.vald import VALDReader
[2]:
vald_reader = VALDReader(fname='/tmp/vald_sample_linelist.dat')

Table information is parsed to a dataframe which can be accesed via the .vald attribute. The column information is described in https://articles.adsabs.harvard.edu/pdf/1995A%26AS..112..525P and is as follows:

Wavelength - either air or vacuum and in nanometers or angstroms: Wavelength of the line

log_gf: Log10 of the oscillator strength times the degeneracy of the lower level

e_low: Excitation energy of the lower level in ergs

j_lo: Principal quantum number of the lower level

e_up: Excitation energy of the upper level in ergs

j_up: Principal quantum number of the upper level

lande_lower: Lande factor of the lower level

lande_upper: Lande factor of the upper level

lande_mean: Mean lande factor

rad: log10 of the radiation damping constant in \((4\pi s)^{-1}\)

stark: log10 of the Stark damping constant at 10,000K in \((4\pi s N_e)^{-1}\)

waals: log10 of the Van Der Waals damping constant at 10,000K in \((4\pi s N_H)^{-1}\)

[3]:
vald_reader.vald_raw
[        carsus.io.vald.vald][   INFO] - Parsing VALD from: /tmp/vald_sample_linelist.dat (vald.py:163)
[        carsus.io.vald.vald][   INFO] - Found wavelength column header: WL_air(A) (vald.py:181)
[3]:
elm_ion WL_air(A) log_gf e_low j_lo e_up j_up lande_lower lande_upper lande_mean rad stark waals
0 'TiO 1' 4100.0002 -11.472 0.2011 31.0 3.2242 32.0 99.0 99.0 99.0 6.962 0.0 0.0
1 'TiO 1' 4100.0003 -4.037 0.7439 16.0 3.7670 15.0 99.0 99.0 99.0 7.264 0.0 0.0
2 'TiO 1' 4100.0005 -10.188 0.6244 88.0 3.6475 87.0 99.0 99.0 99.0 6.911 0.0 0.0
3 'TiO 1' 4100.0005 -9.915 0.0601 30.0 3.0832 31.0 99.0 99.0 99.0 4.830 0.0 0.0
4 'TiO 1' 4100.0008 -0.314 1.8211 139.0 4.8443 139.0 99.0 99.0 99.0 7.874 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ... ... ...
46858 'TiO 1' 4109.9989 -2.319 2.1318 161.0 5.1476 161.0 99.0 99.0 99.0 7.920 0.0 0.0
46859 'TiO 1' 4109.9991 -2.276 0.3773 44.0 3.3931 43.0 99.0 99.0 99.0 7.296 0.0 0.0
46860 'TiO 1' 4109.9995 -2.498 2.6005 135.0 5.6163 134.0 99.0 99.0 99.0 7.422 0.0 0.0
46861 'TiO 1' 4110.0000 -6.429 0.6188 75.0 3.6346 76.0 99.0 99.0 99.0 7.459 0.0 0.0
46862 'TiO 1' 4110.0000 -5.638 0.4544 56.0 3.4702 55.0 99.0 99.0 99.0 7.289 0.0 0.0

46863 rows × 13 columns

The reader parses the raw data and splits it into two linelist dataframes, either atomic or molecular.

Linelists only carry along the specific relevant information necessary to compute opacities. They can be accesed with the .linelist_atoms or .linelist_molecules attributes.

Note that the wavelengths here are reformated to Angstroms and in vacuum wavelengths.

[4]:
vald_reader.linelist_atoms
[                py.warnings][WARNING] - /home/shield90/miniconda3/envs/carsus/lib/python3.7/site-packages/pandas/core/indexing.py:845: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self.obj[key] = _infer_fill_value(value)
 (warnings.py:110)
[                py.warnings][WARNING] - /home/shield90/miniconda3/envs/carsus/lib/python3.7/site-packages/pandas/core/indexing.py:966: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  self.obj[item] = s
 (warnings.py:110)
[                py.warnings][WARNING] - /home/shield90/miniconda3/envs/carsus/lib/python3.7/site-packages/pandas/core/frame.py:4133: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  errors=errors,
 (warnings.py:110)
[4]:
atomic_number ion_charge wavelength log_gf e_low e_up j_lo j_up rad stark waals
0 25 1 4101.162586 -1.169 8.1293 11.1524 2.0 3.0 8.70 -6.47 -7.860
1 26 1 4101.200426 -5.992 10.4673 13.4904 1.5 2.5 8.94 -5.86 -7.630
2 22 2 4101.201266 -0.440 16.8273 19.8504 2.0 1.0 9.48 -5.99 -7.710
3 2 1 4101.205217 -0.725 51.0168 54.0399 3.5 4.5 10.00 0.00 0.000
4 26 2 4101.206318 -7.287 15.2375 18.2606 2.0 1.0 9.47 -6.35 -7.850
... ... ... ... ... ... ... ... ... ... ... ...
990 24 0 4111.108321 -5.428 3.8470 6.8628 2.0 3.0 8.10 -6.16 -7.750
991 7 0 4111.108811 -1.227 10.6900 13.7058 1.5 2.5 0.00 0.00 -7.419
992 20 0 4111.113052 -2.671 4.6244 7.6402 2.0 1.0 7.47 -2.75 -6.710
993 29 1 4111.127586 -4.848 13.9360 16.9518 5.0 5.0 8.44 -5.18 -7.500
994 24 0 4111.141449 -3.441 4.5351 7.5509 4.0 3.0 7.61 -4.43 -7.320

995 rows × 11 columns

[5]:
vald_reader.linelist_molecules
[5]:
molecule ion_charge wavelength log_gf e_low e_up j_lo j_up rad stark waals
0 TiO 0 4101.157405 -11.472 0.2011 3.2242 31.0 32.0 6.962 0.0 0.0
1 TiO 0 4101.157505 -4.037 0.7439 3.7670 16.0 15.0 7.264 0.0 0.0
2 TiO 0 4101.157705 -10.188 0.6244 3.6475 88.0 87.0 6.911 0.0 0.0
3 TiO 0 4101.157705 -9.915 0.0601 3.0832 30.0 31.0 4.830 0.0 0.0
4 TiO 0 4101.158005 -0.314 1.8211 4.8443 139.0 139.0 7.874 0.0 0.0
... ... ... ... ... ... ... ... ... ... ... ...
46858 TiO 0 4111.158724 -2.319 2.1318 5.1476 161.0 161.0 7.920 0.0 0.0
46859 TiO 0 4111.158924 -2.276 0.3773 3.3931 44.0 43.0 7.296 0.0 0.0
46860 TiO 0 4111.159324 -2.498 2.6005 5.6163 135.0 134.0 7.422 0.0 0.0
46861 TiO 0 4111.159824 -6.429 0.6188 3.6346 75.0 76.0 7.459 0.0 0.0
46862 TiO 0 4111.159824 -5.638 0.4544 3.4702 56.0 55.0 7.289 0.0 0.0

45868 rows × 11 columns

[ ]: