Пример #1
0
    def show_cel(self):
        '''
        show observation in celestial coordinates
        :return:
        '''
        s = fig.add_subplot(212, projection='aitoff')
        a = np.size(T.sky_cel, 0)
        e = np.size(T.sky_cel, 1)
        #s.set_xlim(-180, 180)
        #s.set_ylim(-90, 90)
        r = 3.25
        for ia in range(0, a):
            for ie in range(0, e):
                if self.sky_cel[ia, ie] != 0:
                    c = cm.YlOrBr(self.sky_cel[ia, ie] / (dt * 10))
                    pos = self.grid2pos_c([ia, ie])
                    s.scatter(pos[0]/180*np.pi, pos[1]/180*np.pi, c=c, marker='o', s=50)
                    s.scatter(self.terr2cel(T.azi, T.ele, 0)[0]/180*np.pi, self.terr2cel(T.azi, T.ele, 0)[1]/180*np.pi, c='g', marker='o', s=10)

        s.legend(['Observations intensity',' Present observation'])
        s.set_title('\nObservations in celestial coordinates\n')
        s.set_xlabel('Right ascension')
        s.set_ylabel('Declination')
        s.grid()
        return s
Пример #2
0
def draw(height_list):
    """Draws rectangles along the width of the rectangle pane with heights corresponding to the values in height list"""
    global rect_list, width
    for i in range(number):
        color = cm.YlOrBr((2 * height_list[i] + 300) / 1200)
        rect_list.append(
            rectangle_pane.create_rectangle(width * i + 2,
                                            screen_width - height_list[i],
                                            width * i + 5,
                                            screen_width,
                                            fill=colors.to_hex(color),
                                            width=0))
 def show_obs_rel(self, ):
     o = plt.gca()
     a = np.size(T.sky, 0)
     e = np.size(T.sky, 1)
     o.set_xlim(0, 360)
     o.set_ylim(0, 90)
     o.set_xlabel('Azimut')
     o.set_ylabel('Elevation')
     o.set_title('Observations')
     r = 3.25
     for ia in range(0, a):
         for ie in range(0, e):
             c = cm.YlOrBr(self.sky[ia, ie] / (dt * 10))
             pos = self.grid2pos([ia, ie])
             circle = plt.Circle(xy=(pos[0], pos[1]), radius=r, color=c)
             o.add_artist(circle)
     return o
Пример #4
0
    def show_obs(self, x):
        '''
        plot observations-intensity of the sky
        :param x: optimal spot
        :return:
        '''
        o = fig.add_subplot(211)
        o = plt.gca()
        plt.gca()
        a = np.size(T.sky, 0)
        e = np.size(T.sky, 1)
        o.set_xlim(0, 360)
        o.set_ylim(0, 90)
        o.set_xlabel('Azimuth')
        o.set_ylabel('Elevation')
        o.set_title('Observations ' + str(time.ctime()))
        o.grid()
        r = 3.25
        zurich_azi, zurich_ele = self.coordview(zurich_coordinates)
        birrfeld_azi, birrfeld_ele = self.coordview(birrfeld_coordinates)
        nf = len(planes)
        colors = ['r', 'b', 'g', 'c', 'k', 'y', 'm', 'w']
        for i in range(1, 5):
            colors += colors
        o.scatter(zurich_azi, zurich_ele, marker='^', color='g', s=60)
        o.scatter(birrfeld_azi, birrfeld_ele, marker='^', color='b', s=60)
        o.scatter(x[2], x[3], marker='+', color='k', s=60)
        for i in range(0, nf):
            o.scatter(planes_mod[0][i].azi, planes_mod[0][i].ele, color=colors[i], marker='s', s=20)
            o.scatter(planes_mod[1][i].azi, planes_mod[1][i].ele, color=colors[i], marker='p', s=20)
            o.scatter(planes_mod[2][i].azi, planes_mod[2][i].ele, color=colors[i], marker='.', s=20)
            o.scatter(planes_mod[3][i].azi, planes_mod[3][i].ele, color=colors[i], marker='.', s=10)
            o.scatter(planes[i].azi, planes[i].ele, color=colors[i], marker='o', s=15)

        for ia in range(0, a):
            for ie in range(0, e):
                if self.sky[ia, ie] != 0:
                    c = cm.YlOrBr(self.sky[ia, ie] / (dt * 10))
                    pos = self.grid2pos([ia, ie])
                    circle = plt.Circle(xy=(pos[0], pos[1]), radius=r, color=c)
                    o.add_artist(circle)
        o.legend(['Zurich airport', 'Birrfeld airport','Optimum', '1.5dt modeled position','2dt modeled position','2.5dt modeled position','3.5', 'Previous position'])
        return o
Пример #5
0
scope="10"
LGS_dIdt={'G':'A1', 'H':'A2','C':'B1', 'Z':'B2'}

LGS=[[ScopeChannel(s, scope, LGS_dIdt[switch]) for switch in LGS_dIdt] for s in shots]
LG_times=[[np.round(l.time[np.where(l.data>0.5)[0][0]]) for l in lg] for lg in LGS]
LG_spread=[np.max(l)-np.min(l) for l in LG_times]
    
#%%
from matplotlib import cm

start = 0.2
stop = 1.0
number_of_lines= len(shots)
cm_subsection = np.linspace(start, stop, number_of_lines) 
colors = [ cm.YlOrBr(x) for x in cm_subsection ]

fig, ax=plt.subplots(2,1,figsize=(8,8))

for tmm,c in zip(tm, colors):
    ax[0].plot(tmm.time, tmm.data, label=tmm.shot, c=c)
    
ax[0].set_xlim(100,500)
#ax.set_ylim(0,5)
ax[0].legend()

for lgg,c in zip(lg, colors):
    ax[1].plot(lgg.time, lgg.data, label=lgg.shot, c=c)
    
ax[1].set_xlim(1200,1600)
ax[1].set_ylim(0,5)