Page 1 of 1

Fits file does not seem to be read correctly

Posted: 2016-12-10T04:46:21-07:00
by universalmaster
Hi!

If I convert a fits file which is underexposed, I get strange values for the mean in the red channel:

$ convert test.fits -format "%[mean]\n" info:
35317.5
2984.76
4756.72

The image should have the highest mean in the blue channel. Pixinsight report the following "8-bit" means
mean 9.6 11.9 18.9
Iris (http://www.astrosurf.com/buil/iris/) report the same values as Pixinsight, so it is two agains one :lol:

The ratios between the blue and green channels agree with the ratio from pixinsight and iris, but the red is way off. If I do the same for another fits image (which is overexposed), the values match pretty well.

Here is the image https://drive.google.com/file/d/0B182-t ... sp=sharing

Here is my version:
pi@observatory:~ $ convert --version
Version: ImageMagick 6.8.9-9 Q16 arm 2016-11-27 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

Best Regards,
U

Re: Fits file does not seem to be read correctly

Posted: 2016-12-10T05:38:15-07:00
by dlemstra
It looks like your fits image contains multiple images. 3 to be exact and you are getting the mean for the 3 images that are grayscale. You can see the different images when you convert the image to a png: convert test.fits test.png

Re: Fits file does not seem to be read correctly

Posted: 2016-12-10T05:59:12-07:00
by universalmaster
Yes, exactly. But the red image (1st gray scale image in the file) and mean of the red image comes out all wrong with imagemagick but not with other programs. The mean of the 1st image should be about half of the mean of the 3rd image (the blue channel) in the file.

Re: Fits file does not seem to be read correctly

Posted: 2016-12-10T06:22:35-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: Fits file does not seem to be read correctly

Posted: 2016-12-10T08:41:20-07:00
by universalmaster
Excellent, that was fast!

Thanks for the great software :-)