Пример #1
0
def plot_snr_scatter(cv, foreground, background, lodm, hidm, marker_dms,
                     fallback):
    '''
    Add SNR versus DM scatter plot pulsetrain diagnostic plot.

    Note: for internal use, call the diagnostic.plot() function in stead.
    '''
    pc2 = PlotContainer(740, 150, 300, 600, data_padding=PADDING)
    pc2.right.hide_label()
    pc2.right.hide_tickmarklabels()
    pc2.left.hide_label()
    pc2.left.hide_tickmarklabels()
    pc2.bottom.hide_label()
    pc2.top.set_label('SNR')
    scp2 = ScatterPlotter([x[1] for x in foreground],
                          [x[0] for x in foreground], color='red')
    scp3 = ScatterPlotter([x[1] for x in background],
                          [x[0] for x in background], color='black')
    pc2.add(scp3, fallback)
    pc2.add(scp2, fallback)
    pc2.set_minimum_y_range(lodm, hidm)
    for m_dm in marker_dms:
        if lodm <= m_dm <= hidm:
            pc2.add(YLimitPlotter(m_dm, color='orange'))
    cv.add(pc2)
Пример #2
0
def plot_count_histogram(cv, dms, foreground, background, lodm, hidm,
                         marker_dms):
    '''
    Add candidates per DM histogram to pulse train diagnostic.

    Note: for internal use, call the diagnostic.plot() function in stead.
    '''
    # Determine the brp style histogram bins:
    fg_bins, bg_bins, total_bins = \
        bin_candidates(dms, foreground, background, lodm, hidm)

    # Plot histogram of number of detections per DM trial
    pc3 = PlotContainer(950, 150, 300, 600, data_padding=PADDING)
    pc3.left.hide_label()
    pc3.left.hide_tickmarklabels()
    pc3.bottom.hide_label()
    pc3.top.set_label('N')
    pc3.add(HistogramPlotter(bg_bins, orientation='vertical', color='black'))
    pc3.add(HistogramPlotter(total_bins, orientation='vertical', color='gray'))
    pc3.add(HistogramPlotter(fg_bins, orientation='vertical', color='red'))
    pc3.right.set_label('DM')
    pc3.set_minimum_y_range(lodm, hidm)

    for m_dm in marker_dms:
        if lodm <= m_dm <= hidm:
            pc3.add(YLimitPlotter(m_dm, color='orange'))

    cv.add(pc3)
Пример #3
0
def plot_main_panel(cv, foreground, background, lodm, hidm, marker_dms,
                    fallback):
    '''
    Add main panel to pulsetrain diagnostic plot.

    Note: for internal use, call the diagnostic.plot() function in stead.
    '''
    # Main panel, detections on the time-DM plane
    pc1 = PlotContainer(0, 150, 830, 600, data_padding=PADDING)
    pc1.right.hide_label()
    pc1.right.hide_tickmarklabels()
    pc1.bottom.hide_label()
    pc1.left.set_label('DM')
    pc1.top.set_label('Time (s)')
    pc1.add(DetectionPlotterTuples(background, color='black'), fallback)
    pc1.add(DetectionPlotterTuples(foreground, color='red'), fallback)
    pc1.set_minimum_y_range(lodm, hidm)

    for m_dm in marker_dms:
        if lodm <= m_dm <= hidm:
            pc1.add(YLimitPlotter(m_dm, color='orange'))

    cv.add(pc1)