Skip to content
Snippets Groups Projects
Commit bf131089 authored by Yngve Levinsen's avatar Yngve Levinsen
Browse files

ess.TraceWin.density_file upgraded to API version 10

parent dbfd30e8
No related branches found
No related tags found
No related merge requests found
......@@ -582,6 +582,9 @@ class density_file:
self.Xouv=numpy.zeros(counter)
self.Youv=numpy.zeros(counter)
if self.version>=9:
self.dXouv=numpy.zeros(counter)
self.dYouv=numpy.zeros(counter)
self.moy=numpy.zeros((counter,7))
self.moy2=numpy.zeros((counter,7))
......@@ -589,6 +592,10 @@ class density_file:
self._max=numpy.zeros((counter,7))
self._min=numpy.zeros((counter,7))
if self.version>=10:
self.maxR=numpy.zeros((counter,7))
self.minR=numpy.zeros((counter,7))
if self.version>=5:
self.rms_size=numpy.zeros((counter,7))
self.rms_size2=numpy.zeros((counter,7))
......@@ -633,7 +640,7 @@ class density_file:
# in case we did not read all data, this will detect our mistake:
shift=0
while year!=2011 or version not in [8,9]:
while year!=2011 or version not in [8,9,10,11,12]:
shift+=1
version=year
year=numpy.fromfile(self.fin, dtype=numpy.int16, count=1)[0]
......@@ -655,13 +662,19 @@ class density_file:
if self.envelope:
if self.version==8:
numpy.fromfile(self.fin, dtype=numpy.int16, count=292/2)
if self.version==9:
numpy.fromfile(self.fin, dtype=numpy.int16, count=300/2)
numpy.fromfile(self.fin, dtype=numpy.int16, count=292//2)
elif self.version==9:
numpy.fromfile(self.fin, dtype=numpy.int16, count=300//2)
elif self.version==10:
numpy.fromfile(self.fin, dtype=numpy.int16, count=356//2)
else:
raise TypeError("It is not possible to read this format..")
elif self.version==8:
numpy.fromfile(self.fin, dtype=numpy.int16, count=12344/2)
numpy.fromfile(self.fin, dtype=numpy.int16, count=12344//2)
elif self.version==9:
numpy.fromfile(self.fin, dtype=numpy.int16, count=12352/2)
numpy.fromfile(self.fin, dtype=numpy.int16, count=12352//2)
elif self.version==10:
numpy.fromfile(self.fin, dtype=numpy.int16, count=12408//2)
elif self.Nrun>1:
#WARN not 100% sure if this is correct..
numpy.fromfile(self.fin, dtype=numpy.int16, count=((5588+self.Nrun*12)/2))
......@@ -709,6 +722,10 @@ class density_file:
self._max[self.i]=numpy.fromfile(self.fin, dtype=numpy.float32, count=n)[:]
self._min[self.i]=numpy.fromfile(self.fin, dtype=numpy.float32, count=n)[:]
if self.version>=10:
self.maxR[self.i]=numpy.fromfile(self.fin, dtype=numpy.float32, count=n)[:]
self.minR[self.i]=numpy.fromfile(self.fin, dtype=numpy.float32, count=n)[:]
if self.version>=5:
self.rms_size[self.i]=numpy.fromfile(self.fin, dtype=numpy.float32, count=n)
self.rms_size2[self.i]=numpy.fromfile(self.fin, dtype=numpy.float32, count=n)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment