Author Topic: Error reading FITS File  (Read 2571 times)

Offline epinheiro

  • Newcomer
  • Posts: 4
Error reading FITS File
« on: 2016 July 14 11:34:53 »
Hi,

First time this has happened... I downloaded one of Jim Misti's excellent image files (Misti Mountain Observatory - http://www.mistisoftware.com/astronomy/index_fits.htm) and got an error from PixInsight -

" Error reading elements 1 thru 4008 from image (ffgcld)."

I tried the download several times, the file downloads fine, but get the same error every time I ask PixInsight to open it The other files (R, G, B, Ha, open fine). I thought that perhaps the file was corrupt, but it opens without a problem in StarTools, which I used before purchasing PixInsight.

It is the Luminance file of NGC7635, http://www.mistisoftware.com/astronomy/fits/ngc7635_041008_15i75m_L.FIT

Any ideas why PixInsight does not like this file? Is there anything I can do to the file so that PixInsight will accept it?

Thanks,

Ed P.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Error reading FITS File
« Reply #1 on: 2016 July 14 14:28:44 »
it's probably a compressed fits file written out by maxim. PI uses CFITSIO to open fits files and i don't think CFITSIO supports these compressed fits files.

rob

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Error reading FITS File
« Reply #2 on: 2016 July 15 08:34:46 »
Quote
Any ideas why PixInsight does not like this file?

Because the file is truncated. This is the report generated by the official FITS File Verifier for this file:

Code: [Select]
File name:  ngc7635_041008_15i75m_L.FIT
                                           Run Number 19658
 
              fitsverify 4.18 (CFITSIO V3.380)             
              --------------------------------             
 

1 Header-Data Units in this file.
 
=================== HDU 1: Primary Array ===================
 
*** Error:   Keyword #17, FOCALLEN: lower-case exponent d or e is illegal in
             value +0.000000000000e+000.
*** Error:   Keyword #18, APTAREA: lower-case exponent d or e is illegal in
             value +0.000000000000e+000.
*** Error:   Keyword #19, APTDIA: lower-case exponent d or e is illegal in
             value +0.000000000000e+000.
*** Error:   Keyword #34, CCD-TEMP: lower-case exponent d or e is illegal in
             value -9.372906267622e+000.
*** Error:   Keyword #35, TEMPERAT: lower-case exponent d or e is illegal in
             value -9.372906267622e+000.
*** Error:   Keyword #37, EGAIN: lower-case exponent d or e is illegal in value
             +8.600000000000e-001.
*** Error:   Keyword #38, E-GAIN: lower-case exponent d or e is illegal in
             value +8.600000000000e-001.
*** Error:   Keyword #39, XPIXSZ: lower-case exponent d or e is illegal in
             value +9.000000000000e+000.
*** Error:   Keyword #40, YPIXSZ: lower-case exponent d or e is illegal in
             value +9.000000000000e+000.
*** Error:   Keyword #47, EXPTIME: lower-case exponent d or e is illegal in
             value +3.000000000000e+002.
*** Error:   Keyword #48, EXPOSURE: lower-case exponent d or e is illegal in
             value +3.000000000000e+002.
*** Error:   checking data fill: tried to move past end of file

"tried to move past end of file" means that the file lacks some data at the end of the image. The other errors are tolerated by CFITSIO, but file truncation is obviously not. Other applications will allow you to load incomplete data without even telling you, but that is not the philosophy of PixInsight.

You can fix this problem easily with the following script:

Code: [Select]
let f = new File;
f.openForReadWrite( "/Users/juan/Documents/ngc7635_041008_15i75m_L.FIT" );
f.seekEnd();
f.write( new ByteArray( 4008*2, 0 ) );
f.close();

where you have to replace "/Users/juan/Documents/" with the actual path to the folder where you have stored the file on your machine (remember that on Windows you'll have to prepend a drive specification, "C:" for example). This little script will add a row of zero pixels at the bottom of the image. 4008 is the image width in pixels, and 2 is the number of bytes in a 16-bit, single-channel pixel.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline epinheiro

  • Newcomer
  • Posts: 4
Re: Error reading FITS File
« Reply #3 on: 2016 July 18 14:26:46 »
Juan,

You are THE MAN!!!!

Entered your script, image now loads perfectly, WOW  :) :) :)

THANK YOU, MUCHAS GRACIAS.

Also, last week I wanted to process an LRGB image that also had an H-alpha component, and wondered, how do I do that? Sure enough, there is a script in PixInsight for it. This software is AWESOME.

Ed P

Offline cmarcus

  • Member
  • *
  • Posts: 56
Re: Error reading FITS File
« Reply #4 on: 2020 January 03 13:06:51 »
Stumbled on this thread when faced with a similar problem. My issued appeared to be that the folder containing the files was named in Cyrillic... Just thought I'd mention it...