Skip to content

Commit

Permalink
Fix data paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsoucasse committed Aug 20, 2024
1 parent 6485b69 commit ee75c50
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mors/stellarevo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Parameters for stellar evolution models

# Directory for stellar evolution models
starEvoDirDefault = str(FWL_DATA_DIR /'stellar_evolution_tracks'/'Spada'/'fs255_grid'/)
starEvoDirDefault = str(FWL_DATA_DIR /'stellar_evolution_tracks'/'Spada'/'fs255_grid')

# Set which set of models to use, i.e. which X, Z, and A values (set to X0p70952_Z0p01631_A1p875 for closest to solar)
evoModelsDefault = "X0p70952_Z0p01631_A1p875"
Expand Down Expand Up @@ -194,7 +194,7 @@ def _shouldCompileNew(starEvoDir,evoModels):
compileNew = True

# Check if previously compiled models already exist
if ( os.path.isfile(starEvoDir+evoModels+".pickle") ):
if ( os.path.isfile(starEvoDir+"/"+evoModels+".pickle") ):
compileNew = False

return compileNew
Expand Down Expand Up @@ -223,7 +223,7 @@ def _CompileNewGrid(starEvoDir,evoModels):
ModelData[MstarAll[iMstar]] = _ReadEvolutionTrack( starEvoDir , evoModels , MstarAll[iMstar] , MstarFilenameMiddle[iMstar] )

# Save compiled models
with open(starEvoDir+evoModels+".pickle",'wb') as f:
with open(starEvoDir+"/"+evoModels+".pickle",'wb') as f:
pickle.dump(ModelData,f)


Expand All @@ -233,7 +233,7 @@ def _ReadEvolutionTrack(starEvoDir,evoModels,Mstar,MstarFilenameMiddle):
"""Loads the stellar evolution models from Spada et al. (2013) for a mass bin and puts it into a dictionary."""

# Set strings for starting and ending of filenames
filename_prefix = starEvoDir + evoModels + "/M"
filename_prefix = starEvoDir + "/" + evoModels + "/M"
filename_postfix1 = "_" + evoModels + ".track1"
filename_postfix2 = "_" + evoModels + ".track2"

Expand Down Expand Up @@ -415,7 +415,7 @@ def _LoadSavedGrid(starEvoDir,evoModels):
"""Takes filename for stellar evo model, returns grid of models."""

# Simply load data
with open(starEvoDir+evoModels+".pickle",'rb') as f:
with open(starEvoDir+"/"+evoModels+".pickle",'rb') as f:
ModelData = pickle.load(f)

return ModelData
Expand Down

0 comments on commit ee75c50

Please sign in to comment.