Skip to content

Commit

Permalink
bail out of no bin files
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Aug 25, 2023
1 parent 004c8ed commit 2d9cd1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plot2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import athena_read
import glob
import os
import sys
import matplotlib.style as mplstyle
from mpl_toolkits.axes_grid1 import make_axes_locatable
#mplstyle.use(['ggplot', 'fast'])
Expand Down Expand Up @@ -201,6 +202,10 @@ def reload_data():
f.sort()
length = len(f)

if length==0:
print("No bin data found")
sys.exit(0)

data = list(range(len(f)))
reload_data()

Expand All @@ -226,7 +231,7 @@ def reload_data():

# getting the variable names
variables = athena_read.bin(f[0],True)
print("tab variables detected:",variables)
print("bin variables detected:",variables)
var_len = len(variables)

# 0-based, change from animate2
Expand Down

0 comments on commit 2d9cd1c

Please sign in to comment.