Skip to content

Commit

Permalink
Update spectra.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Feb 9, 2024
1 parent 72a7cc5 commit 66e4f41
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions artistools/spectra/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,14 +823,14 @@ def get_emprocesslabel(emtype: int) -> str:

if groupby == "terms":
upper_config = (
adata.query("Z == @line.atomic_number and ionstage == @line.ionstage", inplace=False)
adata.query("Z == @line['atomic_number'] and ionstage == @line['ionstage']", inplace=False)
.iloc[0]
.levels.iloc[line["upperlevelindex"]]
.levelname
)
upper_term_noj = upper_config.split("_")[-1].split("[")[0]
lower_config = (
adata.query("Z == @line.atomic_number and ionstage == @line.ionstage", inplace=False)
adata.query("Z == @line['atomic_number'] and ionstage == @line['ionstage']", inplace=False)
.iloc[0]
.levels.iloc[line["lowerlevelindex"]]
.levelname
Expand All @@ -840,7 +840,7 @@ def get_emprocesslabel(emtype: int) -> str:

if groupby == "upperterm":
upper_config = (
adata.query("Z == @line.atomic_number and ionstage == @line.ionstage", inplace=False)
adata.query("Z == @line['atomic_number'] and ionstage == @line['ionstage']", inplace=False)
.iloc[0]
.levels.iloc[line["upperlevelindex"]]
.levelname
Expand Down Expand Up @@ -890,6 +890,7 @@ def get_absprocesslabel(abstype: int) -> str:
pl.col("nu_rf").is_between(float(nu_min), float(nu_max))
| pl.col("absorption_freq").is_between(float(nu_min), float(nu_max))
)

if getemission:
lzdfpackets = lzdfpackets.with_columns(
pl.col(emtypecolumn).map_elements(lambda x: get_emprocesslabel(x)).alias("emissiontype_str")
Expand Down

0 comments on commit 66e4f41

Please sign in to comment.