示例#1
0
def test_plot_disp():
    dl2_df = pd.read_hdf(dl2_file, key=lstcam_key)
    plot_dl2.plot_disp(dl2_df)
                          features_sep)

    test['hadro_rec'] = RFcls_GH.predict(test[features_sep])
    
    if args.storerf==True:
        fileE = args.path_models+"/RFreg_Energy.sav"
        fileD = args.path_models+"/RFreg_Disp.sav"
        fileH = args.path_models+"/RFcls_GH.sav"
        joblib.dump(RFreg_Energy, fileE)
        joblib.dump(RFreg_Disp, fileD)
        joblib.dump(RFcls_GH, fileH)

    
    #Plot some results
    e_cuts = [-1,np.log10(500),np.log10(1000)]
    
    for e_cut in e_cuts:
        test = test[test['e_rec']>e_cut]
        plot_dl2.plot_features(test)
        plt.show()
        plot_dl2.plot_e(test)
        plt.show()
        plot_dl2.plot_disp(test)
        plt.show()
        plot_dl2.plot_pos(test)
        plt.show()
        plot_dl2.plot_importances(RFcls_GH,features_sep)
        plt.show()
        plot_dl2.plot_ROC(RFcls_GH,test,features_sep,e_cut)
        plt.show()
示例#3
0
    #Apply the models to the data
    features = ['intensity',
                'time_gradient',
                'width',
                'length',
                'wl',
                'phi',
                'psi']

    dl2 = reco_dl1_to_dl2.ApplyModels(data, features, RFcls_GH, RFreg_Energy, RFreg_Disp)

    if args.storeresults==True:
        #Store results
        if not os.path.exists(args.outdir):
            os.mkdir(args.outdir)
        outfile = args.outdir+"/dl2_events.hdf5"
        dl2.to_hdf(outfile, key="dl2_events", mode="w")

    #Plot some results
        
    plot_dl2.plot_features(dl2)
    plt.show()
    plot_dl2.plot_e(dl2)
    plt.show()
    plot_dl2.plot_disp(dl2)
    plt.show()
    plot_dl2.plot_pos(dl2)
    plt.show()

    
示例#4
0
def test_plot_disp(simulated_dl2_file):
    dl2_df = pd.read_hdf(simulated_dl2_file, key=dl2_params_lstcam_key)
    plot_dl2.plot_disp(dl2_df)