matlab identification code

This commit is contained in:
2018-10-04 09:56:25 +02:00
parent 85364c9a59
commit fa00a1ef25
3 changed files with 294 additions and 1 deletions

View File

@@ -27,7 +27,6 @@ import matplotlib as mpl
#mpl.use('GTKAgg')
import matplotlib.pyplot as plt
from scipy import signal
from utilities import *
sys.path.insert(0,os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
#import pbtools.misc.pp_comm as pp_comm -> pp_comm.PPComm
@@ -231,6 +230,13 @@ Examples:'''+''.join(map(lambda s:cmd+s, exampleCmd))+'\n '
fig=plt.figure(mot)
tune.bode_current(motor=mot, magMove=1000, magPhase=500, dwell=10, file=fn,fig=fig)
plt.show(block=False)
f=np.load(fn)
fn=fn[:-3]+'mat'
import scipy.io
scipy.io.savemat(fn, mdict=f)
print('save to matlab file:'+fn)
elif mode==2: # full recording open loop
for mot in (1, 2):
fsin=os.path.join(base, 'sine_ol_mot%d.npz' % (mot))