aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/lock_eit.py37
1 files changed, 22 insertions, 15 deletions
diff --git a/examples/lock_eit.py b/examples/lock_eit.py
index bca68e1..db32e3b 100644
--- a/examples/lock_eit.py
+++ b/examples/lock_eit.py
@@ -156,18 +156,17 @@ async def main():
apparatus.state = None
apparatus.runStatus = False
- d=getConfig(apparatus)
- instruments_config=gui.QOLDictionary(a=wp, name='Instruments configs', container=d)
-
SweepSpan = 10000
ai['rfgen'].stopFrequencySweep()
ai['rfgen'].setFreqFixed(freqDeltaM2)
# ai['rfgen'].setFreqFixed(freqZero)
+ ai['rfgen'].setRFAmplitude(3.4)
+ d=getConfig(apparatus)
+ instruments_config=gui.QOLDictionary(a=wp, name='Instruments configs', container=d)
logger.info('========== Initial lock ===========')
- ai['rfgen'].setRFAmplitude(0)
rfPout = ai['rfgen'].getRFAmplitude()
apparatus.state = f'Initial lock RF power {rfPout} dBm'
logger.info(apparatus.state)
@@ -181,17 +180,24 @@ async def main():
logger.info('========= Long term lock ===========')
apparatus.gui_log.setTraces( initLog() )
- for p in np.linspace(0,9, 110):
- ai['rfgen'].setRFAmplitude(p)
- rfPout = ai['rfgen'].getRFAmplitude()
- apparatus.state = f'Long term lock RF power {rfPout} dBm'
- logger.info(apparatus.state)
- update_webpage(apparatus=apparatus)
- ai['pid'].reset()
- apparatus.runStatus = True
- res = await asyncio.gather(
- feedbackLoop(apparatus, nsteps=50)
- )
+ apparatus.runStatus = True
+ apparatus.state = f'Long term lock RF power {rfPout} dBm'
+ logger.info(apparatus.state)
+ update_webpage(apparatus=apparatus)
+ res = await asyncio.gather(
+ feedbackLoop(apparatus, nsteps=100000)
+ )
+ # for p in np.linspace(0,9, 110):
+ # ai['rfgen'].setRFAmplitude(p)
+ # rfPout = ai['rfgen'].getRFAmplitude()
+ # apparatus.state = f'Long term lock RF power {rfPout} dBm'
+ # logger.info(apparatus.state)
+ # update_webpage(apparatus=apparatus)
+ # ai['pid'].reset()
+ # apparatus.runStatus = True
+ # res = await asyncio.gather(
+ # feedbackLoop(apparatus, nsteps=50)
+ # )
apparatus.state = 'Done working with hardware'
logger.info(apparatus.state)
@@ -199,6 +205,7 @@ async def main():
apparatus.gui_log.stop_tasks()
task_wp_update_loop.cancel()
logger.info("exiting main loop")
+ update_webpage(apparatus=apparatus)
return(apparatus)
def update_webpage(byWhom=None, apparatus=None):