Status: offline
Registered: 03/15/2014
Posts: 23
|
Hi,
Last year you answered a few questions about a cl host script that I was writing to set up a pipeline for photometry reduction. That script has been working well now since May 2016.
I am now trying to write a similar pipeline for some similar imaging/photometry data, but am running into a problem that I cannot seem to get past. The offending code is as follows:
list = ""
list = "observations.txt"
while(fscan(list,s1,s2) != EOF) {
imcopy(s1,s2)
imgets(image=s2,param="EXPOSURE")
expos = int(imgets.value)
print(expos)
if(expos == 3) imarith(s2, "-", "DARK3", s2)
}
logout
The previous bit of the code makes the master darks and flats, and that all works well. In this part of the code, I am trying to subtract darks from the images. I am copying images from the directory where the originals are kept, and then use imgets to determine the exposure time. That is put into the integer variable expos. Up to that point, all is well, but when I use expos in an if statement, it gives me an error. The fault is not in imarith; if I eliminate the if(expos == 3) it runs. I am certain I am overlooking something minor. I do have the other pipeline that has very similar code. That runs without any problem. What am I doing incorrectly?
The error the iraf ends with is:
**: }
^
ERROR: syntax error
called as: `imcopy (input=orig/hd113319B_001.fit, output=hd113319B_001)'
called as: `cl ()'
"clbye()"
line 29: ccdred$ccdred.cl
called as: `ccdred ()'
called as: `cl ()'
called as: `cl ()'
called as: `cl ()'
"dataio # rfits task required by aptest.cl script"
line 3: apphot$apphot.cl
called as: `apphot ()'
called as: `cl ()'
"clbye()"
line 15: digiphot$digiphot.cl
called as: `digiphot ()'
called as: `cl ()'
"clbye"
line 55: imred$imred.cl
called as: `imred ()'
called as: `cl ()'
called as: `cl ()'
called as: `cl ()'
"clbye()"
line 43: tv$tv.cl
called as: `tv ()'
called as: `cl ()'
called as: `cl ()'
"clbye()"
line 19: dataio$dataio.cl
called as: `dataio ()'
called as: `cl ()'
"clbye()"
line 41: plot$plot.cl
called as: `plot ()'
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
As you can see, it is blaming imcopy, but that is not, evidently, where the error is.
I can send the entire code if you wish. Thanks for your always useful help.
Richard Gray
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Following the "if(expos==3)..." line, try adding a line containing just a ';' (semicolon). I think the problem is a confusion in parsing the 'if' statement where it's looking for a possible 'else' clause.
|