Beispiel #1
0
def t3_plot(data_file, model_file, autosave=False, saveformat='svg', title=None, figsize=(10,10)):
    """Plots the t3 amplitude and residuals along with t3 phase amplitude and residuals
    from the data and model files.
    """

    # read in the data, assert they are of the same size
    data = read_ccoifits_t3(data_file, uv_scale=1E6)
    model = read_ccoifits_t3(model_file, uv_scale=1E6)
    assert(len(data) == len(model))
    
    # create the figure. It will consist of three subplots:
    # A - t3_amplitude
    # B - t3_amplitude residuals
    # C - t3_phase
    # D - t3_phase residuals
    fig, (A, B, C, D) = plt.subplots(4, 1, sharex=True, sharey=False, figsize=figsize)
    
    # Make the plots:
    legend_data, legend_model = plot_t3_amp(data, model, A)
    legend_residuals, legend_lb, legend_ub = plot_t3_amp_residuals(data, model, B)
    plot_t3_phi(data, model, C)
    plot_t3_phi_residuals(data, model, D)
    
    legend = A.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()
Beispiel #2
0
def t3_plot(data_file, model_file, autosave=False, saveformat='svg', title=None, figsize=(10,10)):
    """Plots the t3 amplitude and residuals along with t3 phase amplitude and residuals
    from the data and model files.
    """

    # read in the data, assert they are of the same size
    data = read_ccoifits_t3(data_file, uv_scale=1E6)
    model = read_ccoifits_t3(model_file, uv_scale=1E6)
    assert(len(data) == len(model))
    
    # create the figure. It will consist of three subplots:
    # A - t3_amplitude
    # B - t3_amplitude residuals
    # C - t3_phase
    # D - t3_phase residuals
    fig, (A, B, C, D) = plt.subplots(4, 1, sharex=True, sharey=False, figsize=figsize)
    
    # Make the plots:
    legend_data, legend_model = plot_t3_amp(data, model, A)
    legend_residuals, legend_lb, legend_ub = plot_t3_amp_residuals(data, model, B)
    plot_t3_phi(data, model, C)
    plot_t3_phi_residuals(data, model, D)
    
    legend = A.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()
Beispiel #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()
Beispiel #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()