Example #1
0
def v2_plot(data_file, model_file, autosave=False, saveformat='svg', title=None, figsize=(10,5)):
    """Plots the v2 data from the data file and model file.
    """

    # read in the data, assert they are of the same size
    data = read_ccoifits_v2(data_file, uv_scale=1E6)
    model = read_ccoifits_v2(model_file, uv_scale=1E6)
    assert(len(data) == len(model))
    
    # create the figure
    fig, (top, bottom) = plt.subplots(2, 1, sharex=True, sharey=False, figsize=figsize)
    
    legend_data, legend_model = plot_v2(data, model, top)
    legend_residuals, legend_lb, legend_ub = plot_v2_residuals(data, model, bottom)
    
    legend = top.legend([legend_data, legend_model, legend_residuals, legend_lb, legend_ub], 
        ["Data", "Model", "Residuals", 'Lower', 'Higher'], numpoints=1, 
        loc='upper center', bbox_to_anchor=(0.5, 0.05), ncol=5)
        
    legend.draw_frame(False)
    
    if autosave:
        save_plot(data_file, saveformat=saveformat)
    else:
        plt.show()
Example #2
0
def v2_plot(data_file, model_file, autosave=False, saveformat='svg', title=None, figsize=(10,5)):
    """Plots the v2 data from the data file and model file.
    """

    # read in the data, assert they are of the same size
    data = read_ccoifits_v2(data_file, uv_scale=1E6)
    model = read_ccoifits_v2(model_file, uv_scale=1E6)
    assert(len(data) == len(model))
    
    # create the figure
    fig, (top, bottom) = plt.subplots(2, 1, sharex=True, sharey=False, figsize=figsize)
    
    legend_data, legend_model = plot_v2(data, model, top)
    legend_residuals, legend_lb, legend_ub = plot_v2_residuals(data, model, bottom)
    
    legend = top.legend([legend_data, legend_model, legend_residuals, legend_lb, legend_ub], 
        ["Data", "Model", "Residuals", 'Lower', 'Higher'], numpoints=1, 
        loc='upper center', bbox_to_anchor=(0.5, 0.05), ncol=5)
        
    legend.draw_frame(False)
    
    if autosave:
        save_plot(data_file, saveformat=saveformat)
    else:
        plt.show()
Example #3
0
def plot_uv(v2_filename, t3_filename, autosave=False, saveformat='svg', figsize=(10,10)):
    """Creates a UV plot from SIMTOI/ccoifits text exports
    """
    
    # read in the data files:
    v2 = read_ccoifits_v2(v2_filename, uv_scale=1E6)
    t3 = read_ccoifits_t3(t3_filename, uv_scale=1E6)
    
    fig = plt.figure(figsize=figsize)
    ax1 = fig.add_subplot(1,1,1, aspect='equal')
    
    # plot the in the v-u plane:
    ax1.scatter( v2['v'],  v2['u'], c='green', marker='s', label="V2")
    ax1.scatter(-v2['v'], -v2['u'], c='green', marker='s')
    
    # now the t3:
    ax1.scatter( t3['v1'],  t3['u1'], c='red', marker='x', label="T3")
    ax1.scatter(-t3['v1'], -t3['u1'], c='red', marker='x')    
    ax1.scatter( t3['v2'],  t3['u2'], c='red', marker='x')
    ax1.scatter(-t3['v2'], -t3['u2'], c='red', marker='x')   
    ax1.scatter( t3['v3'],  t3['u3'], c='red', marker='x')
    ax1.scatter(-t3['v3'], -t3['u3'], c='red', marker='x')   
    
    ax1.grid(True)
    ax1.set_ylabel("V (mega-$\lambda$)")
    ax1.set_xlabel("U (mega-$\lambda$)")
    ax1.legend(numpoints=1)       
    
    
    if autosave:
        save_plot(data_file, saveformat=saveformat)
    else:
        plt.show()
Example #4
0
def plot_uv(v2_filename, t3_filename, autosave=False, saveformat='svg', figsize=(10,10)):
    """Creates a UV plot from SIMTOI/ccoifits text exports
    """
    
    # read in the data files:
    v2 = read_ccoifits_v2(v2_filename, uv_scale=1E6)
    t3 = read_ccoifits_t3(t3_filename, uv_scale=1E6)
    
    fig = plt.figure(figsize=figsize)
    ax1 = fig.add_subplot(1,1,1, aspect='equal')
    
    # plot the in the v-u plane:
    ax1.scatter( v2['v'],  v2['u'], c='green', marker='s', label="V2")
    ax1.scatter(-v2['v'], -v2['u'], c='green', marker='s')
    
    # now the t3:
    ax1.scatter( t3['v1'],  t3['u1'], c='red', marker='x', label="T3")
    ax1.scatter(-t3['v1'], -t3['u1'], c='red', marker='x')    
    ax1.scatter( t3['v2'],  t3['u2'], c='red', marker='x')
    ax1.scatter(-t3['v2'], -t3['u2'], c='red', marker='x')   
    ax1.scatter( t3['v3'],  t3['u3'], c='red', marker='x')
    ax1.scatter(-t3['v3'], -t3['u3'], c='red', marker='x')   
    
    ax1.grid(True)
    ax1.set_ylabel("V (mega-$\lambda$)")
    ax1.set_xlabel("U (mega-$\lambda$)")
    ax1.legend(numpoints=1)       
    
    
    if autosave:
        save_plot(data_file, saveformat=saveformat)
    else:
        plt.show()