Thread: Valid Fits File
View Single Post
  #2  
Old May 16th 06, 08:41 PM posted to sci.astro.ccd-imaging
external usenet poster
 
Posts: n/a
Default Valid Fits File

On 16 May 2006 10:12:43 -0700, "Kiran" wrote:

I am completely new to these FITS files.Its quite confusing.Can any
one please help me.

I am looking for the code which creates a valid FITS file.The FITS
file should contain a valid header with header test data. The FITS file
should contain one valid image with a test pattern. This image should
be 128 pixels wide by 64 pixels high. Each pixel should be eight bits.
Pixel values in the first row should begin with 0 and increment by 1.
Pixel values in the second row should begin with 1 and increment by 1.
Pixel values in the third row should begin with 2 and increment by 1.


If you want to write your own program, you can download the CFITSIO
library from http://fits.gsfc.nasa.gov/fits_libraries.html and compile
it into your app. This is the reference code for reading and writing
FITS files.

It would be fairly easy to generate a test pattern like you want using
Photoshop, or another graphics program with similar capabilities. Save
the image as a TIFF, and then open it in an astronomical image
processing program (Iris, for instance, is freeware). Fill in the header
keywords you want, and then save as FITS. You could also use a
scriptable image processor like Maxim to produce the test pattern
easily.

BTW, FITS files containing 8-bit data are quite unusual. Some
applications may not even be able to read them. Unless you have a very
specific reason for using 8-bit data, it is probably better to save it
as 16-bit, even if the actual range is only 8-bits.

_________________________________________________

Chris L Peterson
Cloudbait Observatory
http://www.cloudbait.com