Skip to content

ARES snr #75

Description

@MariaTsantaki

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.
:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions