Welcome to iraf.net Wednesday, May 01 2024 @ 11:22 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Trim script error
   
piverson
 11/30/2007 09:13PM (Read 2867 times)  
+++--
Chatty

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?

 
Profile Email
 Quote
fitz
 11/30/2007 09:13PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Quick guess: The 'end' statement following the 'string' variable declarations instead of being the last line in the script. -Mike

 
Profile Email
 Quote
piverson
 11/30/2007 09:13PM  
+++--
Chatty

Status: offline


Registered: 07/10/2007
Posts: 42
The problem was actually in my login.cl.

 
Profile Email
 Quote
   
Content generated in: 0.09 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login