From 9baeee259a6393cce586dfde02cb61db76a7c6b6 Mon Sep 17 00:00:00 2001 From: Ryoichi Miyamoto <ryoichi.miyamoto@esss.se> Date: Thu, 18 Aug 2016 23:11:54 +0200 Subject: [PATCH] Asymmetric aperture of DRIFT element implemented. --- ess/lib_tw_elem.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ess/lib_tw_elem.py b/ess/lib_tw_elem.py index 95a0837..aebc37e 100644 --- a/ess/lib_tw_elem.py +++ b/ess/lib_tw_elem.py @@ -1,4 +1,3 @@ - ''' - Classes for TraceWin elements/commands for external manipulations. - First double check all the used elements/commands. @@ -74,6 +73,10 @@ - ADJUST activated. - max added to THIN_STEERING. + + * 2016.08.18 + + - Asymmetric aperture of DRIFT implemented. ''' #---- Libs @@ -293,16 +296,22 @@ class DRIFT(ELEM): self.apt=float(para[1]) # TW option instances - try : self.apty=float(para[2]) - except: self.apty= 0.0 + try : self.apty =float(para[2]) + except: self.apty = 0.0 + try : self.aptx_cent=float(para[3]) + except: self.aptx_cent= 0.0 + try : self.apty_cent=float(para[4]) + except: self.apty_cent= 0.0 def get_tw(self): if self.name!='': lin=self.name+': '+self.typ+' ' if self.name=='': lin= self.typ+' ' - lin+=str(self.L*1e3)+' ' - lin+=str(self.apt )+' ' - lin+=str(self.apty ) + lin+=str(self.L*1e3 )+' ' + lin+=str(self.apt )+' ' + lin+=str(self.apty )+' ' + lin+=str(self.aptx_cent)+' ' + lin+=str(self.apty_cent) return lin -- GitLab