return numpy arrays with the coordinates and time for all instances of this particle
(self)
| 224 | |
| 225 | |
| 226 | def flatten(self): |
| 227 | """ |
| 228 | return numpy arrays with the coordinates and time for all |
| 229 | instances of this particle |
| 230 | """ |
| 231 | |
| 232 | if (not self.finalized == 1): |
| 233 | print "ERROR: particle data not finalized before flatten call" |
| 234 | sys.exit(2) |
| 235 | |
| 236 | coords = numpy.zeros((self.dim, self.numInstances), dtype=numpy.float64) |
| 237 | time = numpy.zeros((self.numInstances), dtype=numpy.float64) |
| 238 | |
| 239 | n = 0 |
| 240 | while (n < len(self.history)): |
| 241 | coords[:,n] = self.history[n].xyz[:self.dim] |
| 242 | |
| 243 | time[n] = self.history[n].t |
| 244 | |
| 245 | n += 1 |
| 246 | |
| 247 | return coords, time |
| 248 | |
| 249 | |
| 250 | def getVarIndex(self, varname): |