Esempio n. 1
0
def findResolution(caponProcessor, srcFrames, resLimit, p_depth, fps=25.0, highres=True):
   
   capon = caponProcessor
   frames = srcFrames
   
   for frame in frames:
      
      capon.image_idx.updateValue(frame)
      capon.processData()
      capon.interpolateData()
      
      p1 =  0.5 + (1+1.5)*frame/fps 
      p2 = -0.5 + (1-1.5)*frame/fps
      pc = (p1 + p2) / 2
      p = [np.array([p1, p_depth]), np.array([p2, p_depth]), np.array([pc, p_depth])]
      amp_p = []
      
      for i in range(len(p)):
         p_dist = np.linalg.norm(p[i])
         p_angle = np.arctan(p[i][0]/p[i][1])
         idx_range = np.argmin(abs(1000*capon.ranges_intrp-p_dist))
         idx_angle = np.argmin(abs(capon.angles_intrp-p_angle))
         
         if highres: 
            amp_p.append(capon.img_cap_detected[idx_range][idx_angle])                      
         else:
            amp_p.append(capon.img_das_detected[idx_range][idx_angle])
      
      res = (amp_p[0] + amp_p[1])/2 - amp_p[2]
       
      if (res > resLimit):
         print 'Resolution measured to ', p1-p2,  ' from', amp_p, ' in frame ', frame
         return p1 - p2
Esempio n. 2
0
   def interpolateData(self):
      import scipy.interpolate as interpolate 
      
      NyK = self.Ny - 2*self.K.value # The Capon image will be 2*K smaller in range

      if VERBOSE:
         print 'Start interpolating...'

      # IQ-interpolation (in image domain, imag and real, hence coherent) 
      iq_interp_factor = 2
      x_idx = np.arange(self.Nx)
      y_idx = np.arange(NyK)
      x_up_idx = np.linspace(0.25, self.Nx-1-0.25, (self.Nx-1)*iq_interp_factor)  
      y_up_idx = np.arange(NyK)
      self.angles_intrp = interpolate.interp1d( x_idx, self.angles ) (x_up_idx)
      self.ranges_intrp = self.ranges
      if self.K.value > 0:
         self.ranges_intrp = self.ranges_intrp[self.K.value:-self.K.value]
          
      img_das_real = interpolate.RectBivariateSpline( x_idx, y_idx, self.img_das.real ) (x_up_idx, y_up_idx)
      img_das_imag = interpolate.RectBivariateSpline( x_idx, y_idx, self.img_das.imag ) (x_up_idx, y_up_idx)
   
      img_capon_real = interpolate.RectBivariateSpline( x_idx, y_idx, self.img_capon.real ) (x_up_idx, y_up_idx)
      img_capon_imag = interpolate.RectBivariateSpline( x_idx, y_idx, self.img_capon.imag ) (x_up_idx, y_up_idx)
      
      self.img_das_iq_intrp   = img_das_real   + 1j * img_das_imag
      self.img_capon_iq_intrp = img_capon_real + 1j * img_capon_imag   
      
      # In-coherent interpolation
      if self.Ky.value > 1 or self.Kx.value > 1:
         
         NxK = (self.Nx-1) * iq_interp_factor
      
         y_idx = np.arange(NyK)
         x_idx = np.arange(NxK)
      
         y_up_idx = np.linspace(0,NyK-1,NyK*self.Ky.value)
         x_up_idx = np.linspace(0,NxK-1,NxK*self.Kx.value)
         
         self.angles_intrp = interpolate.interp1d( x_idx, self.angles_intrp ) (x_up_idx)
         if self.K.value > 0:
            self.ranges_intrp = interpolate.interp1d( y_idx, self.ranges[self.K.value:-self.K.value].squeeze() ) (y_up_idx)
         else:
            self.ranges_intrp = interpolate.interp1d( y_idx, self.ranges ) (y_up_idx)
      
         self.img_das_intrp   = interpolate.RectBivariateSpline( x_idx, y_idx, abs(self.img_das_iq_intrp) ) (x_up_idx, y_up_idx)
         self.img_capon_intrp = interpolate.RectBivariateSpline( x_idx, y_idx, abs(self.img_capon_iq_intrp) ) (x_up_idx, y_up_idx)
            
      else: # do nothing
         self.img_das_intrp = self.img_das_iq_intrp
         self.img_capon_intrp = self.img_capon_iq_intrp
         
      self.img_das_intrp   = np.transpose(self.img_das_intrp)
      self.img_capon_intrp = np.transpose(self.img_capon_intrp)
      
      self.img_das_detected = self.logCompress(self.img_das_intrp,   self.minDynRange.value, self.maxDynRange.value)
      self.img_cap_detected = self.logCompress(self.img_capon_intrp, self.minDynRangeCapon.value, self.maxDynRangeCapon.value)
         
      if VERBOSE:
         print 'done'
Esempio n. 3
0
def findResolution(caponProcessor,
                   srcFrames,
                   resLimit,
                   p_depth,
                   fps=25.0,
                   highres=True):

    capon = caponProcessor
    frames = srcFrames

    for frame in frames:

        capon.image_idx.updateValue(frame)
        capon.processData()
        capon.interpolateData()

        p1 = 0.5 + (1 + 1.5) * frame / fps
        p2 = -0.5 + (1 - 1.5) * frame / fps
        pc = (p1 + p2) / 2
        p = [
            np.array([p1, p_depth]),
            np.array([p2, p_depth]),
            np.array([pc, p_depth])
        ]
        amp_p = []

        for i in range(len(p)):
            p_dist = np.linalg.norm(p[i])
            p_angle = np.arctan(p[i][0] / p[i][1])
            idx_range = np.argmin(abs(1000 * capon.ranges_intrp - p_dist))
            idx_angle = np.argmin(abs(capon.angles_intrp - p_angle))

            if highres:
                amp_p.append(capon.img_cap_detected[idx_range][idx_angle])
            else:
                amp_p.append(capon.img_das_detected[idx_range][idx_angle])

        res = (amp_p[0] + amp_p[1]) / 2 - amp_p[2]

        if (res > resLimit):
            print 'Resolution measured to ', p1 - p2, ' from', amp_p, ' in frame ', frame
            return p1 - p2
Esempio n. 4
0
   def plot(self, axis1, axis2, axis3=None, axis4=None):
      # Display results
      import framework.mypylab as pl
      from framework.mynumpy import abs, db, mean, sin, cos, pi

      self.interpolateData()

      if VERBOSE:
         print 'Start plotting...'

      theta,rad = np.meshgrid(self.angles_intrp, self.ranges_intrp)
      x = 1000 * rad * sin(theta)
      y = 1000 * rad * cos(theta)
      
      ## Start Plotting
      if (axis1 == 0): # stand alone plotting
         pl.figure()
         pl.subplot(1,2,1, aspect=1)
         pl.pcolormesh(x, y, self.img_das_detected, cmap=pl.cm.gray, vmin=self.minDynRange.value, vmax=self.maxDynRange.value)
         pl.gca().invert_yaxis()
      else: # Plotting in given axis
         axis1.pcolormesh(x, y, self.img_das_detected, cmap=pl.cm.gray, vmin=self.minDynRange.value, vmax=self.maxDynRange.value)
         axis1.set_title('Delay-and-sum', fontsize='large')
         axis1.set_xlabel('Width [mm]', fontsize='large')
         axis1.set_ylabel('Depth [mm]', fontsize='large')
         axis1.set_xlim(x.min(), x.max())
         axis1.set_ylim(y.max(), y.min())
      
      if (axis2 == 0):
         ax = 0
         pl.subplot(1,2,2, aspect=1)
         pl.pcolormesh(x, y, self.img_cap_detected, cmap=pl.cm.gray, vmin=self.minDynRangeCapon.value, vmax=self.maxDynRangeCapon.value)
         pl.gca().invert_yaxis()
         pl.show()
      else:
         ax = axis2.pcolormesh(x, y, self.img_cap_detected, cmap=pl.cm.gray, vmin=self.minDynRangeCapon.value, vmax=self.maxDynRangeCapon.value)
         if self.Nb.value > 0:
            axis2.set_title('BS-Capon', fontsize='large')
         else:
            axis2.set_title('ES-Capon', fontsize='large')
         axis2.set_xlabel('Width [mm]', fontsize='large')
         axis2.set_ylabel('Depth [mm]', fontsize='large')
         axis2.set_xlim(x.min(), x.max())
         axis2.set_ylim(y.max(), y.min())
         
      if axis3 is not None:
         # plot axial profile
         #profile_angle = np.arctan( self.profilePos[0] / self.profilePos[1] )
         #if profile_angle < self.angles_intrp[-1] and profile_angle > self.angles_intrp[0]: 
         #   range_slice_idx = round(self.angles_intrp.shape[0] * (profile_angle-self.angles_intrp[0]) / (self.angles_intrp[-1]-self.angles_intrp[0]))
         #   img_das_rslice = img_das_detected[:, range_slice_idx]
         #   img_cap_rslice = img_cap_detected[:, range_slice_idx]
         #
         #   axis3.plot(y[:,range_slice_idx], img_das_rslice, label='DAS')
         #   axis3.plot(y[:,range_slice_idx], img_cap_rslice, '-r', label='Capon')
         #   
         #   axis3.set_ylim([self.minDynRange.value, self.maxDynRange.value])
         #   
         #   axis3.set_title('Radial intensity at %d degrees'%round(profile_angle*180/np.pi))
         #   axis3.set_xlabel('Depth [mm]')
         #   axis3.set_ylabel('Radial intensity [dB]')
         #   axis3.legend(loc=3, markerscale=0.5)
         
         # Plot beampatterns and power spectrums
         profile_range = np.sqrt( self.profilePos[0]**2 + self.profilePos[1]**2 ) / 1000.0
         profile_angle = np.arctan( self.profilePos[0] / self.profilePos[1] )
         
         if profile_range < self.ranges_intrp[-1] and profile_range > self.ranges_intrp[0] and profile_angle < self.angles_intrp[-1] and profile_angle > self.angles_intrp[0]:
            
            range = round(self.ranges_intrp.shape[0] * (profile_range-self.ranges_intrp[0]) / (self.ranges_intrp[-1]-self.ranges_intrp[0]))
            angle = round(self.angles_intrp.shape[0] * (profile_angle-self.angles_intrp[0]) / (self.angles_intrp[-1]-self.angles_intrp[0]))
            
            spacing = 0.5
            
            # plot beamspace data
            x_data = self.Xd_i[angle / (2*self.Kx.value), range / (1*self.Ky.value), :]
            das_beams = self.calcBeamPatternLinearArray(x_data, self.Nm, spacing, self.angles_intrp, self.angles_intrp[angle], takePowerAndNormalize=True)
            axis3.plot(x[range,:], 10*np.log10(das_beams) + self.maxDynRange.value, label='DAS Sample Spectrum')
            
            # make Capon beam pattern
            w_capon = self.capon_weights[angle / (2*self.Kx.value), range / (1*self.Ky.value), :]
            W_capon = self.calcBeamPatternLinearArray(w_capon, self.L.value, spacing, self.angles_intrp, self.angles_intrp[angle])
            W_capon = abs(W_capon*W_capon.conj())
            W_capon = W_capon / W_capon[angle]
            axis3.plot(x[range,:], 10*np.log10(W_capon) + self.maxDynRange.value - 10 , label='Capon Beampattern')
            
            # make DAS beam pattern for subarrays
            W_das = self.calcBeamPatternLinearArray(self.das_w_sub, self.L.value, spacing, self.angles_intrp, self.angles_intrp[angle], takePowerAndNormalize=True)       
            axis3.plot(x[range,:], 10*np.log10(W_das) + self.maxDynRange.value - 10, label='DAS Beampattern')
            
            # make total Capon beam pattern for the whole system (tx and rx)?
            
            # plot selected direction/angle
            axis3.plot([x[range,angle], x[range,angle]], [self.minDynRange.value, self.maxDynRange.value], label='Steering angle')
         
         axis3.set_ylim([self.minDynRange.value, self.maxDynRange.value])
         axis3.set_title('Beam pattern at %d degrees and %d mm range'%(round(profile_angle*180/np.pi), round(profile_range*1000)), fontsize='large') 
         axis3.set_xlabel('Width [mm]', fontsize='large')
         axis3.set_ylabel('Intensity/Gain [dB]', fontsize='large')
         if self.show_legends.value is 1:
            axis3.legend(loc=3, markerscale=0.5)
      
      if axis4 is not None:
         profile_range = np.sqrt(self.profilePos[0]**2 + self.profilePos[1]**2) / 1000.0
         
         if profile_range < self.ranges_intrp[-1] and profile_range > self.ranges_intrp[0]:
            angle_slice_idx = round(self.ranges_intrp.shape[0] * (profile_range-self.ranges_intrp[0]) / (self.ranges_intrp[-1]-self.ranges_intrp[0]))
            self.img_das_aslice = self.img_das_detected[angle_slice_idx, :]
            self.img_cap_aslice = self.img_cap_detected[angle_slice_idx, :]
            self.x_aslice = x[angle_slice_idx,:]
         
            axis4.plot(self.x_aslice, self.img_das_aslice, label='DAS')
            if (self.Nb.value > 0):
               axis4.plot(self.x_aslice, self.img_cap_aslice, '-r', label='BS-Capon')
            else:
               axis4.plot(self.x_aslice, self.img_cap_aslice, '-r', label='ES-Capon')
            
            axis4.set_ylim([self.minDynRange.value, self.maxDynRange.value])
            
            axis4.set_title('Lateral intensity at %d mm range'%round(profile_range*1000), fontsize='large')
            axis4.set_xlabel('Width [mm]', fontsize='large')
            axis4.set_ylabel('Lateral intensity [dB]', fontsize='large')
            if self.show_legends.value is 1:
               axis4.legend(loc=3, markerscale=0.5)
        
      if VERBOSE:   
         print 'done'
         
      return ax
Esempio n. 5
0
 def logCompress(self, img, min, max):
    img_log_norm = np.db(abs(img)) - np.db(np.mean(abs(img)))
    #img_clip = np.clip(img_log_norm, min, max)
    return img_log_norm
Esempio n. 6
0
    def plot(self, axis1, axis2, axis3=None, axis4=None):
        # Display results
        import framework.mypylab as pl
        from framework.mynumpy import abs, db, mean, sin, cos, pi

        self.interpolateData()

        if VERBOSE:
            print 'Start plotting...'

        theta, rad = np.meshgrid(self.angles_intrp, self.ranges_intrp)
        x = 1000 * rad * sin(theta)
        y = 1000 * rad * cos(theta)

        ## Start Plotting
        if (axis1 == 0):  # stand alone plotting
            pl.figure()
            pl.subplot(1, 2, 1, aspect=1)
            pl.pcolormesh(x,
                          y,
                          self.img_das_detected,
                          cmap=pl.cm.gray,
                          vmin=self.minDynRange.value,
                          vmax=self.maxDynRange.value)
            pl.gca().invert_yaxis()
        else:  # Plotting in given axis
            axis1.pcolormesh(x,
                             y,
                             self.img_das_detected,
                             cmap=pl.cm.gray,
                             vmin=self.minDynRange.value,
                             vmax=self.maxDynRange.value)
            axis1.set_title('Delay-and-sum', fontsize='large')
            axis1.set_xlabel('Width [mm]', fontsize='large')
            axis1.set_ylabel('Depth [mm]', fontsize='large')
            axis1.set_xlim(x.min(), x.max())
            axis1.set_ylim(y.max(), y.min())

        if (axis2 == 0):
            ax = 0
            pl.subplot(1, 2, 2, aspect=1)
            pl.pcolormesh(x,
                          y,
                          self.img_cap_detected,
                          cmap=pl.cm.gray,
                          vmin=self.minDynRangeCapon.value,
                          vmax=self.maxDynRangeCapon.value)
            pl.gca().invert_yaxis()
            pl.show()
        else:
            ax = axis2.pcolormesh(x,
                                  y,
                                  self.img_cap_detected,
                                  cmap=pl.cm.gray,
                                  vmin=self.minDynRangeCapon.value,
                                  vmax=self.maxDynRangeCapon.value)
            if self.Nb.value > 0:
                axis2.set_title('BS-Capon', fontsize='large')
            else:
                axis2.set_title('ES-Capon', fontsize='large')
            axis2.set_xlabel('Width [mm]', fontsize='large')
            axis2.set_ylabel('Depth [mm]', fontsize='large')
            axis2.set_xlim(x.min(), x.max())
            axis2.set_ylim(y.max(), y.min())

        if axis3 is not None:
            # plot axial profile
            #profile_angle = np.arctan( self.profilePos[0] / self.profilePos[1] )
            #if profile_angle < self.angles_intrp[-1] and profile_angle > self.angles_intrp[0]:
            #   range_slice_idx = round(self.angles_intrp.shape[0] * (profile_angle-self.angles_intrp[0]) / (self.angles_intrp[-1]-self.angles_intrp[0]))
            #   img_das_rslice = img_das_detected[:, range_slice_idx]
            #   img_cap_rslice = img_cap_detected[:, range_slice_idx]
            #
            #   axis3.plot(y[:,range_slice_idx], img_das_rslice, label='DAS')
            #   axis3.plot(y[:,range_slice_idx], img_cap_rslice, '-r', label='Capon')
            #
            #   axis3.set_ylim([self.minDynRange.value, self.maxDynRange.value])
            #
            #   axis3.set_title('Radial intensity at %d degrees'%round(profile_angle*180/np.pi))
            #   axis3.set_xlabel('Depth [mm]')
            #   axis3.set_ylabel('Radial intensity [dB]')
            #   axis3.legend(loc=3, markerscale=0.5)

            # Plot beampatterns and power spectrums
            profile_range = np.sqrt(self.profilePos[0]**2 +
                                    self.profilePos[1]**2) / 1000.0
            profile_angle = np.arctan(self.profilePos[0] / self.profilePos[1])

            if profile_range < self.ranges_intrp[
                    -1] and profile_range > self.ranges_intrp[
                        0] and profile_angle < self.angles_intrp[
                            -1] and profile_angle > self.angles_intrp[0]:

                range = round(self.ranges_intrp.shape[0] *
                              (profile_range - self.ranges_intrp[0]) /
                              (self.ranges_intrp[-1] - self.ranges_intrp[0]))
                angle = round(self.angles_intrp.shape[0] *
                              (profile_angle - self.angles_intrp[0]) /
                              (self.angles_intrp[-1] - self.angles_intrp[0]))

                spacing = 0.5

                # plot beamspace data
                x_data = self.Xd_i[angle / (2 * self.Kx.value),
                                   range / (1 * self.Ky.value), :]
                das_beams = self.calcBeamPatternLinearArray(
                    x_data,
                    self.Nm,
                    spacing,
                    self.angles_intrp,
                    self.angles_intrp[angle],
                    takePowerAndNormalize=True)
                axis3.plot(x[range, :],
                           10 * np.log10(das_beams) + self.maxDynRange.value,
                           label='DAS Sample Spectrum')

                # make Capon beam pattern
                w_capon = self.capon_weights[angle / (2 * self.Kx.value),
                                             range / (1 * self.Ky.value), :]
                W_capon = self.calcBeamPatternLinearArray(
                    w_capon, self.L.value, spacing, self.angles_intrp,
                    self.angles_intrp[angle])
                W_capon = abs(W_capon * W_capon.conj())
                W_capon = W_capon / W_capon[angle]
                axis3.plot(x[range, :],
                           10 * np.log10(W_capon) + self.maxDynRange.value -
                           10,
                           label='Capon Beampattern')

                # make DAS beam pattern for subarrays
                W_das = self.calcBeamPatternLinearArray(
                    self.das_w_sub,
                    self.L.value,
                    spacing,
                    self.angles_intrp,
                    self.angles_intrp[angle],
                    takePowerAndNormalize=True)
                axis3.plot(x[range, :],
                           10 * np.log10(W_das) + self.maxDynRange.value - 10,
                           label='DAS Beampattern')

                # make total Capon beam pattern for the whole system (tx and rx)?

                # plot selected direction/angle
                axis3.plot([x[range, angle], x[range, angle]],
                           [self.minDynRange.value, self.maxDynRange.value],
                           label='Steering angle')

            axis3.set_ylim([self.minDynRange.value, self.maxDynRange.value])
            axis3.set_title(
                'Beam pattern at %d degrees and %d mm range' % (round(
                    profile_angle * 180 / np.pi), round(profile_range * 1000)),
                fontsize='large')
            axis3.set_xlabel('Width [mm]', fontsize='large')
            axis3.set_ylabel('Intensity/Gain [dB]', fontsize='large')
            if self.show_legends.value is 1:
                axis3.legend(loc=3, markerscale=0.5)

        if axis4 is not None:
            profile_range = np.sqrt(self.profilePos[0]**2 +
                                    self.profilePos[1]**2) / 1000.0

            if profile_range < self.ranges_intrp[
                    -1] and profile_range > self.ranges_intrp[0]:
                angle_slice_idx = round(
                    self.ranges_intrp.shape[0] *
                    (profile_range - self.ranges_intrp[0]) /
                    (self.ranges_intrp[-1] - self.ranges_intrp[0]))
                self.img_das_aslice = self.img_das_detected[angle_slice_idx, :]
                self.img_cap_aslice = self.img_cap_detected[angle_slice_idx, :]
                self.x_aslice = x[angle_slice_idx, :]

                axis4.plot(self.x_aslice, self.img_das_aslice, label='DAS')
                if (self.Nb.value > 0):
                    axis4.plot(self.x_aslice,
                               self.img_cap_aslice,
                               '-r',
                               label='BS-Capon')
                else:
                    axis4.plot(self.x_aslice,
                               self.img_cap_aslice,
                               '-r',
                               label='ES-Capon')

                axis4.set_ylim(
                    [self.minDynRange.value, self.maxDynRange.value])

                axis4.set_title('Lateral intensity at %d mm range' %
                                round(profile_range * 1000),
                                fontsize='large')
                axis4.set_xlabel('Width [mm]', fontsize='large')
                axis4.set_ylabel('Lateral intensity [dB]', fontsize='large')
                if self.show_legends.value is 1:
                    axis4.legend(loc=3, markerscale=0.5)

        if VERBOSE:
            print 'done'

        return ax
Esempio n. 7
0
    def interpolateData(self):
        import scipy.interpolate as interpolate

        NyK = self.Ny - 2 * self.K.value  # The Capon image will be 2*K smaller in range

        if VERBOSE:
            print 'Start interpolating...'

        # IQ-interpolation (in image domain, imag and real, hence coherent)
        iq_interp_factor = 2
        x_idx = np.arange(self.Nx)
        y_idx = np.arange(NyK)
        x_up_idx = np.linspace(0.25, self.Nx - 1 - 0.25,
                               (self.Nx - 1) * iq_interp_factor)
        y_up_idx = np.arange(NyK)
        self.angles_intrp = interpolate.interp1d(x_idx, self.angles)(x_up_idx)
        self.ranges_intrp = self.ranges
        if self.K.value > 0:
            self.ranges_intrp = self.ranges_intrp[self.K.value:-self.K.value]

        img_das_real = interpolate.RectBivariateSpline(
            x_idx, y_idx, self.img_das.real)(x_up_idx, y_up_idx)
        img_das_imag = interpolate.RectBivariateSpline(
            x_idx, y_idx, self.img_das.imag)(x_up_idx, y_up_idx)

        img_capon_real = interpolate.RectBivariateSpline(
            x_idx, y_idx, self.img_capon.real)(x_up_idx, y_up_idx)
        img_capon_imag = interpolate.RectBivariateSpline(
            x_idx, y_idx, self.img_capon.imag)(x_up_idx, y_up_idx)

        self.img_das_iq_intrp = img_das_real + 1j * img_das_imag
        self.img_capon_iq_intrp = img_capon_real + 1j * img_capon_imag

        # In-coherent interpolation
        if self.Ky.value > 1 or self.Kx.value > 1:

            NxK = (self.Nx - 1) * iq_interp_factor

            y_idx = np.arange(NyK)
            x_idx = np.arange(NxK)

            y_up_idx = np.linspace(0, NyK - 1, NyK * self.Ky.value)
            x_up_idx = np.linspace(0, NxK - 1, NxK * self.Kx.value)

            self.angles_intrp = interpolate.interp1d(
                x_idx, self.angles_intrp)(x_up_idx)
            if self.K.value > 0:
                self.ranges_intrp = interpolate.interp1d(
                    y_idx, self.ranges[self.K.value:-self.K.value].squeeze())(
                        y_up_idx)
            else:
                self.ranges_intrp = interpolate.interp1d(y_idx,
                                                         self.ranges)(y_up_idx)

            self.img_das_intrp = interpolate.RectBivariateSpline(
                x_idx, y_idx, abs(self.img_das_iq_intrp))(x_up_idx, y_up_idx)
            self.img_capon_intrp = interpolate.RectBivariateSpline(
                x_idx, y_idx, abs(self.img_capon_iq_intrp))(x_up_idx, y_up_idx)

        else:  # do nothing
            self.img_das_intrp = self.img_das_iq_intrp
            self.img_capon_intrp = self.img_capon_iq_intrp

        self.img_das_intrp = np.transpose(self.img_das_intrp)
        self.img_capon_intrp = np.transpose(self.img_capon_intrp)

        self.img_das_detected = self.logCompress(self.img_das_intrp,
                                                 self.minDynRange.value,
                                                 self.maxDynRange.value)
        self.img_cap_detected = self.logCompress(self.img_capon_intrp,
                                                 self.minDynRangeCapon.value,
                                                 self.maxDynRangeCapon.value)

        if VERBOSE:
            print 'done'
Esempio n. 8
0
 def logCompress(self, img, min, max):
     img_log_norm = np.db(abs(img)) - np.db(np.mean(abs(img)))
     #img_clip = np.clip(img_log_norm, min, max)
     return img_log_norm