Skip to content

Commit

Permalink
Updating for CRTAF key refactor on main Atom object to lines, continu…
Browse files Browse the repository at this point in the history
…a, collisions
  • Loading branch information
Goobley committed Feb 19, 2024
1 parent ec1d1da commit 21fbef8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lightweaver/crtaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def from_crtaf(model: crtaf.Atom) -> AtomicModel:
S=S,
)
levels[label] = lw_level

crtaf_labels = sorted(crtaf_labels, key=lambda x: levels[x].E)
levels = [levels[l] for l in crtaf_labels]
level_conversion_dict = {label: idx for idx, label in enumerate(crtaf_labels)}

lines = []
for line in model.radiative_bound_bound:
for line in model.lines:
if not isinstance(line, crtaf.VoigtBoundBound):
raise ValueError(f"Unexpected line type encountered {line!r}, can only handle Voigt/PRD-Voigt.")

Expand Down Expand Up @@ -103,10 +103,10 @@ def from_crtaf(model: crtaf.Atom) -> AtomicModel:
broadening=broadening,
)
lines.append(lw_line)


continua = []
for cont in model.radiative_bound_free:
for cont in model.continua:
if isinstance(cont, crtaf.HydrogenicBoundFree):
lw_cont = HydrogenicContinuum(
j=level_conversion_dict[cont.transition[0]],
Expand All @@ -127,7 +127,7 @@ def from_crtaf(model: crtaf.Atom) -> AtomicModel:
continua.append(lw_cont)

collisions = []
for coll in model.collisional_rates:
for coll in model.collisions:
j = level_conversion_dict[coll.transition[0]]
i = level_conversion_dict[coll.transition[1]]
for process in coll.data:
Expand Down

0 comments on commit 21fbef8

Please sign in to comment.