From d90dca4ce0c7cfb69000f00348c5a5dc4f577065 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 22 Dec 2021 17:51:12 -0500 Subject: better code structure --- examples/lock_eit.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/lock_eit.py b/examples/lock_eit.py index 4fcadfa..8d868f3 100644 --- a/examples/lock_eit.py +++ b/examples/lock_eit.py @@ -165,7 +165,7 @@ async def main(): rfPstop = 10 rfPowerList = np.linspace(rfPstart, rfPstop, 11) rfPower0 = rfPstart - rfPower0 = 9 + rfPower0 = 3.4 ai['rfgen'].setRFAmplitude(rfPower0) d=getConfig(apparatus) @@ -188,7 +188,7 @@ async def main(): apparatus.state = f'Calibrating lockin response at RF power {rfPout} dBm' logger.info(apparatus.state) update_webpage(apparatus=apparatus) - ai['pid'].setEnable(True) + ai['pid'].setEnable(False) ai['pid'].reset() apparatus.gui_log.setTraces( initLog() ) res = await asyncio.gather( @@ -203,6 +203,7 @@ async def main(): res = await asyncio.gather( feedbackLoop(apparatus, nsteps=20) ) + ai['rfgen'].setFreqFixed(fr0) log = apparatus.gui_log.traces trE=log.getTrace('error') @@ -221,10 +222,12 @@ async def main(): logger.info('========= Long term lock ===========') apparatus.gui_log.setTraces( initLog() ) + apparatus.gui_log.traces.config['tags']['lockin_slope']=float(lockin_slope) apparatus.runStatus = True async def longTermLock(): apparatus.state = f'Long term lock RF power {rfPout} dBm' + ai['pid'].setEnable(True) logger.info(apparatus.state) update_webpage(apparatus=apparatus) res = await asyncio.gather( @@ -234,6 +237,7 @@ async def main(): async def sweepRFPower(): # for p in np.linspace(-10,10, 110): + ai['pid'].setEnable(True) for p in rfPowerList: ai['rfgen'].setRFAmplitude(p) rfPout = ai['rfgen'].getRFAmplitude() -- cgit v1.2.3