View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

imcombine segmentation fault

cenko wrote on Mar 28, 2011

Hi,

I'm trying to perform a weighted combination of masked images using the imcombine task, but receive a segmentation violation error message. The command I'm running is as follows:

--> imcombine s?????.fits combine.fits combine="median" reject="avsigclip" masktype="goodvalue" maskvalue=0 scale="exposure" zero="none" weight="exposure" expname="EXPTIME" rdnoise=100.0 gain=6.0

The error message I receive is:

Mar 28 1:35: IMCOMBINE
combine = median, scale = exposure, zero = none, weight = exposure
reject = avsigclip, mclip = yes, nkeep = 1
lsigma = 3., hsigma = 3.
grow = 1.
blank = 0.
masktype = goodval, maskval = 0
Images Exp Scale Weight Maskfile
s00353.fits 60.0 1.000 0.143
s00354.fits 60.0 1.000 0.143 s00354.pl
s00355.fits 60.0 1.000 0.143 s00355.pl
s00356.fits 60.0 1.000 0.143 s00356.pl
s00357.fits 60.0 1.000 0.143 s00357.pl
s00358.fits 60.0 1.000 0.143 s00358.pl
s00359.fits 60.0 1.000 0.143 s00359.pl
s00360.fits 0.0 60000.0 0.000
s00361.fits 0.0 60000.0 0.000

Output image = GRB060807.blind.J.fits, ncombine = 9
Killing IRAF task `imcombine'
Traceback (innermost last):
File "<console>", line 1, in <module>
File "/Users/cenko/python/irredux/nirc_coadd.py", line 44, in nirc_coadd
rdnoise=100.0, gain=6.0)
IrafError: Error running IRAF task imcombine
IRAF task terminated abnormally
ERROR (501, "segmentation violation")

It seems that IRAF is unable to properly read the headers of several of the images (the BPM keyword from s00353.fits and EXPTIME from s00360.fits and s00361.fits). But as best as I can tell, the headers are FITS compliant (pyfits.verify gives no errors), and simply reading the keywords with hselect returns properly:

--> hselect s00353.fits BPM yes
s00353.pl

I get similar results on two different machines (one linux, one mac intel), though absent the segfault on the linux machine, so it doesn't seem to be system dependent.

I've put the images (and associated pixel maps) at:

http://astro.berkeley.edu/~cenko/private/iraf/

Any help would be greatly appreciated.

Mike Fitzpatrick wrote on Mar 28, 2011

I was able to reproduce the problem on a v2.15 32-bit linux system and tracked it down to a likely cause. The key thing missing was that the 'grow' parameter had to be set to non-zero in order to trigger the error.

Frank is looking into a solution now and we should have a patched binary soon. Until then, if you don't need to set the 'grow' parameter then it appears to work fine.

Francisco Valdes wrote on Mar 28, 2011

The bug has been identified and fixed for a future patch or release. Mike will let you know if/when a patch or update is released.

Frank Valdes


NUMBER: 580
MODULE: imcombine and variants
SYSTEM: -V2.15.1
DATE: Fri Apr 1 10:53:41 MST 2011
FROM: valdes

BUG: When the grow options is used with masks or partially overlapping
data a segmentation could occur. This is because when data is
absent (because of non-overlap) or excluded (because of mask) an
identifier value was not initialized. The only workaround is to
not use the grow options.

STATUS: Fixed for future patches and releases.

cenko wrote on Mar 28, 2011

Many thanks for the prompt reply(s). I'll be sure to upgrade when the new patch is available.

Last post on Mar 28, 2011