View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

imgets problem in cl

morrisonss wrote on Sep 18, 2009

I am working on a script for creating master calibration images for some photometry that I am working on. When I try to use imgets to retrieve the exposure time from the header files i get the error:

**: }
\t ^
ERROR: syntax error
called as: `imgets (image=/home/morrison/Solar_analogs/Darks/DARK_Prompt2_09_02_09_282290__001.fits, param=EXPOSURE)'

I am not sure what is causing this error. My .cl script for the section with the error is as follows:

files /home/morrison/Solar_analogs/Darks/DARK* >Biasfiles.lis
list = "Biasfiles.lis"
while(fscan(list,s1) != EOF)
{
imgets(s1, "EXPOSURE")
tim = real(imgets.value)
if(tim==0)
{
copy s1 /home/morrison/Solar_analogs/Darks/biastemp/s1
}
}
files /home/morrison/Solar_analogs/Darks/biastemp > Biasfiles.lis
imcombine Biasfiles.lis BIAS combine=average reject=avsigclip

Mike Fitzpatrick wrote on Sep 18, 2009

Two things: There is a quirk of the CL that an 'if' statement sometimes needs to be followed by a semicolon to avoid expecting an 'else'. For example,


while (..) {
   if (...) {
   }
   ;
}


Another problem is the 'copy' command where the literal path needs to be concatenated with the 's1' variable, i.e.

copy (s1, "/home/morrison/Solar_analogs/Darks/biastemp/" // s1)


-Mike

morrisonss wrote on Sep 18, 2009

works thanks

Last post on Sep 18, 2009