예제 #1
0
    def check_observer(self):
        nr, nc = self.G.shape
        n = len(self.t)
        self.n = n
        self.X_tilde = zeros((nr, n))
        self.term1 = zeros((nr, n))
        self.term2 = zeros((nr, n))
        self.term3 = zeros((nr, n))

        self.Yvect = rowwise(self.theta)
        self.vvect = self.v
        #self.FO = self.G - dot(self.Ke, self.C)

        self.debug_ind = 0

        for i in range(1,n):
            self.run_observer(i)
예제 #2
0
파일: photo_db.py 프로젝트: ryanGT/personal
 def add_photo(self, photo, verbosity=1, copy=False):
     ind = self.search_for_photo(photo)
     if ind is not None:
         if verbosity > 0:
             print('photo already in dB:')
             print('  md5sum: ' + str(photo.md5sum))
             print('  filename: ' + photo.filename)
             print('  db filename: ' + self.filename[ind])
     else:
         for attr in cols:
             if attr != 'photo_id':#<-- the photos don't necessary know their own id'sg
                 val = getattr(photo, attr)
                 vect = getattr(self, attr)
                 if type(vect) == numpy.ndarray:
                     vect = numpy.append(vect, val)
                 else:
                     vect.append(val)
         new_row = photo.torow(self.next_id)
         new_row_2d = rwkmisc.rowwise(new_row)
         new_data = numpy.append(self.data, new_row_2d, axis=0)
         self.data = new_data
         self.next_id += 1