Status: offline
Registered: 07/10/2007
Posts: 42
|
Mike-The script is pasted below. I know you don't recommend using the begin-end syntax that we did but it is the only way that we have found to be able to use optional prompts (i.e. prompts that only need to be called in certain circumstances).We tried unlearning the task and then logging back in but it still didn't work.[size=9:e06664a361][color=blue:e06664a361]procedure ap_pierside_obhead_v_1 (E_or_W)string E_or_W {prompt="Enter orientation of image",enum="E|W"}begin
string EastWest
end#variable declarations
int n=1
int numimg=1
real HA=0.0
real LST=0.0
real RA=0.0
string s1=""
string s2=""
string s3=""
string files=""
struct *list1#deletes possibly incompatible datalists
del data*hselect ("obj*","I,HJD",yes,>"datalist1")
tsort ("datalist1",2)
sections @datalist1
numimg=section.nimageshselect ("obj*","$I",yes,>"datalistfiles")
hselect ("obj*","$I,LST,RA",yes,>"datalistLSTRAtemp1")sed -e 's/" "/:/g' "datalistLSTRAtemp1" >"datalistLSTRAtemp2"list1="datalistLSTRAtemp2"
while (fscan(list1,s1,s2,s3)!=EOF){
print (s2,>>"datalistLSTtemp")
print (s3,>>"datalistRAtemp")
}
sed -e 's/[^0-9:.]//g' "datalistLSTtemp" >"datalistLST"
sed -e 's/[^0-9:.]//g' "datalistRAtemp" >"datalistRA"joinlines ("datalistfiles,datalistLST,datalistRA",>"datalisttotal")
list1="datalisttotal"
while (fscan(list1,s1,s2,s3)!=EOF){
files=(s1)
LST=real(s2)
RA=real(s3)
HA=LST-RA
if (HA<-0.3){
hedit (files,"PIER","E",add+,ver-)
rename (files,files//"-E",field="root")
if (n==1){
disp (files,1)
n=n+1
}
;
}
;
if (HA>0.3){
hedit (files,"PIER","W",add+,ver-)
rename (files,files//"-W",field="root")
}
;
if (HA<=-0.3&&HA>=0.3){
if (n!=1){
print ("Image in frame 1 is in East orientation")
}
;
if (n==1){
disp ("*obj*-"//numimg//"*",1)
print ("Image in frame 1 is in West orientation")
}
;
disp (files,2)
print ("")
EastWest=E_or_W
hedit (files,"PIER",EastWest,add+,ver-)
rename (files,files//"-"//EastWest,field="root")
}
;
}#deletes possibly incompatible datalists
del data*beep
[/color:e06664a361][/size:e06664a361]
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Hi Paul,The 'end' should definitely be the last line of the script. Without the proper input files I can't actually run your script, but I'd also suggest the 'struct' variables be declared before the 'begin'. Since the error is coming from the task itself and not something it calls, I'd unlearn the task or try logging into a CL started from a fresh MKIRAF someplace to eliminate any parameters problems. Lastly, before you run the script type 'd_trace' to have the CL trace execution of the script (post the last page of results if nothing pops out at you).Cheers,
-Mike
|