Welcome to iraf.net Saturday, April 20 2024 @ 03:46 AM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Problem with rfits
   
grayro
 03/18/2015 07:11PM (Read 971 times)  
++---
Junior

Status: offline


Registered: 03/15/2014
Posts: 23
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* \$this->_split2($m[0]) imlist.lis
list = "imlist.lis"
i = i+1
if(i \$this->_split2($m[0]) 5) break
}

rfits reads in the files, but then the script stops and the file im* \$this->_split2($m[0]) imlist.lis is never executed. The result I get is:

ecl\$this->_split2($m[0]) WFI_2
**: }
^
ERROR: syntax error
called as: `rfits (fits_file=@list.lis, file_list=*, iraf_file=im)'
File: /usr/local/WFI/hd96064B_001.fit -\$this->_split2($m[0]) im00010000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
File: /usr/local/WFI/hd96064B_002.fit -\$this->_split2($m[0]) im00020000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
File: /usr/local/WFI/hd96064B_003.fit -\$this->_split2($m[0]) im00030000.fits size=3352x2532
bitpix=16 bscale=1. bzero=32768. pixtype=ushort
Extension: 1 End of data
File: /usr/local/WFI/hd96064B_004.fit -\$this->_split2($m[0]) 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\$this->_split2($m[0])

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

 
Profile Email
 Quote
fitz
 03/26/2015 06:38PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
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:

PHP Formatted Code

    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.

 
Profile Email
 Quote
   
Content generated in: 0.12 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