promoting data type when output fitsfile is created
rclark wrote on Nov 03, 2009
I'm having a problem with the convolve task in the images.imfilter
package.
ERROR (502, "floating point invalid operation")
I have placed 4 files in the ftp area to show the problem.
rgx1.fits an image that will pass through ok
rgx2.fits an image that will cause the error
convolve.dpar a convolv par file which contains the kernal
cnvdemo.sh shell script to call convolve
In the shell script edit the $BINPATH and $IBINPATH to point to your
work directory and iraf installation.
I believe the problem is that the sharpening kernal is amplifying noise
enough to kick it up out of the range that can be represented as short
integer when the results are saved in the output fitsfile. (the image
data is only 14 bit, bandwidth limitations, yadayadayada. the images
come in as short int.) I'm free to do something about it on this end,
but how?
Is there a way to have the image array in the output fitsfile promoted to
a higher data type (float, long, or scaled short, clipping out of range
values, anything?) at the time of file creation? Avoiding additional
intermediate files (wfits or change_pixtype) is desireable due to time
constraints for getting the image processed and on its way.
Richard
package.
ERROR (502, "floating point invalid operation")
I have placed 4 files in the ftp area to show the problem.
rgx1.fits an image that will pass through ok
rgx2.fits an image that will cause the error
convolve.dpar a convolv par file which contains the kernal
cnvdemo.sh shell script to call convolve
In the shell script edit the $BINPATH and $IBINPATH to point to your
work directory and iraf installation.
I believe the problem is that the sharpening kernal is amplifying noise
enough to kick it up out of the range that can be represented as short
integer when the results are saved in the output fitsfile. (the image
data is only 14 bit, bandwidth limitations, yadayadayada. the images
come in as short int.) I'm free to do something about it on this end,
but how?
Is there a way to have the image array in the output fitsfile promoted to
a higher data type (float, long, or scaled short, clipping out of range
values, anything?) at the time of file creation? Avoiding additional
intermediate files (wfits or change_pixtype) is desireable due to time
constraints for getting the image processed and on its way.
Richard
Mike Fitzpatrick wrote on Nov 03, 2009
I think you're right about there being an overflow, but I think what you want is for the input image to be promoted before the calculation, rather than the output image once the overflow has happened. In either case, there's no way to do this currently with the CONVOLVE task other than to use e.g. CHPIXTYPE to change the image type before using it. The images appear to have had some bit of processing already, perhaps the type can be changed upstream in the pipeline?
-Mike
-Mike
Last post on Nov 03, 2009