From 1474791cb35734aab3cdf8c052aa75fb157b33de Mon Sep 17 00:00:00 2001 From: Aarya Chaumal Date: Thu, 10 Aug 2023 23:12:35 +0530 Subject: [PATCH] Update benchmark setup --- benchmarks/run_stardis.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/benchmarks/run_stardis.py b/benchmarks/run_stardis.py index 55ff3041..7a65c67c 100644 --- a/benchmarks/run_stardis.py +++ b/benchmarks/run_stardis.py @@ -9,7 +9,7 @@ from tardis.io.config_validator import validate_yaml from tardis.io.config_reader import Configuration -from stardis.model import read_marcs_to_fv +from stardis.io.model.marcs import read_marcs_model from stardis.plasma import create_stellar_plasma from stardis.opacities import calc_alphas from stardis.transport import raytrace @@ -37,12 +37,26 @@ def setup(self): adata = AtomData.from_hdf(config.atom_data) - stellar_model = read_marcs_to_fv( - config.model.fname, - adata, - final_atomic_number=config.model.final_atomic_number, + if config.model.type == "marcs": + raw_marcs_model = read_marcs_model(config.model.fname, gzipped=False) + stellar_model = raw_marcs_model.to_stellar_model( + adata, final_atomic_number=config.model.final_atomic_number + ) + + adata.prepare_atom_data( + np.arange( + 1, + np.min( + [ + len( + stellar_model.composition.atomic_mass_fraction.columns.tolist() + ), + config.model.final_atomic_number, + ] + ) + + 1, + ) ) - adata.prepare_atom_data(stellar_model.abundances.index.tolist()) stellar_plasma = create_stellar_plasma(stellar_model, adata)