Пример #1
0
def allsky_survey(pointing_file, save_suffix):
    dir= os.path.dirname(__file__)
    savedir = os.path.join(dir, '../../data/allsky_test/')


    # FOV Dimensions
    FOV_Dim=(2048*6.2/3600)*(pi/180) # Base Dimension
    FOV_phi=FOV_Dim*2
    FOV_theta=FOV_Dim
    Nstrip=21 # Number of strips on each band of FOV 
    skymap = SkyMap(nside=2**9,LVF_theta=FOV_theta, LVF_phi=FOV_phi, cap_theta=pi, Nstrips=Nstrip, lambda_min1=.75, lambda_min2=1.25) 

    pointings1 = read_in_date(pointing_file)
    

    days = np.unique(pointings1[:,0])
   
    # Initializations
    skyplot1=SkyPlots2()
    fig_sub, ax_sub= plt.subplots(3, 4, subplot_kw=dict(projection="mollweide"))        
    sub_ind=0
    subplot_days=[91, 182, 273, 365]
    plot_days=[1,2,3]
    plot_lambda_ranges=[(.75,2.40),(.75,.76),(1.30,1.33),(2.33,2.34)]


    for day in days:
        points_in=map(tuple, pointings1[ pointings1[:,0]==day, 1:4] )

        for i, tupler in enumerate(points_in):
            print "day:%s, step:%s" %(day, i)
            skymap.make_dicts(day, tupler )

        if day in plot_days:
            for j,tupler in enumerate(plot_lambda_ranges):
                fig1, ax1= plt.subplots(1,1, subplot_kw=dict(projection="mollweide"))        
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict, lambda_min=tupler[0] ,lambda_max=tupler[1])
                
                scat, Nhits=redu_allsky( ax1, redu_mat2, redu_dict2)

                fig1.colorbar(scat)
                fig1.set_size_inches(20,10)
                fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %(day, Nhits, tupler[0], tupler[1]) )        

                savename2="allsky_time_%s_%s" %(day,tupler)
                plt.savefig( savedir + "%s.png" %(savename2) )   


        if day in subplot_days:
            redu_mat1, redu_dict1=redu_data(skymap.lambda_dict, .75, 5)
            for j in [0,1,2]:
                redu_allsky( ax_sub[j,sub_ind], redu_mat1, redu_dict1)
            sub_ind+=1

    subplot_proposal1( fig_sub, ax_sub)
    fig_sub.savefig( savedir + "%s.png" %("MultiPanel") )   
    
    # Save Dictionary
    skymap.save_lambda_dict(save_suffix)
Пример #2
0
def deepsky_date_survey(save_suffix):

    dir = os.path.dirname(__file__)
    savedir = os.path.join(dir, '../../data/deepsky_test/date1_s1/')

    # FOV Dimensions
    FOV_Dim = (2048 * 6.2 / 3600) * (pi / 180)  # Base Dimension
    FOV_phi = FOV_Dim * 2
    FOV_theta = FOV_Dim

    # Pointings

    pointings1 = gen_deepskydate1_points()

    #pointings1=np.array([[1.0, pi/36,0, 0],
    #                    [1.0, pi/62, 0, 0]])

    days = np.unique(pointings1[:, 0])

    # Initializations
    skymap = SkyMap(nside=2**10,
                    LVF_theta=FOV_theta,
                    LVF_phi=FOV_phi,
                    cap_theta=pi / 4)
    skyplot1 = SkyPlots2()
    fig_sub, ax_sub = plt.subplots(1, 4, subplot_kw=dict(polar=True))
    sub_ind = 0
    subplot_days = [1, 91, 182, 365]
    #subplot_days=[1,3,7,10]
    plot_days = [1, 3, 45, 91, 130, 182, 230, 290, 365]
    #plot_days=[1,2,3,7,10]
    plot_lambda_ranges = [(.75, 2.34), (.75, .76), (1.30, 1.33), (2.26, 2.34)]

    for day in days:
        points_in = map(tuple, pointings1[pointings1[:, 0] == day, 1:4])

        for i, tupler in enumerate(points_in):
            print "day:%s, step:%s" % (day, i)
            skymap.make_dicts(day, tupler)

        if day in plot_days:
            for j, tupler in enumerate(plot_lambda_ranges):
                fig1, ax1 = plt.subplots(1, 1, subplot_kw=dict(polar=True))
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict,
                                                  lambda_min=tupler[0],
                                                  lambda_max=tupler[1])

                scat, Nhits = redu_deepsky(ax1, redu_mat2, redu_dict2)

                fig1.colorbar(scat)
                fig1.set_size_inches(20, 10)
                fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %
                              (day, Nhits, tupler[0], tupler[1]))

                savename2 = "date1_s1_%s_%s" % (day, tupler)
                plt.savefig(savedir + "%s.png" % (savename2))

        if day in subplot_days:
            redu_mat1, redu_dict1 = redu_data(skymap.lambda_dict, .75, 5)
            redu_deepsky(ax_sub[sub_ind], redu_mat1, redu_dict1)
            sub_ind += 1

    subplot_proposal1(fig_sub, ax_sub)
    fig_sub.savefig(savedir + "%s.png" % ("MultiPanel_date1_s1"))
Пример #3
0
def deepsky_date_survey(save_suffix, gen_name, rel_save_location):

    dir = os.path.dirname(__file__)
    savedir = os.path.join(dir, rel_save_location)

    # FOV Dimensions
    FOV_Dim = (2048 * 6.2 / 3600) * (pi / 180)  # Base Dimension
    FOV_phi = FOV_Dim * 2
    FOV_theta = FOV_Dim

    # Pointings

    pointings1 = gen_deepskydate1_points()
    #pointings1=np.array([[1.0, pi/36, 0, 0]])

    days = np.unique(pointings1[:, 0])

    # Initializations
    skymap = SkyMap(nside=2**9,
                    LVF_theta=FOV_theta,
                    LVF_phi=FOV_phi,
                    cap_theta=15 * pi / 180)
    skyplot1 = SkyPlots2()
    fig_sub, ax_sub = plt.subplots(1, 4, subplot_kw=dict(polar=True))
    sub_ind = 0
    subplot_days = [91, 182, 273, 364]
    #subplot_days=[1,3,7,10]
    plot_days = [1, 2, 3, 4, 5, 6, 91, 182, 273, 364]
    #plot_days=[1,2,3,7,10]
    plot_lambda_ranges = [(.75, 2.34), (.75, .76), (1.30, 1.33), (2.26, 2.34)]

    for day in days:
        points_in = map(tuple, pointings1[pointings1[:, 0] == day, 1:4])

        for i, tupler in enumerate(points_in):
            print "day:%s, step:%s" % (day, i)
            skymap.make_dicts(day, tupler)

        if day in plot_days:
            for j, tupler in enumerate(plot_lambda_ranges):
                fig1, ax1 = plt.subplots(1, 1, subplot_kw=dict(polar=True))
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict,
                                                  lambda_min=tupler[0],
                                                  lambda_max=tupler[1])

                scat, Nhits = redu_deepsky(ax1, redu_mat2, redu_dict2)

                fig1.colorbar(scat)
                fig1.set_size_inches(20, 15)
                fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %
                              (day, Nhits, tupler[0], tupler[1]))

                savename2 = "%s_%s_%s" % (gen_name, day, tupler)
                plt.savefig(savedir + "%s.png" % (savename2), dpi=150)

        if day in subplot_days:
            redu_mat1, redu_dict1 = redu_data(skymap.lambda_dict, .75, 5)
            redu_deepsky(ax_sub[sub_ind], redu_mat1, redu_dict1)
            sub_ind += 1

    # Make FOM Plots
    out_array = lam_dict_to_array(skymap.lambda_dict)
    array_mean_std_plots(out_array, gen_name, savedir)

    proposal_deepsky_specs(fig_sub, ax_sub)
    fig_sub.savefig(savedir + "MultiPanel_%s.png" % (gen_name), dpi=150)

    # Save Dictionary
    skymap.save_lambda_dict(save_suffix)
Пример #4
0
def deepsky_date_survey(save_suffix):

    dir= os.path.dirname(__file__)
    savedir = os.path.join(dir, '../../data/deepsky_test/date1_s4_w2/')


    # FOV Dimensions
    FOV_Dim=(2048*6.2/3600)*(pi/180) # Base Dimension
    FOV_phi=FOV_Dim*2
    FOV_theta=FOV_Dim

    # Pointings

    pointings1= gen_deepskydate1_points()

    #pointings1=np.array([[1.0, pi/36,0, 0],
    #                    [1.0, pi/62, 0, 0]])

    days = np.unique(pointings1[:,0])
   
    # Initializations
    skymap = SkyMap(nside=2**9,LVF_theta=FOV_theta, LVF_phi=FOV_phi, cap_theta=pi/4) 
    skyplot1=SkyPlots2()
    fig_sub, ax_sub= plt.subplots(1, 4, subplot_kw=dict(polar=True))        
    sub_ind=0
    subplot_days=[91, 182, 273, 365]
    #subplot_days=[1,3,7,10]
    plot_days=[1,2, 91, 182, 273, 365]
    #plot_days=[1,2,3,7,10]
    plot_lambda_ranges=[(.75,2.34),(.75,.76),(1.30,1.33),(2.26,2.34)]
 

    for day in days:
        points_in=map(tuple, pointings1[ pointings1[:,0]==day, 1:4] )

        for i, tupler in enumerate(points_in):
            print "day:%s, step:%s" %(day, i)
            skymap.make_dicts(day, tupler )

        if day in plot_days:
            for j,tupler in enumerate(plot_lambda_ranges):
                fig1, ax1= plt.subplots(1,1, subplot_kw=dict(polar=True))        
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict, lambda_min=tupler[0] ,lambda_max=tupler[1])
                
                scat, Nhits=redu_deepsky( ax1, redu_mat2, redu_dict2)

                fig1.colorbar(scat)
                fig1.set_size_inches(20,10)
                fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %(day, Nhits, tupler[0], tupler[1]) )        

                savename2="date1_LOWRES_s4_w2_%s_%s" %(day,tupler)
                plt.savefig( savedir + "%s.png" %(savename2) )   
        if day == 365:
            for j,tupler in enumerate(plot_lambda_ranges):
                fig1, ax1= plt.subplots(1,1, subplot_kw=dict(polar=True))        
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict, lambda_min=tupler[0] ,lambda_max=tupler[1])
                
                scat, Nhits=redu_deepsky( ax1, redu_mat2, redu_dict2)

                cb=fig1.colorbar(scat)
                cb.set_clim(vmin=0, vmax=250)
                fig1.set_size_inches(20,10)
                fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %(day, Nhits, tupler[0], tupler[1]) )        

                savename2="date1_s4_w2_cbar_%s_%s" %(day,tupler)
                plt.savefig( savedir + "%s.png" %(savename2) )   

        if day in subplot_days:
            redu_mat1, redu_dict1=redu_data(skymap.lambda_dict, .75, 5)
            redu_deepsky( ax_sub[sub_ind], redu_mat1, redu_dict1)
            sub_ind+=1

    subplot_proposal1( fig_sub, ax_sub)
    fig_sub.savefig( savedir + "%s.png" %("MultiPanel_date1_s1_w2") )   
    
    # Save Dictionary
    skymap.save_lambda_dict(save_suffix)
Пример #5
0
def allsky_survey(pointing_file, save_suffix):
    dir= os.path.dirname(__file__)
    savedir = os.path.join(dir, '../../data/allsky_test/')


    # FOV Dimensions
    FOV_Dim=(2048*6.2/3600)*(pi/180) # Base Dimension
    FOV_phi=FOV_Dim*2
    FOV_theta=FOV_Dim
    Nstrip=21 # Number of strips on each band of FOV 
    skymap = SkyMap(nside=2**9,LVF_theta=FOV_theta, LVF_phi=FOV_phi, cap_theta=pi) 

    pointings1 = read_in_date(pointing_file)
    

    days = np.unique(pointings1[:,0])
    

    # Initializations
    skyplot1=SkyPlots2()
    fig_sub, ax_sub= plt.subplots(1, 4, subplot_kw=dict(projection="mollweide"))        
    sub_ind=0
    subplot_days=[91,182,273,365]
    plot_days=[1,91,182,273,365]
    
    plot_lambda_ranges=[(.75,2.34),(.75,.76),(1.30,1.33),(2.26,2.34)]

    for day in days:
        points_in=map(tuple, pointings1[ pointings1[:,0]==day, 1:4] )

        for i, tupler in enumerate(points_in):
            print "day:%s, step:%s" %(day, i)
            skymap.make_dicts(day, tupler )

        if day in plot_days:
            for j,tupler in enumerate(plot_lambda_ranges):
                fig1, ax1= plt.subplots(1,1, subplot_kw=dict(projection="mollweide"))        
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict, lambda_min=tupler[0] ,lambda_max=tupler[1])
                
                scat, Nhits=redu_allsky( ax1, redu_mat2, redu_dict2)

                ax1.get_xaxis().set_ticks([])
                ax1.get_yaxis().set_ticks([])
                  
                fig1.colorbar(scat)
                fig1.set_size_inches(20,10)
                #fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %(day, Nhits, tupler[0], tupler[1]) )        

                savename2="allsky_date1_3_%s_%s" %(day,tupler)
                plt.savefig( savedir + "%s.svg" %(savename2) )   


        if day in subplot_days:
            redu_mat1, redu_dict1=redu_data(skymap.lambda_dict, .75, .76)
            scat_mult, Nhits=redu_allsky( ax_sub[sub_ind], redu_mat1, redu_dict1)
            ax_sub[sub_ind].get_xaxis().set_ticks([])
            ax_sub[sub_ind].get_yaxis().set_ticks([])

            sub_ind+=1

    subplot_proposal1( fig_sub, ax_sub)
    fig_sub.subplots_adjust(right=0.8)
    cbar_ax=fig_sub.add_axes([.85,.23,.01,.5])
    fig_sub.colorbar(scat_mult, cax=cbar_ax)

    fig_sub.savefig( savedir + "%s.svg" %("MultiPanel_3") )   
    
    # Save Dictionary
    skymap.save_lambda_dict(save_suffix)
Пример #6
0
def deepsky_date_survey(save_suffix, gen_name, rel_save_location):

    dir= os.path.dirname(__file__)
    savedir = os.path.join(dir, rel_save_location)


    # FOV Dimensions
    FOV_Dim=(2048*6.2/3600)*(pi/180) # Base Dimension
    FOV_phi=FOV_Dim*2
    FOV_theta=FOV_Dim

    # Pointings

    pointings1= gen_deepskydate1_points()
    #pointings1=np.array([[1.0, pi/36, 0, 0]])

    days = np.unique(pointings1[:,0])
   
    # Initializations
    skymap = SkyMap(nside=2**9,LVF_theta=FOV_theta, LVF_phi=FOV_phi, cap_theta=15*pi/180) 
    skyplot1=SkyPlots2()
    fig_sub, ax_sub= plt.subplots(1, 4, subplot_kw=dict(polar=True))        
    sub_ind=0
    subplot_days=[91, 182, 273, 364]
    #subplot_days=[1,3,7,10]
    plot_days=[1,2,3,4,5,6, 91, 182, 273, 364]
    #plot_days=[1,2,3,7,10]
    plot_lambda_ranges=[(.75,2.34),(.75,.76),(1.30,1.33),(2.26,2.34)]


    for day in days:
        points_in=map(tuple, pointings1[ pointings1[:,0]==day, 1:4] )

        for i, tupler in enumerate(points_in):
            print "day:%s, step:%s" %(day, i)
            skymap.make_dicts(day, tupler )

        if day in plot_days:
            for j,tupler in enumerate(plot_lambda_ranges):
                fig1, ax1= plt.subplots(1,1, subplot_kw=dict(polar=True))        
                redu_mat2, redu_dict2 = redu_data(skymap.lambda_dict, lambda_min=tupler[0] ,lambda_max=tupler[1])
                
                scat, Nhits=redu_deepsky( ax1, redu_mat2, redu_dict2)

                fig1.colorbar(scat)
                fig1.set_size_inches(20,15)
                fig1.suptitle("Day %s, Nhits=%s, [%s, %s]" %(day, Nhits, tupler[0], tupler[1]) )        

                savename2="%s_%s_%s" %(gen_name, day,tupler)
                plt.savefig( savedir + "%s.png" %(savename2), dpi=150 )   


        if day in subplot_days:
            redu_mat1, redu_dict1=redu_data(skymap.lambda_dict, .75, 5)
            redu_deepsky( ax_sub[sub_ind], redu_mat1, redu_dict1)
            sub_ind+=1

    # Make FOM Plots
    out_array=lam_dict_to_array(skymap.lambda_dict)
    array_mean_std_plots(out_array, gen_name, savedir)
    
    proposal_deepsky_specs( fig_sub, ax_sub)
    fig_sub.savefig( savedir + "MultiPanel_%s.png" %(gen_name), dpi=150 )   
    
    # Save Dictionary
    skymap.save_lambda_dict(save_suffix)