Skip to content

Commit

Permalink
add linelist exposure to atom data and reader, built on current (#2428)
Browse files Browse the repository at this point in the history
* add linelist exposure to atom data and reader, built on current

* add josh to mailmap
  • Loading branch information
jvshields authored Oct 4, 2023
1 parent 255a45b commit 70fcf0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ John Reichenbach <[email protected]>
Jordi Eguren <[email protected]>
Jordi Eguren <[email protected]> jordi5 <[email protected]>

Josh Shields <[email protected]>

Karan Desai <[email protected]>
Karan Desai <[email protected]> karandesai-96 <[email protected]>

Expand Down
11 changes: 7 additions & 4 deletions tardis/io/atom_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class AtomData(object):
"photoionization_data",
"yg_data",
"two_photon_data",
"linelist",
]

# List of tuples of the related dataframes.
Expand Down Expand Up @@ -165,7 +166,6 @@ def from_hdf(cls, fname=None):
fname = resolve_atom_data_fname(fname)

with pd.HDFStore(fname, "r") as store:

for name in cls.hdf_names:
try:
dataframes[name] = store.select(name)
Expand All @@ -182,7 +182,6 @@ def from_hdf(cls, fname=None):
# Checks for various collisional data from Carsus files
if "collisions_data" in store:
try:

dataframes["collision_data_temperatures"] = store[
"collisions_metadata"
].temperatures
Expand Down Expand Up @@ -211,6 +210,8 @@ def from_hdf(cls, fname=None):
raise ValueError(
f"Current carsus version, {carsus_version}, is not supported."
)
if "linelist" in store:
dataframes["linelist"] = store["linelist"]

atom_data = cls(**dataframes)

Expand Down Expand Up @@ -273,8 +274,8 @@ def __init__(
photoionization_data=None,
yg_data=None,
two_photon_data=None,
linelist=None,
):

self.prepared = False

# CONVERT VALUES TO CGS UNITS
Expand Down Expand Up @@ -333,6 +334,9 @@ def __init__(

self.two_photon_data = two_photon_data

if linelist is not None:
self.linelist = linelist

self._check_related()

self.symbol2atomic_number = OrderedDict(
Expand Down Expand Up @@ -426,7 +430,6 @@ def prepare_atom_data(
self.macro_atom_data_all is not None
and not line_interaction_type == "scatter"
):

self.macro_atom_data = self.macro_atom_data_all.loc[
self.macro_atom_data_all["atomic_number"].isin(
self.selected_atomic_numbers
Expand Down

0 comments on commit 70fcf0b

Please sign in to comment.