Skip to content

Commit

Permalink
Update readtanakajpltdata.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Dec 18, 2024
1 parent ad76b66 commit b5c9d92
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions artisatomic/readtanakajpltdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ def read_levels_and_transitions(atomic_number, ion_stage, flog):
# dflevels = pd.concat(reader, ignore_index=True)

dflevels = artisatomic.add_dummy_zero_level(
pl.from_pandas(reader.get_chunk(levelcount)).with_columns(pl.col("g").cast(pl.Float64))
pl.from_pandas(reader.get_chunk(levelcount)).with_columns(
pl.col("g").cast(pl.Float64),
levelname=pl.format(
"{},{},{}", pl.col("num"), pl.col("parity"), pl.col("configuration").str.strip_chars()
),
)
)
# print(dflevels)

Expand All @@ -88,10 +93,9 @@ def read_levels_and_transitions(atomic_number, ion_stage, flog):
parity = 1 if row["parity"].strip() == "odd" else 0
energyabovegsinpercm = float(row["energy_ev"] / hc_in_ev_cm)

levelname = f"{row['num']},{row['parity']},{row['configuration'].strip()}"
energy_levels.append(
EnergyLevel(
levelname=levelname, parity=parity, g=row["g"], energyabovegsinpercm=energyabovegsinpercm
levelname=row["levelname"], parity=parity, g=row["g"], energyabovegsinpercm=energyabovegsinpercm
)
)

Expand Down

0 comments on commit b5c9d92

Please sign in to comment.