Author Topic: FITS color images data cube?  (Read 4335 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
FITS color images data cube?
« on: 2010 May 22 15:46:46 »
Hi,

I loaded FITS color images (RGB, int8) into the Aladin application. Aladin considers these to be a "data-cube" and displays it as a time sequence, automatically sequencing through the 3 channels. It is possible to create RGB images in Aladin, and this is what I did with separate R,G,B images created from PI. I then saved the result as a FITS. Both PI and Aladin reload the created file as a true color image. As far as I could see the only significant difference in the FITS header was that PI sets "extend=T", whereas this keyworld is missing in the version created by Aladin.

I dont know if this is an area where FITS is not well defined. But I would certainly prefer to be able to use PI FITS color images in Aladin without tricks. Would it be possible to remove the "extend=3" keyword by default?

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: FITS color images data cube?
« Reply #1 on: 2010 May 23 14:45:32 »
Hi Georg,

This is from the FITS standard version 3.0 (2008):

EXTEND Keyword  The value field shall contain a logical  value indicating whether the
FITS file is allowed to contain conforming extensions following the primary HDU. This
keyword may only appear in the primary header and must not appear in an extension
header. If the value field is T then there may be conforming extensions in the FITS file
following the primary HDU. This keyword is only advisory, so its presence with a value
T does not require that the FITS file contains extensions, nor does the absence of this
keyword necessarily imply that the file does not contain extensions. Earlier versions of
this standard stated that the EXTEND keyword must be present in the primary header if
the file contained extensions, but this is no longer required.


http://fits.gsfc.nasa.gov/standard30/htmlfiles/fits_standard30index.html

As you see, the above paragraph basically states that the EXTEND keyword is completely useless. The EXTEND keyword is automatically written by the CFITSIO library, and as far as I know there is no way to avoid it without hacking CFITSIO.

So if an application modifies its behavior as a function of the existence of the EXTEND keyword in the primary HDU of a FITS file, then the bug is in that application. No bug in PixInsight here.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: FITS color images data cube?
« Reply #2 on: 2010 May 23 14:54:57 »
Juan,

I see. I dont know if the "EXTEND" is the decisive element to distinguish between RGB and time series. Would you like to have a look at those two files? I can upload them to a location that you send to me via private message.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: FITS color images data cube?
« Reply #3 on: 2010 May 23 15:10:06 »
Georg,

Check your email. Something that might be fooling other applications is the ICC profile extension that PixInsight can generate in a FITS file. Try disabling ICC profile when saving a color FITS file.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: FITS color images data cube?
« Reply #4 on: 2010 May 24 08:49:08 »
Juan,

Check your email. Something that might be fooling other applications is the ICC profile extension that PixInsight can generate in a FITS file. Try disabling ICC profile when saving a color FITS file.

I just uploaded the files. The one with *RGB* is the one generated by Aladin (combining separate R,G,B fits files from PI), that is also interpreted as RGB when read by Aladin. The other files is the ones generated by PI with floats+icc and i8 without icc. Both are interpreted as a 3 step time series by Aladin. I could not test if the EXTEND flag is significant, because I cannot remove it in PI.

Georg
« Last Edit: 2010 May 25 01:11:00 by georg.viehoever »
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)