Submit a Story  :  IRAF Links  :  Past Polls  :  Calendar  :  Advanced Search  
     iraf.net
FAQ
 Forum FAQForum FAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible pixel bounds checking bug in imcopy

 
Post new topic   Reply to topic    iraf.net Forum Index -> General IRAF
View previous topic :: View next topic  
Author Message
Jason Quinn
IRAF Guru


Joined: 07 Apr 2006
Posts: 151

PostPosted: Thu Sep 13, 2012 2:10 am    Post subject: Possible pixel bounds checking bug in imcopy Reply with quote

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:

Code:
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.

Code:

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.

Code:

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
Back to top
View user's profile Send private message
fitz
Site Admin


Joined: 30 Sep 2005
Posts: 3255
Location: Tucson

PostPosted: Wed Sep 26, 2012 4:59 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    iraf.net Forum Index -> General IRAF All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2009 phpBB Group
 Copyright © 2005-2011 iraf.net
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.14 seconds