From 950bdc338166ba8499e44fbfc36612bc08b17c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CRoman?= <“mankowsky_r@psi.ch”> Date: Fri, 24 May 2019 09:53:52 +0200 Subject: [PATCH] added smar_config to config file. smaract stages are added to las by looping through the smar_config dict (smar_name,smar_address),e.g. {'thz_z':'-ESB1'} --- eco/bernina/config.py | 2 +- eco/loptics/bernina_experiment.py | 73 ++++--------------------------- 2 files changed, 9 insertions(+), 66 deletions(-) diff --git a/eco/bernina/config.py b/eco/bernina/config.py index 0aee99a..bd4e412 100755 --- a/eco/bernina/config.py +++ b/eco/bernina/config.py @@ -298,7 +298,7 @@ components = [ "z_und": 142, "desc": "Experiment laser optics", "type": "eco.loptics.bernina_experiment:Laser_Exp", - "kwargs": {"Id": "SLAAR21-LMOT"}, + "kwargs": {"Id": "SLAAR21-LMOT", "smar_config": config["las_smar_config"]}, }, { "args": ["SLAAR21-LTIM01-EVR0"], diff --git a/eco/loptics/bernina_experiment.py b/eco/loptics/bernina_experiment.py index 058bf32..505f4b2 100755 --- a/eco/loptics/bernina_experiment.py +++ b/eco/loptics/bernina_experiment.py @@ -23,12 +23,13 @@ def addDelayStageToSelf(self, stage=None, name=None): class Laser_Exp: - def __init__(self, Id=None, name=None): + def __init__(self, Id=None, name=None, smar_config=None): self.Id = Id self.IdExp1 = "SARES20-EXP" self.IdSA = "SARES23" self.name = name self.alias = Alias(name) + self.smar_config = smar_config # Waveplate and Delay stage try: @@ -97,71 +98,13 @@ class Laser_Exp: # SmarAct ID ### Mirrors used in the experiment ### - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB18", name="tt_rot") - # self._eos_rot = SmarActRecord(self.IdSA+'-ESB18') - # self.eos_rot = User_to_motor(self._eos_rot,180./35.7,0.) - except: - print("No Smaract EOSrot") - pass - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB2", name="pump_x") - except: - print("No Smaract EOSGonio") - pass - - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB1", name="pump_gonio") - except: - print("No Smaract EOSx") - pass - - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB16", name="pump_rot") - # self.thz_rot = User_to_motor(self._thz_rot,180./35.7,0.) - except: - print("No Smaract THzrot") - pass - - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB5", name="thz_gonio") - except: - print("No Smaract THzGonio") - pass - - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB4", name="tar_focus") - # self.thz_z = SmarActRecord(self.IdSA+'-ESB4') - except: - print("No Smaract THzZ") - pass - - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB6", name="tt_gon") - # self.par_x = SmarActRecord(self.IdSA+'-ESB6') - except: - print("No Smaract ParX") - pass - try: - addSmarActRecordToSelf(self, Id=self.IdSA + "-ESB3", name="spatialenc_df_lens") - except: - print("No Smaract ParZ") - pass - - ### Motors on EXP1 deltatau - try: - addMotorRecordToSelf(self, Id=self.IdExp1 + ":MOT_VT80", name="tar_y") - # self.par_y = MotorRecord(self.IdExp1+':MOT_VT80') - except: - print("No Smaract ParY") - pass - try: - addMotorRecordToSelf(self, Id=self.IdExp1 + ":MOT_TX", name="tar_transl") - # self.par_y = MotorRecord(self.IdExp1+':MOT_VT80') - except: - print("No target translation") - pass + for smar_name, smar_address in self.smar_config.items(): + try: + addSmarActRecordToSelf(self, Id=(self.IdSA + smar_address), name=smar_name) + except: + print("Loading %s SmarAct motor in bernina laser conifg failed")%(smar_name) + pass def get_adjustable_positions_str(self): ostr = "*****Laser motor positions******\n"