예제 #1
0
def asas(text):
    to_del = (29, 99, 99, 99)
    const = 2450000
    s = get_without(text.split("\n"))
    for x in range(len(s)):
        s[x - 1] = s[x - 1].split(" ")
    for element in s:
        clear_list(element)
    p = s
    out = []
    for s in p:
        try:
            p2 = {
                s[6]: s[1],
                s[7]: s[2],
                s[8]: s[3],
                s[9]: s[4],
                s[10]: s[5],
            }
            # creating float because we need sum, and can't use int()
            x = float(s[0]) + const
            # converting float to string, because we need string for myformat()
            x = str(x)
            if x in to_del:
                continue
            out.append((x, p2[min(p2.keys())]))
        except IndexError:
            pass
    out2 = []
    for line in out:
        if '29.999' in line or '99.999' in line:
            continue
        out2.append(line)
    return myformat(clear_list(out2))
예제 #2
0
def catalina(text):
    out = []
    to_add = 2400000.5
    text = text.split("\n")
    del text[0]
    del text[-1]
    for line in text:
        line = line.split(",")
        mjd = float(line[-2]) + to_add
        mag = line[1]
        mjd = str(mjd)
        out.append((mjd, mag))
    return myformat(clear_list(out))
예제 #3
0
def nsvs(text):
    const = 2450000.5
    a = []
    text = text.split("\n")
    for x in range(len(text)):
        text[x] = text[x].split("\t")
    try:
        for line in text:
            x = []
            s = float(line[0])
            x.append(str(s + const))
            x.append(str(round(float(line[1]), 3)))
            a.append(x)
    except (IndexError, ValueError):
        pass
    return myformat(a)
예제 #4
0
def integral(text):
    const = 2451544.5
    a = []
    text = text.split("\n")
    for x in range(len(text)):
        text[x] = text[x].split(" ")
    for el in text:
        clear_list(el)
    try:
        for line in text:
            x = []
            s = float(line[0])
            x.append(str(s + const))
            x.append(str(round(float(line[1]), 3)))
            a.append(x)
    except (IndexError, ValueError):
        pass
    return myformat(a)
예제 #5
0
def munipac(text):
    to_del = ("9.9999", "99.9999")
    text = text.split("\n")
    for x in range(len(text)):
        text[x - 1] = text[x - 1].split(" ")
    del text[0]
    del text[0]
    for y in range(len(text)):
        try:
            for x in range(len(text[y - 1])):
                if text[y - 1][x - 1] in to_del:
                    del text[y - 1]
                    break
        except IndexError:
            pass
    for el in text:
        while len(el) > 2:
            del el[2]
    return myformat(clear_list(text))