[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: FITS header values




Tom,

You gave some reason for writing the header lines in the
order you do. There are a few ways around that.

If using cfitsio you can change the value of a header line
after it is written.  Suppose you write out lines
 xxx=1
 yyy=2
 zzz=3
Later you can write out
 xxx=4
and you do NOT get two xxx lines.  What you get is
 xxx=4
 yyy=2
 zzz=3

You can use this to control the order in which the lines
appear in the file.  In the above example you wanted xxx
to be first but your program did not have a correct value
for it until later.  cfitsio does not actually write to
disk unless it needs to, then it writes blocks at a time, not
lines at a time.  So re-writing lines likely will not cause
extra disk activity.

In the Mark III real-time driver because it did drift scan,
I did not know the value of NAXIS2 until the last scan line
was written to disk so I "re-wrote" the line just before closing
the file.  Even so NAXIS still appears near the top of the file.

There is another feature of cfitsio that can save a programmer
some time:  When you create a new FITS file you can specify a
"model file" that is read up and used to build default header lines
that can be "re-written" if need be.  Now you don't need to waste
code for writing "boiler plate".  You can also make chanes to this
boiler plate without changing your code.



> -----Original Message-----
> From: Tom Droege [mailto:tdroege@veriomail.com]
> Sent: Tuesday, April 10, 2001 2:18 PM
> To: Stupendous Man; tass@listserv.wwa.com
> Subject: Re: FITS header values
> 
> 
> The Plan
> 
> I have a terrible bias toward those that give me specific 
> instructions as 
> to what to do.  When done in public, there seems little 
> chance that I will 
> be led astray in my trust.  This forum has a nice effect on 
> those that say 
> "fooey" or do not think things out.  They seem to get quickly stomped 
> on.  Michael has done his penance and has presented what 
> appears to be a 
> nice plan to me.  Jure and Michael have told me what to do.  It is my 
> intent to just copy the items given by them.  I also agree 
> with Arne's 
> request to bunch like things together.  I will shortly put up the new 
> version of the header.
> 
> Tom Droege
> 
> 
> At 01:13 PM 4/10/01 -0400, you wrote:
> 
> >   Arne pointed out that we really should adhere to the new
> >FITS header conventions, rather than say "fooey."  I can't
> >justify any other course of action, in all seriousness.
> >Okay, what does that mean?
> >
> >   The new FITS WCS conventions are described in a set of 3
> >papers by Calabretta and Griesen.  The one most relevant to
> >our purposes is (yet to be?) published in Astronomy and Astrophysics.
> >One can find a preprint at
> 
>