Subject: Re: FITSVIEW Header Problem

From: fitz at argus.lpl.arizona.edu (Mike Fitzgibbon)
Date: 28 Jul 1995 17:26:25 GMT

In article <3v9s7a$p3f at crl9.crl.com>, atherton at crl.com says...
...
>
>     "FITShead::valid_check:Invalid FITS (no SIMPLE = T)"
>
... but ...
>
>SIMPLE  = T
>BITPIX  = 16
>NAXIS   = 3
>NAXIS1  = 384
>NAXIS2  = 576
>NAXIS3  = 1
>BZERO   = 0.000000E+000         
>BSCALE  = 1.000000E+000
>ORIGIN  = UC Santa Barbara Remote Access Telescope
>TELESCOP= Celestron C-14 w/ Photometrics 576x384 CCD
>DATE-OBS= 20/02/95
>TIME-OBS= 20:38
>RA      =  .9616
>DEC     =  81.61
>Comment = Exposure :=  5sec
>COMMENT = Filter Wheel #1: EMPTY
>COMMENT = Filter Wheel #2: EMPTY
>END
...

Well the problem seems to be that "buggy" software is generating these FITS 
files.  According to the format definition, (see Astron. Astrophys. Suppl. 
Ser. 44, (1981) pp363-370, "FITS: A Flexible Image Transport System" by D.C. 
Wells, E.W. Greisen, and R.H. Harten), a logical variable (e.g. SIMPLE) has a 
value of T or F in column 30.  This header put the logical value in column 11.
Also of note is that integer and real values should be right justified in 
columns 11-30 and character variables should have a single quote in column 11 
with the ending quote no earlier that column 20.

---

From: atherton at crl.com (Dave Atherton)
Date: 29 Jul 1995 20:18:29 -0700

Mike Fitzgibbon (fitz at argus.lpl.arizona.edu) wrote:
: Well the problem seems to be that "buggy" software is generating these FITS 
: files.  According to the format definition, (see Astron. Astrophys. Suppl. 
: Ser. 44, (1981) pp363-370, "FITS: A Flexible Image Transport System" by D.C. 
: Wells, E.W. Greisen, and R.H. Harten), a logical variable (e.g. SIMPLE) has a 
: value of T or F in column 30.  This header put the logical value in column 11.
: Also of note is that integer and real values should be right justified in 
: columns 11-30 and character variables should have a single quote in column 11 
: with the ending quote no earlier that column 20.

Thanks for all the help from those who responded on Usenet and via email. 
I've succeeded in using DOS DEBUG to touch-up 2 files well enough to get
FITSView to read them.  Now, with this experience and the NOST FITS manual
in hand, I am prepared to touch-up a few more and chat intelligently with
the originator of the problematic files. 

In case anyone is interested, FITSView 0.4.0 required the "T" to be in 
column 30 but was unconcerned about the character strings not being in 
quotes.

-Dave
  ---------------------------------------------------------------------
 | Dave Atherton - Work: cara25 at email.mot.com - Home: atherton at crl.com |
 | Christian Radio Pipeline Page:  http://www.crl.com/~atherton/       |
 | "There's a fine line between participation and mockery." - S. Adams |
  ---------------------------------------------------------------------

---

From: svoynick at netcom.com (Stan Voynick)
Date: Sat, 29 Jul 1995 00:57:59 GMT

In article <3v9s7a$p3f at crl9.crl.com>, Dave Atherton <atherton at crl.com> wrote:
>I have used FITSVIEW 0.4.0 to view image files from several different
>sources but am having difficulty with the files from a particular
>automated telescope.
>
>     ..............
>
>When I inspected the header, I found the "SIMPLE = T" and found that the
>header contained 80-column records with no newlines...just like one
>would expect.  There's evidently something else about that header that
>it doesn't like.
>
>     ..................
>
>A file that I tested was JATILA01.ZIP.  Unzipping produced 2 *.FTS files
>which I renamed to *.FIT.  Below is a listing of the header and first
>line of image data from JATILA01.FIT (with a newline inserted after
>every 80 chars for readability).  Can somebody suggest what part of this
>header might be bothering FITSVIEW?
>
>SIMPLE  = T

If this is reproduced accurately, then the "T" is not in the correct 
column.  From the FITS standard:

==================== Start Quote ======================

5.3.2.2  Logical Variable

If the value is a logical constant, it shall appear as a T or F 
in column 30.

==================== End Quote ========================

Maybe try to manually go in and fix up a file and see if it works...

                             - Stan Voynick -

---

From: bcotton at gorilla.cv.nrao.edu (Bill Cotton)
Date: Tue, 1 Aug 95 08:58:32 EDT

>Maybe try to manually go in and fix up a file and see if it works...

   FITSview takes a rather strict interpretation of the FITS rules for
the SIMPLE= T keyword as it has to use this to distinguish FITS files
from others; thus the "T" must be in column 30.  The interpretation of
other keywords is somewhat more relaxed even though the FITS rules are
that the "required" keywords shall be in a fixed format.  FITSview
ignores keywords that it doesn't need to interprete the image.
Editing the file to put the "T" in the correct column should fix the
problem. 

Bill Cotton

---

From: olberg at nain.oso.chalmers.se (Michael Olberg)
Date: 31 Jul 1995 06:51:03 GMT

Dave Atherton (atherton at crl.com) wrote:
: Thanks for all the help from those who responded on Usenet and via email. 
: I've succeeded in using DOS DEBUG to touch-up 2 files well enough to get
: FITSView to read them.  Now, with this experience and the NOST FITS manual

Just as a hint: I have at times used emacs (or any of its clones) to edit
FITS files, it is one of the few editors who happily work on binary files
as well. Might be less awkward to use for some of you than DEBUG.

-- 
---------------------------------------------------------------------------
Michael Olberg                      | e-mail: olberg at oso.chalmers.se
Onsala Space Observatory            | tel:    +46-31-7725507
S-43992 Onsala, SWEDEN              | fax:    +46-31-7725590
-------------------- This quote left blank intentionally ------------------