Beispiel #1
0
def spectra_ranges(qsos):
    x, y = [[] for i in range(8)], [[] for i in range(8)]
    tab = []
    color = ["indigo", "green", "red", "cyan", "orange", "yellow", "black", "pink"]
    for i, qso in enumerate(qsos):
        y1 = first_non_masked(qso.wlen)
        y2 = first_non_masked(qso.wlen[::-1])

        z = int(np.rint(qso.z))
        x[z].append([i, i])
        y[z].append([y1, y2])
    for z, coordinates in enumerate(x):
        if coordinates:
            title = "Spectrum ranges for Quasars with z~" + str(z)
            p = figure(plot_width=975, plot_height=300, y_range=(0, 8000), title=title)
            p.multi_line(x[z], y[z], color=color[z])

            p.xaxis.axis_label = "nth QSO"
            p.xaxis.axis_label_text_font_size = "10pt"
            p.yaxis.axis_label = "Wavelength(A)"
            p.yaxis.axis_label_text_font_size = "10pt"
            p.yaxis.axis_label_standoff = 15

            title = "z~" + str(z)
            tab.append(Panel(child=p, title=title))
    tabs = Tabs(tabs=tab)
    show(tabs)
Beispiel #2
0
def filter_by_range(qsos,vi_min,vi_max):
    filtered = []
    for qso in qsos:
        wlen_min = first_non_masked(qso.wlen)
        wlen_max = first_non_masked(qso.wlen[::-1])

        if wlen_min <= vi_min and wlen_max >= vi_max:
            filtered.append(qso)
    return filtered