From 6a76f98f65b32f84ef9051a6d49b7fd3d8fd8451 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 4 May 2022 16:15:43 -0400 Subject: [PATCH] Revert "Removing Levels Index Variable Within Atomic Data Preperation (#1957)" This reverts commit 507c50f382ba1e07441e549edcebce3c7216211e. --- tardis/io/atom_data/base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tardis/io/atom_data/base.py b/tardis/io/atom_data/base.py index e8758a5b0d8..28cd820da31 100644 --- a/tardis/io/atom_data/base.py +++ b/tardis/io/atom_data/base.py @@ -330,6 +330,10 @@ def prepare_atom_data( self.nlte_species = nlte_species + self.levels_index = pd.Series( + np.arange(len(self.levels), dtype=int), index=self.levels.index + ) + # cutting levels_lines self.lines = self.lines[ self.lines.index.isin( @@ -348,10 +352,22 @@ def prepare_atom_data( "level_number_upper" ) + self.lines_lower2level_idx = ( + self.levels_index.loc[tmp_lines_lower2level_idx] + .astype(np.int64) + .values + ) + tmp_lines_upper2level_idx = self.lines.index.droplevel( "level_number_lower" ) + self.lines_upper2level_idx = ( + self.levels_index.loc[tmp_lines_upper2level_idx] + .astype(np.int64) + .values + ) + if ( self.macro_atom_data_all is not None and not line_interaction_type == "scatter"