Load particle ensemble .csv files.
More...
Load particle ensemble .csv files.
Definition at line 689 of file read.py.
◆ __init__()
def read.ensemble.__init__ |
( |
|
self, |
|
|
|
offset, |
|
|
|
file = 'data0000' , |
|
|
|
npayload = 1 , |
|
|
|
components = 3 , |
|
|
|
delimiter = ' |
|
) |
| |
Definition at line 691 of file read.py.
691 def __init__(self,offset,file='data0000',npayload=1,components=3,delimiter=','):
693 self.filenameout = file
694 self.isLoaded =
False 695 self.components = components
696 self.npayload = npayload
697 self.delimiter = delimiter
def __init__(self, offset, file='data', headersize=256, nvars=8)
◆ makefilename()
def read.ensemble.makefilename |
( |
|
self | ) |
|
Definition at line 705 of file read.py.
705 def makefilename(self):
706 self.filename = self.filenameout+
'_ensemble'+str(self.offset).zfill(6)+
'.csv'
◆ particle()
def read.ensemble.particle |
( |
|
self, |
|
|
|
index |
|
) |
| |
Definition at line 743 of file read.py.
743 def particle(self,index):
744 for particle
in self.data:
745 if particle[
'index'] == index :
◆ read()
def read.ensemble.read |
( |
|
self | ) |
|
Definition at line 709 of file read.py.
710 x = pylabload(self.filename, comments=
'#', delimiter=self.delimiter)
715 u1_ = x1_+self.components
716 payload_ = u1_+self.components
717 ipe_ = payload_+self.npayload
719 index_ = iteration_+1
721 if x.shape[1] == index_+1 :
724 self.data.append({
't':particle[t_],
725 'dt':particle[dt_],
'x':np.array(particle[x1_:x1_+self.components]),
726 'u':np.array(particle[u1_:u1_+self.components]), 727 'payload':np.array(particle[payload_:payload_+self.npayload]),
728 'ipe':particle[ipe_].astype(np.int),
'iteration':particle[iteration_].astype(np.int),
'index':particle[index_].astype(np.int)})
731 print(
'File inconsistent, assuming iteration counter overflow')
733 self.data.append({
't':particle[t_],
734 'dt':particle[dt_],
'x':np.array(particle[x1_:x1_+self.components]),
735 'u':np.array(particle[u1_:u1_+self.components]), 736 'payload':np.array(particle[payload_:payload_+self.npayload]),
737 'garbage':particle[ipe_].astype(np.int),
'index':particle[index_-1].astype(np.int)})
◆ components
◆ data
◆ delimiter
◆ filename
◆ filenameout
read.ensemble.filenameout |
◆ isLoaded
◆ npayload
◆ offset
The documentation for this class was generated from the following file: