[fitsbits] convert to fits
William Pence
pence at tetra.gsfc.nasa.gov
Thu Jun 28 11:43:27 EDT 2001
"Motallebi, Habib" wrote:
>
> Hi,
> Is there online utilities to convet some image files to fits format?.
> We have .flf (custom format) that is in unshort (pixles). I like to conver
> them to .fits format file.
> habib
This is easy to do with the 'fitscopy' program that is distributed with the
CFITSIO library. The syntax of the command is:
fitscopy input_file_name output_file_name
In the case where the input is a raw binary file with unsigned short pixels
(and with dimensions of 384 x 256 pixels in this example) then the syntax
would be:
fitscopy rawfile.flf[u384,256] outfile.fits
If the raw binary file contains header information that needs to be skipped
before the start of the image data, then you can supply a byte offset, as in
this example which skips the first 512 bytes in the file:
fitscopy rawfile.dat[u384,256:512] outfile.fits
CFITSIO is freely available from http://heasarc.gsfc.nasa.gov/fitsio/
It runs under unix, Windows and Mac-OS. On Unix you can build fitscopy with
these 2 commands after unpacking the CFITSIO tar file:
./configure
make fitscopy
The fitscopy program makes use of the extended filename syntax supported by
CFITSIO (described at
http://heasarc.gsfc.nasa.gov/docs/software/fitsio/filters.html). It can be
used to perform many other filtering operations on the input file, such as
extracting a subimage out of a larger image, selecting certain rows out of a
FITS table, or calculating the values for new columns in a table.
regards,
Bill Pence
--
____________________________________________________________________
Dr. William Pence pence at tetra.gsfc.nasa.gov
NASA/GSFC Code 662 HEASARC +1-301-286-4599 (voice)
Greenbelt MD 20771 +1-301-286-1684 (fax)
More information about the fitsbits
mailing list