View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

problem with sections

Tom Duvall wrote on May 02, 2011

In linux 64-bit v2.15, I have an image:
imhe npts.fits
npts.fits[10,4,100,100][int]:

imstat npts
# IMAGE NPIX MEAN STDDEV MIN MAX
npts 400000 21.54 13.16 0. 43.
But if I try a section:
imstat npts[2,*,*,*]
# IMAGE NPIX MEAN STDDEV MIN MAX
npts[2,*,*,*] 40000 2.588E10 4.510E10 0. 1.246E11
I get that strange answer. If I go back to linux v2.14:
imstat npts[2,*,*,*]
# IMAGE NPIX MEAN STDDEV MIN MAX
npts[2,*,*,*] 40000 12.03 12.18 0. 29.
I get what is probably correct.

This image is available at http://soi.stanford.edu/~duvall/Iraf/npts.fits

Mike Fitzpatrick wrote on May 02, 2011

Hi Tom,

This works fine for me on both 64-bit Linux and OSX. Be sure you are running the latest version of the system for your platform and reinstall the latest patch if necessary (there were a few days after the last release where the patch was missing a change and was quickly updated without any fanfare). If you still have problems after this let me know.

-Mike

Tom Duvall wrote on May 02, 2011

I have tried reloading the main system and also bringing over the patch and installing it. I also deleted the executables, .a files, .o files and recompiling. But I still have this problem with the sections.
Tom

Mike Fitzpatrick wrote on May 02, 2011

Tom,

You're right, I've verified that with the distributed binaries there is still a problem. The good news though is that it's apparently already been fixed in the dev system, see http://iraf.net/phpBB2/viewtopic.php?t=90680

That message referred to columnar access to data but affect higher dimensioned data as well. You can use the same trick of using the 32-bit binaries or if you want to make the code change it is trivial: In sys$imio/imggsc.x the code diff is



37,38c37
< 	#sz_pixel = pix_size[IM_PIXTYPE(im)]
< 	sz_pixel = sizeof(IM_PIXTYPE(im))
---
> 	sz_pixel = pix_size[IM_PIXTYPE(im)]


I.e. you want to use the sizeof() function. To recompile the change:


% setenv iraf /iraf/iraf/                       # define environment
% setenv IRAFARCH <arch>
% source $iraf/unix/hlib/irafuser.csh
% cd /iraf/iraf                                   # go to iraf root
% make <arch>                                # set architecture
% mkpkg ; mkpkg update                   # relink core system
% make update                                 # rebuild everything else


These are actually more steps than I'd intended, but I'm heading off a likely followup question you'd have if you did just a "make update". Anyway, let me know if you have any problems.

Cheers,
-Mike

Tom Duvall wrote on May 02, 2011

I did eventually get around to changing the code and recompiling the system. As you knew, this fixed the problem. Thanks for your help.
Tom

Last post on May 02, 2011