![]() |
#1
|
|||
|
|||
![]()
Hi Friends,
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. Etc. Hope someone helps me out. Thank you very much, Regards Kiran |
#2
|
|||
|
|||
![]()
Kiran wrote:
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. Etc. Are you looking for existing code which will create such a file, or do you want to write your own code using existing code as a guide? If the latter, what language? The byte-by-byte format of a FITS file isn't all that difficult to understand. The length of the entire file is a multiple of 2880 bytes. The simplest valid files will have a header, also a multiple of 2880 bytes, immediately followed by data, filled with nulls (00 hex or '\0') at the end to make the data section also a multiple of 2880 bytes. The header contains a multiple of 36 text lines, each line exactly 80 bytes (yes, 36 x 80 = 2880). Each line contains either KEYWORD = VALUE or COMMENT whatever you want or just blanks. The equals sign must be in column 9. There may also be a slash and a comment after the value. The first keyword has to be SIMPLE = T After that will come keywords to define the data geometry: 2 dimensions, 128 wide, 64 high, 8 bits per pixel. NAXIS = 2 NAXIS1 = 128 NAXIS2 = 64 BITPIX = 8 See http://fits.gsfc.nasa.gov/ for more. After that, END followed by blank lines to pad it out to 2880 bytes, then the data. You'll have to make the data array yourself. -- Bill Owen |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Valid Fits File | Kiran | CCD Imaging | 2 | May 17th 06 02:47 AM |
Free Commodities Are Abused | Len | Policy | 46 | December 5th 05 06:21 AM |
NASA PDF documents available online for free download | Rusty | History | 18 | October 23rd 05 03:52 PM |
FITS long integer support (was [fitsbits] ADASS FITS BoFon Sunday) | William Pence | FITS | 6 | October 22nd 04 09:23 PM |