beta beat optimization

Moderators: cyao, michael_borland

Samira.kasaei
Posts: 23
Joined: 15 Jun 2021, 13:38

Re: beta beat optimization

Post by Samira.kasaei » 29 Aug 2021, 03:34

Dear,

I run "file computeBeats" and I grt :computeBeats: POSIX shell script, ASCII text executable.

Then I run oagtclsh computeBeats and I get:
can't read "0": no such variable
while executing
"exec oagtclsh "$0" "$@""
(file "computeBeats" line 4)

Cheers,
Samira

Samira.kasaei
Posts: 23
Joined: 15 Jun 2021, 13:38

Re: beta beat optimization

Post by Samira.kasaei » 21 Sep 2021, 01:46

Dear Michael,
Concerning my question about beta beat computing, still I couldn't get any result.
May I ask you kindly to give me some hint?
I run
./computeBeats -reference perfectLattice.twi -input perturbedLattice.twi
but I get this message:

can't read "0": no such variable
while executing
"exec oagtclsh "$0" "$@""
(file "./computeBeats" line 4)

I do appreciate all of your help.

Cheers,
Samira

soliday
Posts: 371
Joined: 28 May 2008, 09:15

Re: beta beat optimization

Post by soliday » 21 Sep 2021, 08:56

Your message says the problem occurs on line 4. However
exec oagtclsh "$0" "$@"
should be on line 3. It appears that you have an extra line in there somewhere. I will post the entire contents of computeBeats below. You should be able to copy and paste it:

Code: Select all

#!/bin/sh  
# \
exec oagtclsh "$0" "$@"

set auto_path [linsert $auto_path 0  /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]
APSStandardSetup

set usage {usage: computeBeats -reference <filename> -input <filename>}
set reference ""
set input ""
set args $argv
if {[APSStrictParseArguments {input reference}] || ![string length $input] || ![string length $reference]} {
    return -code error "$usage"
}
if ![file exists $input] {
    return -code error "not found: $input"
}
if ![file exists $reference] {
    return -code error "not found: $reference"
}

exec sddsxref $input $reference -pipe=out -take=betax,betay,etax,s \
    -match=ElementName -edit=column,*,ei/0/ -nowarning  -reuse=page \
  | sddsprocess -pipe \
  "-define=column,deltas,s s0 -,units=m" \
  -filter=col,deltas,0,0 \
  "-define=column,deltaBetax,betax betax0 - betax0 / 100 *,units=%" \
  "-define=column,deltaBetay,betay betay0 - betay0 / 100 *,units=%" \
  -process=etax,largest,%sLargest \
  "-define=column,deltaEtax,etax etax0 - etaxLargest / 100 *,units=%" \
  | sddsprocess -pipe=in $input.beat \
    -process=delta*ta*,spread,%sSpread \
    -process=delta*ta*,stand,%sStDev \
    "-print=parameter,betaxLabel,%.2f%% pk-to-pk    %.2f%% rms,deltaBetaxSpread,deltaBetaxStDev" \
    "-print=parameter,etaxLabel,%.2f%% pk-to-pk    %.2f%% rms,deltaEtaxSpread,deltaEtaxStDev" \
    "-print=parameter,betayLabel,%.2f%% pk-to-pk    %.2f%% rms,deltaBetaySpread,deltaBetayStDev" \

exec sddsplot -layout=1,3 -split=page -groupby=page,names -separate=names $input.beat \
    -column=s,deltaBetax -title=@betaxLabel \
    -column=s,deltaBetay -title=@betayLabel \
    -column=s,deltaEtax -title=@etaxLabel  &
 

Samira.kasaei
Posts: 23
Joined: 15 Jun 2021, 13:38

Re: beta beat optimization

Post by Samira.kasaei » 22 Sep 2021, 07:23

Dear soliday,

I did copy and paste in computeBeats file, then I run it. I get this message:

no such variable
(read trace on "env(HOST_ARCH)")
invoked from within
"linsert $auto_path 0 /usr/local/oag/apps/lib/$env(HOST_ARCH)"
invoked from within
"set auto_path [linsert $auto_path 0 /usr/local/oag/apps/lib/$env(HOST_ARCH)]"
(file "./computeBeats" line 5)

Cheers,
Samira

soliday
Posts: 371
Joined: 28 May 2008, 09:15

Re: beta beat optimization

Post by soliday » 22 Sep 2021, 10:08

The HOST_ARCH and EPICS_HOST_ARCH are environment variables that should both be set to linux-x64_64
If you are using the bash shell you can put this into the ~/.bashrc file:
export HOST_ARCH=linux-x86_64
export EPICS_HOST_ARCH=linux-x86_64

Post Reply