imcopy of subsections produces strange “bars” in f
christian wrote on May 27, 2008
Hi,
This time I'm encountering a problem with the imcopy task. What I am trying to do is to copy one small image in the lower left corner of a bigger image. The bigger Image is just a "dummy" with zero values on all pixels. I do this to get an image of the needed size to go on. Here is the code wich is responsibel for this:
Where "input" is a file variable wich contains the inputs image wich has the same size like the "null.fits" image.
The problem is now, that sometimes everything works well and I get the expected bigger image with the smaller one copied in, but sometimes (and sadly more frequently) I get a final image which contains also some strange "bars" (parts of columns of pixels with values different from zero ) . These "bars" change from time to time.......but as mentioned they are there in the most cases and of cause this is a problem for me :).
I have tried this on several machines and the problem is still the same.... so as always I would be very thankfull for some suggestions.
christian
ps: of cause it would also solve my problem if their is an easy way to "enlarge" a given image (where the new pixels all have zero values)
This time I'm encountering a problem with the imcopy task. What I am trying to do is to copy one small image in the lower left corner of a bigger image. The bigger Image is just a "dummy" with zero values on all pixels. I do this to get an image of the needed size to go on. Here is the code wich is responsibel for this:
imgets(input, "naxis1")
x_orig = real(imgets.value)
imgets(input, "naxis2")
y_orig = real(imgets.value)
null_orig = "null.fits[1:" // x_orig // ",1:" // y_orig // "]"
imcopy(small, null_orig, verbose=no)Where "input" is a file variable wich contains the inputs image wich has the same size like the "null.fits" image.
The problem is now, that sometimes everything works well and I get the expected bigger image with the smaller one copied in, but sometimes (and sadly more frequently) I get a final image which contains also some strange "bars" (parts of columns of pixels with values different from zero ) . These "bars" change from time to time.......but as mentioned they are there in the most cases and of cause this is a problem for me :).
I have tried this on several machines and the problem is still the same.... so as always I would be very thankfull for some suggestions.
christian
ps: of cause it would also solve my problem if their is an easy way to "enlarge" a given image (where the new pixels all have zero values)
Mike Fitzpatrick wrote on May 27, 2008
My first thought is that you need to apply the Jan14 critical update mentioned on the homepage. This fixes a bug affecting image sections that might explain what you are seeing.
Second, are the x_orig/y_orig variables real or integer? If they are real the image section you create might include the decimal place and so I'd also print out the section to be sure it is what you expect.
Have a look at the IMLINTRAN task. For example, to copy the dev$pix test image to the lower-left corner of a larger image you would do something like
Hope this helps.
Cheers,
-Mike
Second, are the x_orig/y_orig variables real or integer? If they are real the image section you create might include the decimal place and so I'd also print out the section to be sure it is what you expect.
ps: of cause it would also solve my problem if their is an easy way to "enlarge" a given image (where the new pixels all have zero values)
Have a look at the IMLINTRAN task. For example, to copy the dev$pix test image to the lower-left corner of a larger image you would do something like
cl> imlintran dev$pix foo.fits 0. 0. 1. 1. xin=1 yin=1 xout=1 yout=1 ncols=2048 nlines=2048Hope this helps.
Cheers,
-Mike
christian wrote on May 27, 2008
you had you finger at the right point......must have been very late when i wrote this code :) the x_orig and y_orig variables were integers......and i tried to give them some real values..... after i solved this mistake it seems to run well now.... but something is still strange.... I printed "null_orig" before and after the correction and it looked correct in both cases......
But hey I don't have to understand everything :)
Thanks for your help again ! Next time I will double check my variables before I post again !
christian
But hey I don't have to understand everything :)
Thanks for your help again ! Next time I will double check my variables before I post again !
christian
Last post on May 27, 2008