Skip to Content.
Sympa Menu

opal - Re: [Opal] String variable for aperture

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] String variable for aperture


Chronological Thread 
  • From: Christof Metzger-Kraus <christof.j.kraus AT gmail.com>
  • To: Simon Friederich <s.friederich AT uni-mainz.de>
  • Cc: opal <opal AT lists.psi.ch>
  • Subject: Re: [Opal] String variable for aperture
  • Date: Wed, 1 Apr 2020 15:26:47 +0200
  • Authentication-results: localhost; iprev=pass (mail-il1-f179.google.com) smtp.remote-ip=209.85.166.179; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com

Hi Simon,

it seems that this isn't supported (yet). The variable names apert1 and apert2 are evaluated as strings instead of taking their values. 

Have to look into the code to check if we could change that behavior. 

Christof 


Simon Friederich <s.friederich AT uni-mainz.de> schrieb am Mi., 1. Apr. 2020, 13:26:

Dear all,

As we have changing apertures throughout our beamline I'd really like to use string variables but I don't get the correct syntax. I want something like:

STRING apert1 = "circle(0.015)"
STRING apert2 = "circle(0.030)"

drift1: DRIFT, ELEMEDGE=0.5, APERTURE=apert1, L=0.5;
drift2: DRIFT, ELEMEDGE=1, APERTURE=apert2, L=0.5;

But the error appears
Error> *** User error detected by function "OpalElement::getApert()"
Error>     Unknown aperture type 'APERT1'.
Error>     Unknown aperture type 'APERT1'.

Do I miss something?

Best regards
Simon

P.S.: I know this workaround does it
REAL napert1 = 0.015;

REAL napert2 = 0.030;

drift1: DRIFT, ELEMEDGE=0.5, APERTURE="circle(" & STRING(napert1) & ")", L=0.5;
drift1: DRIFT, ELEMEDGE=1, APERTURE="circle(" & STRING(napert2) & ")", L=0.5;

But maybe there is a better way to do it.

-- 
------------------------------------
Dr. Simon Friederich
Helmholtz-Institut Mainz
Kollaboration B / ACID
Johannes Gutenberg-Universität Mainz
Staudingerweg 18
55128 Mainz, Deutschland

Tel.: +49 (0)6131 39-23160
E-Mail: s.friederich AT uni-mainz.de
------------------------------------



Archive powered by MHonArc 2.6.19.

Top of Page