aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-22 15:46:03 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-22 15:46:03 -0500
commitfdf0d60a6b2f3bc1d6ec5852dc6e30cbf48aa3c2 (patch)
treebb262e1b5396dc93353eb219005c8f2300177da9 /examples
parent911bbcaf9e4892c1811ab983fae770f6c8c53b60 (diff)
downloadpyExpControl-fdf0d60a6b2f3bc1d6ec5852dc6e30cbf48aa3c2.tar.gz
pyExpControl-fdf0d60a6b2f3bc1d6ec5852dc6e30cbf48aa3c2.zip
made subfunctions for simplier code setup
Diffstat (limited to 'examples')
-rw-r--r--examples/lock_eit.py50
1 files changed, 32 insertions, 18 deletions
diff --git a/examples/lock_eit.py b/examples/lock_eit.py
index 71c9d6b..aadfe7f 100644
--- a/examples/lock_eit.py
+++ b/examples/lock_eit.py
@@ -158,9 +158,15 @@ async def main():
SweepSpan = 10000
ai['rfgen'].stopFrequencySweep()
# ai['rfgen'].setFreqFixed(freqDeltaMm2)
- ai['rfgen'].setFreqFixed(freqZero)
- # ai['rfgen'].setFreqFixed(freqDeltaMp2)
- ai['rfgen'].setRFAmplitude(0)
+ # ai['rfgen'].setFreqFixed(freqZero)
+ ai['rfgen'].setFreqFixed(freqDeltaMp2)
+
+ rfPstart = -10
+ rfPstop = 10
+ rfPowerList = np.linspace(rfPstart, rfPstop, 11)
+ rfPower0 = rfPstart
+ rfPower0 = 3.4
+ ai['rfgen'].setRFAmplitude(rfPower0)
d=getConfig(apparatus)
instruments_config=gui.QOLDictionary(a=wp, name='Instruments configs', container=d)
@@ -174,31 +180,39 @@ async def main():
ai['pid'].reset()
apparatus.runStatus = True
res = await asyncio.gather(
- feedbackLoop(apparatus, nsteps=100)
+ feedbackLoop(apparatus, nsteps=200)
)
logger.info('========= Long term lock ===========')
apparatus.gui_log.setTraces( initLog() )
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):
- # for p in np.linspace(0,9, 11):
- ai['rfgen'].setRFAmplitude(p)
- rfPout = ai['rfgen'].getRFAmplitude()
+
+ async def longTermLock():
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)
+ feedbackLoop(apparatus, nsteps=100000)
)
-
+ return res
+
+ async def sweepRFPower():
+ # for p in np.linspace(-10,10, 110):
+ for p in rfPowerList:
+ 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)
+ )
+ return res
+
+ # await sweepRFPower()
+ await longTermLock()
apparatus.state = 'Done working with hardware'
logger.info(apparatus.state)