Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add molecular data exposure to tardis atom data #2806

Merged
merged 13 commits into from
Aug 22, 2024
43 changes: 43 additions & 0 deletions tardis/io/atom_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@
columns: atomic_number, element, Rad energy, Rad intensity decay mode.
Curated from nndc

molecular_equilibrium_constants : pandas.DataFrame
A DataFrame containing the *molecular equilibrium constants* with:
index: molecule
columns: temperatures

molecular_partition_functions : pandas.DataFrame
A DataFrame containing the *molecular partition functions* with:
index: molecule
columns: temperatures

molecular_dissociation_energies : pandas.DataFrame
A DataFrame containing the *molecular dissociation energies* with:
index: molecule


Attributes
----------
prepared : bool
Expand All @@ -116,6 +131,9 @@
photoionization_data : pandas.DataFrame
two_photon_data : pandas.DataFrame
decay_radiation_data : pandas.DataFrame
molecular_equilibrium_constants : pandas.DataFrame
molecular_partition_functions : pandas.DataFrame
molecular_dissociation_energies : pandas.DataFrame

Methods
-------
Expand Down Expand Up @@ -221,6 +239,17 @@
if "linelist" in store:
dataframes["linelist"] = store["linelist"]

if "molecules" in store:
dataframes["molecular_equilibrium_constants"] = store[
"molecules/equilibrium_constants"

Check warning on line 244 in tardis/io/atom_data/base.py

View check run for this annotation

Codecov / codecov/patch

tardis/io/atom_data/base.py#L244

Added line #L244 was not covered by tests
]
dataframes["molecular_partition_functions"] = store[
"molecules/partition_functions"

Check warning on line 247 in tardis/io/atom_data/base.py

View check run for this annotation

Codecov / codecov/patch

tardis/io/atom_data/base.py#L247

Added line #L247 was not covered by tests
]
dataframes["molecular_dissociation_energies"] = store[
"molecules/dissociation_energies"

Check warning on line 250 in tardis/io/atom_data/base.py

View check run for this annotation

Codecov / codecov/patch

tardis/io/atom_data/base.py#L250

Added line #L250 was not covered by tests
]

atom_data = cls(**dataframes)

try:
Expand Down Expand Up @@ -284,6 +313,9 @@
two_photon_data=None,
linelist=None,
decay_radiation_data=None,
molecular_equilibrium_constants=None,
molecular_partition_functions=None,
molecular_dissociation_energies=None,
):
self.prepared = False

Expand Down Expand Up @@ -346,6 +378,17 @@
if linelist is not None:
self.linelist = linelist

if molecular_equilibrium_constants is not None:
self.molecular_equilibrium_constants = (
molecular_equilibrium_constants
)
if molecular_partition_functions is not None:
self.molecular_partition_functions = molecular_partition_functions
if molecular_dissociation_energies is not None:
self.molecular_dissociation_energies = (
molecular_dissociation_energies
)

if decay_radiation_data is not None:
self.decay_radiation_data = decay_radiation_data
self._check_related()
Expand Down
Loading