def parsenums(linestring):
    """converts strings like '1-10; 15-17' into a list of ph0001.fits, ph0002.fits, etc"""
    ans = []
    first=linestring.split(';')
    for thing in first:
        ans= ans + (list(range(
                    int(thing.split('-')[0]), 
                    int(thing.split('-')[1])+1)))

    return ['ph'+str(x).zfill(4)+'.fits' for x in ans]