Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible pixel bounds checking bug in imcopy #48

Open
olebole opened this issue Jul 11, 2018 · 0 comments
Open

Possible pixel bounds checking bug in imcopy #48

olebole opened this issue Jul 11, 2018 · 0 comments
Labels
Dist:NOAO Releases distributed by NOAO (up to 2.16.1)

Comments

@olebole
Copy link
Member

olebole commented Jul 11, 2018

This is taken from iraf.net#1467524 from 2012-13-09 by Jason Quinn:

When I use imcopy on a .imh image such as dev$pix, it reports an error if I try to copy a section that exceeds the boundary of the image:

vocl> imhead dev$pix
dev$pix[512,512][short]: m51 B 600s
vocl>
vocl> imcopy dev$pix[*,1:512] test1.fits
dev$pix[*,1:512] -> test1.fits
vocl>
vocl> imcopy dev$pix[*,1:513] test2.fits
dev$pix[*,1:513] -> test2.fits
ERROR: Pixel storage file is truncated (dev$pix[*,1:513])

If however I use a FITS image, I do not get a warning for several pixels past the boundary of the image.

vocl> imcopy dev$pix jjj.fits
dev$pix -> jjj.fits
vocl>
vocl> imhead jjj.fits
jjj.fits[512,512][short]: m51 B 600s
vocl>
vocl> imcopy jjj.fits[*,1:512] test3.fits
jjj.fits[*,1:512] -> test3.fits
vocl>
vocl> imcopy jjj.fits[*,1:513] test4.fits
jjj.fits[*,1:513] -> test4.fits
vocl>
vocl> imcopy jjj.fits[*,1:514] test5.fits
jjj.fits[*,1:514] -> test5.fits
vocl>
vocl> imcopy jjj.fits[*,1:515] test6.fits
jjj.fits[*,1:515] -> test6.fits
ERROR: Pixel storage file is truncated (jjj.fits[*,1:515])

Are the [*,1:513] and [*,1:514] commands exposing some sort of error checking bug? The file is only 512x512.If I run fitsverify on the test image, test2.fits and test6.fits give fatal errors while test3.fits and test4.fits are valid FITS files but they have been extended by 1 and 2 pixels, respectively, in the y-direction.Also, when I try an imhead on the files I also get two different results depending on whether I use *.fits vs test*.fits as the argument to imhead. This seems to violate the principle of least surprise.

vocl> imhead *.fits
jjj.fits[512,512][short]: m51 B 600s
test1.fits[512,512][short]: m51 B 600s
test2.fits: FXF: EOF encountered while reading FITS file (test2.fits)
test3.fits[512,512][short]: m51 B 600s
test4.fits[512,513][short]: m51 B 600s
test5.fits[512,514][short]: m51 B 600s
test6.fits: FXF: EOF encountered while reading FITS file (test6.fits)
vocl> imhead test*.fits
test1.fits[512,512][short]: m51 B 600s
ERROR: Seek error on file (skyfire!/home/jquinn/projects/test2.fits)

Cheers,
Jason

@iraf answered:

Hi Jason,Just wanted to acknowledge that I can reproduce the problem but haven't had time to look at it in detail yet. It'll be fixed for the next update, thanks for the report.-Mike

However, in 2.16.1 (released 2013), the problem still remains.

@olebole olebole changed the title [2.16.1] Possible pixel bounds checking bug in imcopy Possible pixel bounds checking bug in imcopy Oct 16, 2018
@olebole olebole added the Dist:NOAO Releases distributed by NOAO (up to 2.16.1) label Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dist:NOAO Releases distributed by NOAO (up to 2.16.1)
Development

No branches or pull requests

1 participant