Ejemplo n.º 1
0
    def _computeTF(self, wl_min_um=1.2, wl_max_um=10.0, N=200):
        """
        compute the fourier transform of the scans (A,B,C,D) and store the
        results using 'TF_...' keywords. self.TF_wl contains the corresponding
        wavelengths (in meters).
        """
        #-- wavelength table:
        self.TF_wl = 1/np.linspace(1/wl_max_um, 1/wl_min_um, N)*1e-6
        for i in range(len(self.scans)):
            #-- find center of the scan
            try:
                snr = slidop.slidingMean(self.scans[i]['TIME'],self.scans[i]['GDSNR'],
                                         20e6/self.header['ISS PRI FSU1 FREQ'])
            except:
                snr,rms,xsnr= sliding_avg_rms(self.scans[i]['TIME'],self.scans[i]['GDSNR'],
                                         20e6/self.header['ISS PRI FSU1 FREQ'])
                snr = np.interp(self.scans[i]['TIME'], xsnr,snr)

            opd0 = self.scans[i]['RTOFFSET'][snr.argmax()]
            #-- create cos and sin waves
            _cos = np.cos(2*np.pi*(self.scans[i]['RTOFFSET']-opd0)[None,:]/self.TF_wl[:,None])
            _sin = np.sin(2*np.pi*(self.scans[i]['RTOFFSET']-opd0)[None,:]/self.TF_wl[:,None])
            #-- apodization window (width in microns):
            apod_width = np.array([50,50,50,50,50,50])*1e-6/(np.sqrt(2)/2) 
            apod = np.exp(-((self.scans[i]['RTOFFSET']-opd0)[:,None]/
                    apod_width[None,:])**2) 
            #-- computation for each channel (A,B,C,D)
            for k in ['A', 'B', 'C', 'D']:
                self.scans[i]['TF_'+k]=(apod[None,:,:]*self.scans[i][k][None,:,:]*
                              (_cos+1j*_sin)[:,:,None]).mean(axis=1)
                if self.scans[i].has_key('DARK'+k):
                    self.scans[i]['TF_DARK'+k]=(self.scans[i]['DARK'+k][None,:]*
                                      (_cos+1j*_sin)).mean(axis=1)
        return
Ejemplo n.º 2
0
 def waterFall(self, channel=0):
     """
     channel is 0 for white light, 1..5 for the dispersed pixels
     """
     plt.figure(0)
     plt.clf()
     ax1= plt.subplot(121)
     ax2= plt.subplot(122, sharex=ax1, sharey=ax1)
     for k in range(len(self.scans)):
         tmp= self.scans[k]['A'][:,channel]-self.scans[k]['C'][:,channel]
         x = self.scans[k]['RTOFFSET']
         x -= x.mean()
         x*=1e6
         ax1.plot(x,tmp+k,
              color='k', alpha=0.8)
         ax2.plot(x, slidop.slidingMean(self.scans[k]['TIME'],
                                 self.scans[k]['GDSNR'],
                                 20e6/self.header['ISS PRI FSU1 FREQ'])/10.+k,
              color='k', alpha=0.8)
     ax1.set_ylim(-1,k+1)
     return