View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

for statement error

douglas brenner wrote on Mar 13, 2009

Help Please

ERROR: illegal operation on string 'Warning: Incomplete or reentrant printf
(Old format = "<>%0.20s")
(New format = %s)
ERROR: bus error
"for (i = 1; i <= numspect; i = i+1)"
line 27 ....

The for statement and two brackets { } are the only new lines in an otherwise working code.

procedure findcenter

#string name
int i, numspect
begin
real x1, y1
#string filename
string template, combine
string image1, image2
combine = "/DATA/HIP7918/sum.fits"
template = "/DATA/maxtemp.fits"
numspect = 23
#filename = name
#imslice "/DATA/HIP7918_10-25-08_O_359.fits", "/DATA/HIP7918/slice", 3

#imcombine ( input = "/DATA/HIP7918/slice*.fits" , output = combine, combine = "sum")

imdelete "/Data/HIP7918/corr.fits"
imdelete "/Data/HIP7918/large.fits"
crosscor (input1 = template, input2 = combine//"[65:185,65:185]", output = "/Data/HIP7918/corr.fits", verbose = no, center = yes)
magnify (input = "/Data/HIP7918/corr.fits", output = "/Data/HIP7918/large.fits", xmag = 10, ymag = 10)
imextreme image = "/Data/HIP7918/large.fits"
x1 = (imextreme.xmax - 600)/10
y1 = (imextreme.ymax - 600)/10
print(imextreme.xmax, imextreme.ymax)
print(x1, y1)
for (i= 1; i <=numspect; i= i+1)
{
# if ( i <= 9 )
# {
# image1 = "/DATA/HIP7918/slice00"//str(i)//".fits"
# image2 = "/DATA/HIP7918/shfit00"//str(i)//".fits"
# }
# if ( i >= 10 )
# {
# image1= "/DATA/HIP7918/slice0"//str(i)//".fits"
# image2 = "/DATA/HIP7918/shift0"//str(i)//".fits"
# }

#imshift(input = image1, output = image2//"[0,overwrite]", xshift = x1, yshift = y1)
}

end

Mike Fitzpatrick wrote on Mar 13, 2009

The warning about the '%20s' format would seem to indict the IMCOMBINE task logging feature, but from looking at your script it isn't obvious why this would happen.

Since IMCOMBINE isn't called in your script with all the calls commented it out, it isn't clear how this could be the cause. I'd either do a new MKIRAF to reinitialize the uparm directory or else run the command manually to find the problem. Typing 'd_trace' before running the script will let you find out which command is generating the error, post the last part of the output if you aren't sure.

-Mike

douglas brenner wrote on Mar 13, 2009

thanks

Last post on Mar 13, 2009