Exemple #1
0
 def fget(self):
     filename = '%s.pickle' % self.anlFilename
     try:
         self._data = pickle.load(open(filename))
         print 'found pickled data in: %s' % filename
         return self._data
     except IOError:
         print 'processing data in: %s' % self.anlFilename
         self._data = load_correlOutput('%s' % self.anlFilename)
         pickle.dump(self._data ,open(filename, 'w'))
         return self._data
Exemple #2
0
 def build_nativeContactMatrix(self):
     """
     Builds a 2D numpy array from available correl output files. The first
     index references the contact number, the second index references the
     correl time array value (which in turn corresponds to nstep of the
     original dynamics in quanta of ``correlSkip``. This method can take
     awhile because of disk IO.
     """
     print "Building native contact matrix."
     rowLength = (self.correlStop - self.correlStart) / self.correlSkip + 1
     tmp = []
     for i in xrange(len(self.nativeContacts)):
         try:
             tmp.append(load_correlOutput('%s/natq%04d.anl' % (self.anlPathname, i)))
         except IOError:
             tmp.append(np.zeros(rowLength))
             print "Can't find correl output for natq number: %04d." % i
     return np.array(tmp, dtype=np.float64)