Skip to content

Commit

Permalink
Add check to verify is track file is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsoucasse committed Jul 11, 2024
1 parent bdf6e41 commit b894304
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mors/baraffe.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ def BaraffeLoadTrack(Mstar, pre_interp = True, tmin = None, tmax = None):
"/stellar_evolution_tracks/Baraffe/BHAC15-M" +
str(formatted_mass).replace('.', 'p') +
".txt")

if not os.path.isfile(file):
raise Exception(
"Cannot find Baraffe track file %s. "
"Did you set the FWL_DATA environment variable? "
"Did you run the DownloadEvolutionTracks function to get access to the Baraffe track data?"
% file
)

data = np.loadtxt(file,skiprows=1).T

# Parse data
Expand Down

0 comments on commit b894304

Please sign in to comment.