Load 1D comma separated list from a cut.
More...
Load 1D comma separated list from a cut.
Definition at line 531 of file read.py.
◆ __init__()
def read.loadcsv.__init__ |
( |
|
self, |
|
|
|
offset, |
|
|
|
get = 1 , |
|
|
|
file = 'data' , |
|
|
|
dir = 1 , |
|
|
|
coord = 0. , |
|
|
|
silent = 0 |
|
) |
| |
Definition at line 532 of file read.py.
532 def __init__(self,offset,get=1,file='data',dir=1,coord=0.,silent=0):
535 self.filenameout = file
538 self.isLoaded =
False 541 if (self.silent == 0): print(
'========================================')
542 if (self.silent == 0): print(
'loading file %s' % (self.filename))
def __init__(self, offset, file='data', headersize=256, nvars=8)
◆ getAll()
def read.loadcsv.getAll |
( |
|
self | ) |
|
Definition at line 570 of file read.py.
572 self.file = open(self.filename,
'r') 573 if (self.silent == 0): print(
'========== Initializing ... ============')
578 if (self.silent == 0): print(
'Reading data time= %f sec' % (tdata-t0))
◆ getData()
def read.loadcsv.getData |
( |
|
self | ) |
|
Definition at line 581 of file read.py.
583 for var
in self.header:
584 exec(
"self.%s = pylabload(self.filename,usecols=[i],skiprows=1, delimiter=',')" % (var))
586 exec(
"self.ncells = len(self.%s)" % (self.getHeader()[0]))
◆ getHeader()
def read.loadcsv.getHeader |
( |
|
self | ) |
|
Definition at line 562 of file read.py.
564 self.header=self.file.readline().split(
',')
565 self.header[-1]=self.header[-1].rstrip(
'\n')
◆ makefilename()
def read.loadcsv.makefilename |
( |
|
self | ) |
|
Definition at line 548 of file read.py.
548 def makefilename(self):
549 number=
'%+.2e' % self.coord
550 if self.coord >= 0.
and abs(self.coord) >1.:
551 self.filename = self.filenameout+
'_d'+str(self.dir)+
'_x+'+
'0.'+number[1]+number[3]+
'D+'+str(int(np.log10(abs(self.coord)))+1).zfill(2)+
'_n'+str(self.offset).zfill(4)+
'.csv' 552 if self.coord < 0.
and abs(self.coord) >1.:
553 self.filename = self.filenameout+
'_d'+str(self.dir)+
'_x-'+
'0.'+number[1]+number[3]+
'D+'+str(int(np.log10(abs(self.coord)))+1).zfill(2)+
'_n'+str(self.offset).zfill(4)+
'.csv' 554 if self.coord > 0.
and abs(self.coord) <=1.:
555 self.filename = self.filenameout+
'_d'+str(self.dir)+
'_x+'+
'0.'+number[1]+number[3]+
'D+'+str(int(np.log10(abs(self.coord)))).zfill(2)+
'_n'+str(self.offset).zfill(4)+
'.csv' 556 if self.coord < 0.
and abs(self.coord) <=1.:
557 self.filename = self.filenameout+
'_d'+str(self.dir)+
'_x-'+
'0.'+number[1]+number[3]+
'D+'+str(int(np.log10(abs(self.coord)))).zfill(2)+
'_n'+str(self.offset).zfill(4)+
'.csv' 559 self.filename = self.filenameout+
'_d'+str(self.dir)+
'_x+'+
'0.'+number[1]+number[3]+
'D+'+str(0).zfill(2)+
'_n'+str(self.offset).zfill(4)+
'.csv'
◆ coord
◆ dir
◆ file
◆ filename
◆ filenameout
◆ header
◆ isLoaded
◆ offset
◆ silent
The documentation for this class was generated from the following file: