Status: offline
Registered: 07/10/2007
Posts: 42
|
I have been encountering the error "Undefined local variable 'x1'" error while using the following trim script.[color=blue:3ca5a6763b][size=9:3ca5a6763b]#ap_subtrim_v_1.cl by Paul Iverson
#the purpose of this script is to remove possible bad pixels at the edges of the imagesprocedure ap_subtrim_v_1 (xsmall,xlarge,ysmall,ylarge)string xsmall {prompt = "Minimum x value"}
string xlarge {prompt = "Maximum x value"}
string ysmall {prompt = "Minimum y value"}
string ylarge {prompt = "Maximum y value"}begin
string x1
string x2
string y1
string y2
end#variable declarations
int n = 1
int xlen, ylen
string s1 = ""
string dimfile
struct *list1sections ("*obj*fits", opt="fullname", > "datalist1")
match ("sub","datalist1",stop+,>"datalistfile")
del datalist1
tabpar ("datalistfile",1,1)
dimfile = tabpar.valueimgets.param.p_mode = "h"imgets (dimfile, param="i_naxis1")
xlen = int(imgets.value)
imgets (dimfile, param="i_naxis2")
ylen = int(imgets.value)print ("Maximum x value of frame ",xlen)
x1 = xsmall
x2 = xlargeprint ("")print ("Maximum y value of frame ",ylen)
y1 = ysmall
y2 = ylargeimcopy ("obj-*["//x1//":"//x2//","//y1//":"//y2//"]","obj-*//.sub")del data*
[/size:3ca5a6763b][/color:3ca5a6763b]Interestingly enough, I have used this syntax to call a prompt in another script and it works fine.Any ideas?
|