"READ ME" File for ToFITS.EXE V1.7 ---------------------------------- Written by: David J. Lane Observatory Technician/Systems Administrator Department of Astronomy and Physics Saint Mary's University Halifax, Nova Scotia Canada B3H 3C3 Phone: 902-420-5633 E-Mail: dlane@ap.stmarys.ca Archive: The most recent version of "ToFITS" is at http://apwww.stmarys.ca/dlane/tofits/tofits.zip File Updated: December 2000 Requirements: "ToFITS" is a DOS protected mode program (DPMI) and requires a driver such as HIMEM.SYS to be loaded in order to access extended memory used for image buffer storage. A minimum of 2 megabytes of total memory is required. The two files "rtm.exe" and "dmpi16bi.ovl", distributed with "ToFITS", must be in the DOS execution PATH or in the same directory as "ToFITS". Status: ToFITS is copyrighted "freeware" and is freely distributable so long as it is not modified and contains credit to the author and Saint Mary's University. Note: Also available is "ToFITS", an SBIG to FITS convertor program. INTRODUCTION ------------ ToFITS.EXE is an MS-DOS-based "protected mode" program which "batch" converts Santa Barbara Instrument Group (SBIG) Type 3 CCD image files into "Flexible Image Transport System" (FITS) format files. Files can originate from the ST-4X, ST-5, ST-6, ST-7, or ST-8 CCD cameras (and perhaps others that use the Type 3 format). All the necessary header information is retained and formatted according to the FITS standard and popular conventions. COMMAND LINE ------------ TOFITS [-F] input_file_wildcard [output_directory] The "-F" option vertically flips the image. This option is provided because there is no standard way which FITS viewers display images. The default is to have the the first row in the SBIG file to be the last row in the FITS file and vice-versa. This works with most viewers such as SAOIMAGE on unix systems. The "input_file_wildcard" should match the file(s) which are to be converted. The file extension must be specified -- no extension is assumed. A drive and/or directory can also be included. Examples include: *.st6 - all ".st6" files in the current directory c:\ccd\images\sao1*.st6 - all "sao1*.st6" files in the directory "c:\ccd\images" bias???.st6 - all "bias???" (eg. bias001) files in the current directory c:\ccd\data0918\flatr* - all "flatr*" files in directory "c:\ccd\data0918" The "output_directory" is optional. If none is specified, the output files are written to the current directory. A drive letter can be included. The trailing '\' is not necessary unless you are specifying the root directory. Examples include: a:\ - root directory on drive a: . - the current directory c:\ccd\data0918 \fitfiles DETAILS ------- Files are converted in a batch mode. The program searches the directory with the "input_file_wildcard" specified to determine the specific files which will be converted. Each file is then read in sequence and written to the "output_directory" specified (the current directory is used, if it is unspecified). The "output_directory" must previously exist. The file name written is the same as the input file except with the extension ".FIT". If two input files have the same file name (first 8 letters) but with different extensions, be aware that the second output file will over-write the first output file. Note that both "compressed" and "uncompressed" Type 3 files are supported. There is extensive error checking which will reject non SBIG Type 3 files without aborting the batch process. To abort the batch, press the key -- the program will exit to DOS after the current file is processed. An example program output is shown below from the command line: C:\ST6>tofits c:\ccd\data0817\*. --- program output starts --- ToFITS V1.3 (07MAR/96) An SBIG (Type 3) CCD Image File to FITS File Converter Program Written by: David J. Lane, Astronomy and Physics Saint Mary's University, Halifax, Canada E-mail: dlane@hercules.stmarys.ca STATUS: 22 file(s) to convert. STATUS: Reading "\CCD\DATA0817\DARK240" ... Writing ".\DARK240.FIT" ... Done STATUS: Reading "\CCD\DATA0817\DARK120" ... Writing ".\DARK120.FIT" ... Done STATUS: Reading "\CCD\DATA0817\DARK30" ... Writing ".\DARK30.FIT" ... Done STATUS: Reading "\CCD\DATA0817\M51" ... Writing ".\M51.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6223" ... Writing ".\N6223.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6247" ... Writing ".\N6247.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6306-07" ... Writing ".\N6306-07.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6310" ... Writing ".\N6310.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6340" ... Writing ".\N6340.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6434" ... Writing ".\N6434.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6503" ... Writing ".\N6503.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6508" ... Writing ".\N6508.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6538" ... Writing ".\N6538.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6598" ... Writing ".\N6598.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6622-21" ... Writing ".\N6622-21.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6643" ... Writing ".\N6643.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6654" ... Writing ".\N6654.FIT" ... Done STATUS: Reading "\CCD\DATA0817\N6690" ... Writing ".\N6690.FIT" ... Done STATUS: Reading "\CCD\DATA0817\SU6" ... Writing ".\SU6.FIT" ... Done STATUS: Reading "\CCD\DATA0817\SU7" ... Writing ".\SU7.FIT" ... Done STATUS: Reading "\CCD\DATA0817\U10736" ... Writing ".\U10736.FIT" ... Done STATUS: Reading "\CCD\DATA0817\BIAS" ... Writing ".\BIAS.FIT" ... Done Returning to DOS. --- program output ends --- THE FITS OUTPUT FILES --------------------- To the best of my knowledge, the output files fully conform to the FITS Standard (NOST 100-1.0 -- June 18, 1993). The data portion of the FITS files are written as 16 bit 2's compliment data. The FITS standard defines a minimum of header cards leaving many of the important cards to be defined by the user. All of the information contained in the SBIG header is included in the FITS header. The header card names closely match that in the SBIG header, except where it was appropriate to rename them to meet the FITS standard or common conventions (for example, TIME was renamed as UT and EXPOSURE was renamed as EXPTIME). Note that it is assumed that the pc's clock was set to UT when exposure was taken. It you intend on performing scientific interpretation of your images, set your pc clock to UT time before acquiring images. Most errors which might be encountered when interpreting the SBIG header information are detected. If an error occurs while interpreting a numerical value, it is encoded into the FITS header using the error number "-1", or if it is is a string, it is encoded as the string "Error". Some early Type 3 files did not include the "Filter" or "Readout_mode" keywords. These keywords are encoded into the FITS header as "Unknown" and "-2" respectively. An example SBIG header is shown below, with the matching FITS header, as produced by ToFITS. --- Start of SBIG Header --- ST-6 Compressed Image File_version = 3 Data_version = 1 Exposure = 3000 Focal_length = 19.680 Aperture = 12.560 Response_factor = 1000.000 Note = Picture taken 08/21/93 at 23:24:46 Background = 304 Range = 1360 Height = 242 Width = 375 Date = 08/21/93 Time = 23:24:46 Exposure_state = 100 Temperature = -30.03 Number_exposures = 1 Each_exposure = 3000 History = D Observer = BGO Observer X_pixel_size = 0.0230 Y_pixel_size = 0.0270 Pedestal = 0 E_gain = 6.70 User_1 = - User_2 = - User_3 = - User_4 = - End --- End of SBIG Header --- --- Start of FITS Header --- SIMPLE = T BITPIX = 16 NAXIS = 2 NAXIS1 = 375 NAXIS2 = 242 BZERO = 3.27680000000E+04 BSCALE = 1.00000000000E+00 OBJECT = 'DK10M.ST6' / ORIGINAL SBIG IMAGE FILE NAME DATE = '31/10/94' / FITS FILE CREATION DATE DATE-OBS= '14/10/94' / UT DATE OF START (ASSUMES PC CLOCK=UT) UT = '20:55:56' / UT TIME OF START (ASSUMES PC CLOCK=UT) ORIGIN = 'ToFITS V1.5' / FILE CREATED BY ToFITS V1.5 (07MAR/96) INSTRUME= 'SBIG ST-6' OBSERVER= 'BGO Observer' EXPTIME = 6.00000000000E+02 / TOTAL EXPOSURE DURATION (S) SNAPSHOT= 1 / NUMBER OF SNAPSHOTS EACHSNAP= 6.00000000000E+02 / SNAPSHOT EXPOSURE DURATION (S) PIXWIDTH= 2.30000000000E-02 / PIXEL WIDTH (MM) PIXHEIGH= 2.70000000000E-02 / PIXEL HEIGHT (MM) RESMODE = 1 / RESOLUTION MODE EXPSTATE= '100' / EXPOSURE STATE (DECIMAL) TEMPERAT= -4.01300000000E+01 / TEMPERATURE (DEG C) RESPONSE= 3.00000000000E+02 / CCD RESPONSE FACTOR EPERADU = 6.70000000000E+00 / ELECTRONS PER ADU FOCALLEN= 1.73000000000E+02 / TELESCOPE FOCAL LENGTH (INCHES) APERTURE= 2.00000000000E+02 / TELESCOPE APERTURE AREA (SQ. INCHES) FILTER = 'None' / OPTICAL FILTER NAME BACKGRND= 304 / BACKGROUND FOR DISPLAY RANGE = 1360 / RANGE FOR DISPLAY PEDESTAL= 0 / PEDESTAL OFFSET HISTORY 0 / CCDOPS IMAGE MODIFICATIONS USERID = -1 / HOU OBSERVATION REQUEST NUMBER COMMENT Picture taken 10/14/94 at 20:55:56 COMMENT ToFITS written by David J. Lane (dlane@hercules.stmarys.ca) COMMENT Astronomy and Physics, Saint Mary's University, Halifax, CANADA END --- End of FITS Header --- FITS files written by ToFITS have been successfully read into several image processing and display programs including SAOImage (Sun Sparc UNIX), IRAF (available on many platforms), and Lick Vista (Sun Sparc UNIX). I have attempted to use header cards directly readable by these "professional" programs. If you would like to suggest changes or additions to the header cards, please contact the author. I may also release the source code to those interested in creating a custom version (it is written in Borland Pascal). David J. Lane, Author E-mail: dlane@ap.stmarys.ca