combining beams
Posted: 14 Dec 2010, 16:16
Hello,
I am trying to generate a beam consisting of an array of beamlet separated in x and y by XOff and y Off; see script below. I use the script below and am wondering if there is a more efficient way of doing this (this script is VERY slow especially as the $input.total file start to get bigger and bigger). Thanks! -- Philippe.
----------------------------------------------
#!/bin/sh
# \
exec tclsh "$0" "$@"
if [llength $argv]!=3 {
return -code error
}
set input [lindex $argv 0]
set xOff [lindex $argv 1]
set yOff [lindex $argv 2]
puts "input \t $input"
set ind 0
for { set i -11 } { $i <= 11 } { incr i } {
for { set j -11 } { $j <= 11 } { incr j } {
puts "$i $j"
if {$ind == 0} {
set xIOff [expr $xOff*$i]
set yIOff [expr $yOff*$j]
exec sddsprocess $input.bun $input.temp "-redefine=col,x,x $xIOff +"
exec sddsprocess $input.temp $input.temp2 "-redefine=col,y,y $yIOff +"
exec cp $input.temp2 $input.temp3
}
if {$ind > 0} {
set xIOff [expr $xOff*$i]
set yIOff [expr $yOff*$j]
exec sddsprocess $input.bun $input.temp "-redefine=col,x,x $xIOff +"
exec sddsprocess $input.temp $input.temp2 "-redefine=col,y,y $yIOff +"
exec sddscombine -merge -overwrite $input.temp2 $input.temp3 $input.total
exec cp $input.total $input.temp3
}
set ind [expr $ind + 1]
}
}
I am trying to generate a beam consisting of an array of beamlet separated in x and y by XOff and y Off; see script below. I use the script below and am wondering if there is a more efficient way of doing this (this script is VERY slow especially as the $input.total file start to get bigger and bigger). Thanks! -- Philippe.
----------------------------------------------
#!/bin/sh
# \
exec tclsh "$0" "$@"
if [llength $argv]!=3 {
return -code error
}
set input [lindex $argv 0]
set xOff [lindex $argv 1]
set yOff [lindex $argv 2]
puts "input \t $input"
set ind 0
for { set i -11 } { $i <= 11 } { incr i } {
for { set j -11 } { $j <= 11 } { incr j } {
puts "$i $j"
if {$ind == 0} {
set xIOff [expr $xOff*$i]
set yIOff [expr $yOff*$j]
exec sddsprocess $input.bun $input.temp "-redefine=col,x,x $xIOff +"
exec sddsprocess $input.temp $input.temp2 "-redefine=col,y,y $yIOff +"
exec cp $input.temp2 $input.temp3
}
if {$ind > 0} {
set xIOff [expr $xOff*$i]
set yIOff [expr $yOff*$j]
exec sddsprocess $input.bun $input.temp "-redefine=col,x,x $xIOff +"
exec sddsprocess $input.temp $input.temp2 "-redefine=col,y,y $yIOff +"
exec sddscombine -merge -overwrite $input.temp2 $input.temp3 $input.total
exec cp $input.total $input.temp3
}
set ind [expr $ind + 1]
}
}