To get the snr, fasma reads the logARES.txt:
with open(fname, 'r') as lines:
for line in lines:
if line.startswith('S/N'):
break
line = line.strip('\n').split(':')
snr = int(float(line[1]))
However, it crashes for very metal poor stars were there are a few lines.
The error was:
Traceback (most recent call last):
File "aresDriver.py", line 323, in <module>
_ = aresdriver(starLines=cfgfile)
File "aresDriver.py", line 305, in aresdriver
aresRunner(line_list, spectrum, out, options)
File "aresDriver.py", line 235, in aresRunner
make_linelist('rawLinelist/'+linelist, 'linelist/'+out, cut=options['EWcut'])
File "aresDriver.py", line 77, in make_linelist
snr = get_snr()
File "aresDriver.py", line 53, in get_snr
snr = int(float(line[1]))
IndexError: list index out of range
ARES could not find that line.
I added this and it works:
with open(fname, 'r') as lines:
for line in lines:
if line.startswith('S/N'):
break
if line.startswith('Rejt used for computations:'):
break
line = line.strip('\n').split(':')
snr = int(float(line[1]))
I didn't commit in case I messed up.
:)
To get the snr, fasma reads the logARES.txt:
However, it crashes for very metal poor stars were there are a few lines.
The error was:
ARES could not find that line.
I added this and it works:
I didn't commit in case I messed up.
:)