diff options
-rw-r--r-- | examples/lock_eit.py | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/examples/lock_eit.py b/examples/lock_eit.py index a20d984..8129afc 100644 --- a/examples/lock_eit.py +++ b/examples/lock_eit.py @@ -217,6 +217,30 @@ async def responseToChangeOfBfieldControlVoltage(apparatus, extra_tags={}): return float(slope) +async def record_magnetometer_noise(apparatus): + ai = apparatus.instruments + rfPout = apparatus.getRFAmplitude() + apparatus.state = f'Record magnetometer noise, RF power {rfPout} dBm' + logger.info(apparatus.state) + + scope = ai['scope.monitor'] + old_config = scope.getConfig() + tperdiv=1 + scope.setTimePerDiv(tperdiv) + scope.setRoll(True) + + await asyncio.sleep(tperdiv*14 + 1) + errorTr=scope.getTrace(1) + errorTr.config['label'] = 'error' + log = errorTr + log.config['tags']['apparatus']=getConfig(apparatus) + + apparatus.gui_log.setTraces( log ) + update_webpage(apparatus=apparatus) + + logger.info('Restoring scope settings') + scope.setConfig(old_config) + async def longTermLock(apparatus, extra_tags={}): ai = apparatus.instruments rfPout = apparatus.getRFAmplitude() @@ -336,6 +360,15 @@ async def main(): await initial_lock_to_eit(apparatus, extra_tags=extra_tags) + await record_magnetometer_noise(apparatus) + + apparatus.gui_log.stop_tasks() + task_wp_update_loop.cancel() + logger.info("exiting main loop") + update_webpage(apparatus=apparatus) + return(apparatus) + + lockin_slope= await calibratingLockin(apparatus, extra_tags=extra_tags) ai['error_signal_response_to_eit_detuning'].conversion_factor = lockin_slope instruments_config.container = getConfig(apparatus) @@ -457,7 +490,7 @@ if __name__ == '__main__': apparatus = Apparatus(tsdb_ingester=tsdb_ingester, device_nickname='magnetometer',) apparatus.config['Device type'] = 'QOL VAMPIRE HighPower magnetometer' apparatus.config['Device model'] = 'v0.1' - apparatus.config['FnamePrefix'] = 'locked_magnetometer' + apparatus.config['FnamePrefix'] = 'magnetometer' apparatus.config['SavePath'] = '/mnt/qol_grp_data/data.VAMPIRE.HighPower' # apparatus.config['SavePath'] = './data' |