Basic Stellar Modeling Process with PySEP

This code snippet demonstrates the process of creating a basic stellar model using the PySEP (Python Stellar Evolution Package) library. It includes loading high temperature opacity files, generating a model output directory, and evolving the model over time. The snippet also shows how to sort and utilize additional opacity files from a specified directory, adjusting the model's control parameters for the simulation.

from pysep.api.starting import get_basic_stellar_model
from pysep.dm.filetypes import opacf_file
 
import os
 
highTempOpacityFile = "/mnt/p/d/Astronomy/GraduateSchool/Thesis/GCConsistency/NGC2808/inputs/opac/popA_ngc2808_Y+0.24_opac"
opac = opacf_file(highTempOpacityFile)
 
model = get_basic_stellar_model("./modelOutput", opac=opac)
 
opecalex = [os.path.abspath(os.path.join("./aesopus", x)) for x in os.listdir("./aesopus")]
opecalex = sorted(opecalex, key=lambda x: float(f"0.{os.path.basename(x).split('.')[1]}"))
model.control['opecalex'] = opecalex
 
 
# model.control[1]['endage'] = 5e9
 
model.evolve()
model.stash(data=True)