[fitsbits] Fits recognition

Rob Seaman seaman at noao.edu
Thu Aug 16 12:06:40 EDT 2007


On Aug 16, 2007, at 8:30 AM, Steve Allen wrote:

> On Thu 2007-08-16T17:22:29 +0200, eggpap hath writ:
>> how to know programmatically if a fit/fits extension file is a  
>> true fit
>> file?
>
> The quickest test is the one Jeff Uphoff wrote for the /etc/magic
> or /usr/share/magic file which is used by the unix "file" program.

I might add that several million NOAO "save the bits" files have been  
classified very handily using this magic number scheme ("SIMPLE" is  
just hex 53 49 4d 50 4c 45).  Identifying non-FITS is even more  
important since we then run a converter.  We look for that silly  
little "T", too:

	0       string  SIMPLE  =                    T  THIS_IS_FITS

This is certainly more reliable than just relying on a file  
extension, especially when paired with a variety of reality checks  
downstream during handling that amount to a validation against  
minimal FITS compliance.  A lot of instruments would have a hard time  
meeting a formal FITS compliance requirement.

- Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listmgr.nrao.edu/pipermail/fitsbits/attachments/20070816/bb695fa1/attachment.html>


More information about the fitsbits mailing list