updating snapshot and loading datasets
This commit is contained in:
@@ -9,5 +9,6 @@ from .save import getDatasetFileName
|
||||
from .load import loadDataset
|
||||
from .elog import writeElog
|
||||
from .slic import SlicScan
|
||||
from .slic import importSlicScan
|
||||
from .doocs import doocsread
|
||||
from .doocs import doocswrite
|
||||
|
||||
+14
-2
@@ -3,10 +3,22 @@ import h5py
|
||||
|
||||
def loadDataset(filename):
|
||||
hid = h5py.File(filename, "r")
|
||||
icount = 0
|
||||
snap = loadSnap(hid)
|
||||
data = loadData(hid)
|
||||
act = loadActuator(hid)
|
||||
data =[]
|
||||
act = []
|
||||
for key in hid.keys():
|
||||
if 'scan' in key:
|
||||
ID = int(key.split('_')[1])
|
||||
print('Reading scan_%d' % ID)
|
||||
data.append(loadData(hid,ID))
|
||||
act.append(loadActuator(hid,ID))
|
||||
icount +=1
|
||||
hid.close()
|
||||
if icount == 0:
|
||||
return None, None, None
|
||||
elif icount == 1:
|
||||
return data[0], act[0],snap
|
||||
return data,act,snap
|
||||
|
||||
def loadSnap(hid):
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class SlicScan(QObject):
|
||||
Thread(name='Snap-Acquisition',target=self.Tsnap).start()
|
||||
|
||||
def Tsnap(self):
|
||||
self.snap = getSnap()
|
||||
self.snap = getSnap()
|
||||
print('Acquired snap')
|
||||
self.sigsnap.emit(True)
|
||||
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ def loadSnap(filename):
|
||||
if '.' in val:
|
||||
res[pv]=float(val)
|
||||
else:
|
||||
res[pv]= val
|
||||
res[pv]= val # might be string!!!!
|
||||
return res
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user