From 66e4f4102e59022d174643eaf65c9dec0c56eb60 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Fri, 9 Feb 2024 13:21:05 +0000 Subject: [PATCH] Update spectra.py --- artistools/spectra/spectra.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/artistools/spectra/spectra.py b/artistools/spectra/spectra.py index c58235f83..384975d2b 100644 --- a/artistools/spectra/spectra.py +++ b/artistools/spectra/spectra.py @@ -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 @@ -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 @@ -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")