Problem with rfits
grayro wrote on Mar 18, 2015
Hi,
I am reposting this, as the original seems to have been lost. I am having a problem with rfits in a simple script which I do not seem to be able to get past. The script is:
string star = "first"
string *nlist
real expos
int f
i = 0
while(star != "null") {
!readstarWFI
list = "current.dat"
j = fscan(list,star)
rfits @list.lis * im
files im* > imlist.lis
list = "imlist.lis"
i = i+1
if(i > 5) break
}
rfits reads in the files, but then the script stops and the file im* > imlist.lis is never executed. The result I get is:
ecl> WFI_2
**: }
^
ERROR: syntax error
called as: `rfits (fits_file=@list.lis, file_list=*, iraf_file=im)'
File: /usr/local/WFI/hd96064B_001.fit -> im00010000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
File: /usr/local/WFI/hd96064B_002.fit -> im00020000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
File: /usr/local/WFI/hd96064B_003.fit -> im00030000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
File: /usr/local/WFI/hd96064B_004.fit -> im00040000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
"rfits @list.lis * im"
line 11: WFI_2.cl
called as: `WFI_2 ()'
ecl>
I do not know what **: } means. Even though the script complains about rfits, the files are read in correctly. I expect I am doing something dumb, but can't see it at the moment.
Richard
Mike Fitzpatrick wrote on Mar 26, 2015
The error message pointing to the closing brace makes me think this is being caused by a quick in the CL where an 'if' statement sometimes needs to be terminated with a semicolon to keep the parser from looking for an 'else' statement. In this case, the statement at the end of your loop should look like:
if (i > 5)
break
; # <--- add this
}
I'm not sure what the external task produces or what's in the @file created, but post back if this doesn't explain it.
Last post on Mar 26, 2015