Commit 0d37948c authored by Plaszczynski Stephane's avatar Plaszczynski Stephane

add error message to bestbestfit.py when file does not have 2 lines

parent 8e632697
......@@ -13,6 +13,10 @@ for dir in sys.argv[1:]:
chi2min=sys.float_info.max
data=np.zeros(1)
for bf in bestfits:
nlines=len(open(bf).readlines())
if nlines != 2:
print("invalid bestfit file:{} (skipping)".format(bf))
continue
if not header:
with open(bf,'r') as f:
line = f.readline().rstrip()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment