Author Topic: Fit files appears gray  (Read 4270 times)

Offline Cristofer

  • Newcomer
  • Posts: 4
Fit files appears gray
« on: 2015 October 21 12:27:08 »
Hi.

New to this forum.

I have a problem reading fits-files in Pixinsight. They are gray. I am using a Starlight-Xpress SXVR-H694 with the supplied software. I have read that there could be a problem with starlight Xpress cameras and fits-files in Pixinsight, but not sure about it. I am now using Deep sky stacker to stack and then opening the tiff in pixinsight. DSS can open the fits without any problem, but I want to use Pixinsight for stacking as well.

Any ideas?

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Fit files appears gray
« Reply #1 on: 2015 October 21 13:24:19 »
can you upload one fits to google drive or similar and post the link here?

if the fits file is in floating point format, that's probably got something to do with the problem. PI expects floating point fits files to have values within the range [0,1].

if your capture app is not producing 16-bit integer files, you might see if you can configure it to do so. 16-bit integer fits is pretty unambiguous in how it should be interpreted.

rob


Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Fit files appears gray
« Reply #3 on: 2015 October 22 07:41:30 »
Cristofer,

As Rob indicates, you may be running into FITs incompatibility issues.  Here is a post from a while ago where I explained a number of possible solutions (at least they helped me overcome the same issues):

 http://pixinsight.com/forum/index.php?topic=8021.msg52728#msg52728

Hope it helps,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline Cristofer

  • Newcomer
  • Posts: 4
Re: Fit files appears gray
« Reply #4 on: 2015 October 22 08:40:53 »
It doesn´t work. I have tried to check the "signed interger images", but then the image become black, and when stretching using STF some stars appears. When trying Image integration with the hints, following message appear: "Zero or insignificant signal detected: Empty image?"

The camera software saves the fits as 16 bit interger.

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Fit files appears gray
« Reply #5 on: 2015 October 22 09:10:34 »
Christofer,

What platform are you using (i.e., Windows, Mac, or Linux)?  Also what are you using as capture software?  I was having this issue in Windows using MaximDL.  In the end, I gave up on both. I had to make a choice between those two and PixInsight and boy was that an easy decision.  If it was the Olympics, Pixinsight would have won gold, silver and bronze  8).  Switching to the SkyX Camera-Add-on was an easy choice since I am already running SkyX with my Paramounts and I ended up converting my image processing CD to Linux.  And all well worth it to keep PI, that is how good this software is compared to the alternatives. 

I guess what I am saying is, don't give up on the software.  As Juan stated in the posts I attached in the post I sent you, this is not a PI issue and yet they are trying to find solutions nonetheless through the .xsif initiative, etc.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Fit files appears gray
« Reply #6 on: 2015 October 22 10:01:25 »
OK, what's wrong here could be a bug in CFITSIO (which PI uses to open FITS files), not sure.

the file opens OK in fv (nasa's fits viewer). it's an image of the california nebula.

this has something to do with the BSCALE and BZERO fits keywords being written out as floating point numbers. in my capture software, i see the following:

BZERO = 32768
BSCALE = 1

in this fits file i see:

BZERO = +3.2767000000E+04
BSCALE =  +1.0000000000E+00

so those two numbers are very similar, but are represented as floating point numbers.

i manually edited the fits file to change BZERO and BSCALE to look like my 16-bit raw images, and PI opened it fine.

as it stands, PI is interpreting your file as a 32 bit integer FITS which is probably why everything is screwed up. perhaps all of the data is crammed down into the lower 16 bits of the 32 bit words, so the max value is 65535/4294967295, which is a tiny number.

this is an example of why FITS is such a big problem.

so... paging Juan...

in the meantime if you can convince your capture program to write integer values for BZERO and BSCALE you can work around this.

rob


Offline Cristofer

  • Newcomer
  • Posts: 4
Re: Fit files appears gray
« Reply #7 on: 2015 October 22 10:29:01 »
Well, it is something with my capturing software. It is the default software that came with the camera. I have tried to open the fit in Nebulosity and saved it without doing anything at all. Pixinsight open it with no problem. It is the demo version of Nebulosity. It´s time to use a better capture software, and Nebulosity seems to work.

Offline jkmorse

  • PixInsight Padawan
  • ****
  • Posts: 931
  • Two questions, Mitch . .
    • Jim Morse Astronomy
Re: Fit files appears gray
« Reply #8 on: 2015 October 22 14:06:57 »
Rob,

Great find!  Hopefully this will lead to a long term solution but it the meantime its a nice way to retain sanity when these crop up.

Christofer,

I don't think you can go wrong starting with Nebulosity.  Its a great package at a very reasonable price and the documentation is interesting reading.

Best,

Jim
Really, are clear skies, low wind and no moon that much to ask for? 

New Mexico Skies Observatory
Apogee Aspen 16803
Planewave CDK17 - Paramount MEII
Planewave IFR90 - Astrodon LRGB & NB filters
SkyX - MaximDL - ACP

http://www.jimmorse-astronomy.com
http://www.astrobin.com/users/JimMorse

Offline RobC

  • Newcomer
  • Posts: 3
Re: Fit files appears gray
« Reply #9 on: 2015 October 25 21:06:11 »
All,

The problem is with the following in the fits header .

BZERO = +3.2767000000E+04

It should be

BZERO = +3.2768000000E+04

To allow the correct conversion of  signed 16 bit to unsigned 16 bit. The SX camera is creating 16 bit unsigned pixels. As the fits file format doesn't support unsigned 16 bit , the image data has to be converted to signed 16 bit when it is written to a fits file and then converted back to unsigned 16 bit when imported into the image software.  This is what the value of BZERO is used for. However it is out by a value of 1.   Most image software ignores this when importing image files but not PixInSight.

I wrote a small program to patch the fits file with the above change . It then read into PixInSight.

One would hope that Starlight Xpress would fix their capture software to write FITS complaint images.

As a work around I suggest you purchase Astro Photography Tools  ( APT ) and use the SX ASCOM Camera Driver to image with your SX camera.