Applications Note
ST-4 Image File Format

This Applications Note describes the format of image files created by the IBM PC and Macintosh versions of the ST-4 host computer program CCD. The image files contain the 8-bit pixel data for the 192 horizontal by 165 vertical pixel images as well as the telescope calibration factors and file annotation. On the Macintosh, note that the image data is stored in the file's Data Fork.

As shown below in Figure 1, the first 31680 bytes (192 x 165) of the file are the pixel data, in left to right, top to bottom order: The first byte corresponds to the left-most pixel in the top line, the 2nd byte corresponds to the 2nd pixel in the top line, the 193rd byte corresponds to the left-most pixel on the 2nd line, etc. The data should be interpreted as unsigned bytes (values from 0 through 255).

Figure 1

After the 31680 bytes of image data, the telescope parameters are stored in a "166th" line of 192 bytes, making the total file size be 31872 bytes. The data on this 166th line is written in text using ASCII characters. ASCII was chosen so that it could be easily interpreted using most programming languages.

As shown below in Figure 2, the first byte of the 166th line is a lowercase 'v' character (118 in decimal, which signifies the total length of ASCII data on the 166th line). Bytes 2 through 79 (78 bytes total) are the file's annotation or comment. The annotation is left justified and padded with spaces on the right to fill out the 78 character field width. The next 10 bytes (80 through 89) are the exposure or integration time in hundredths of a second. This field and the next three fields are right justified, padded with spaces as required on the left to fill out the 10 character field widths. The next 10 bytes (90 through 99) are the focal length in inches. Bytes 100 through 109 are the aperture area in square inches, and finally bytes 110 through 119 are the image calibration factor. The remaining bytes (120 through 192) on the 166th line are reserved for future use.

Figure 2


Revised: September 23, 1998 01:42:53 PM.
Copyright © 1998 Santa Barbara Instrument Group, Inc.  All rights reserved.

Please report any problems with this page directly to the Webmaster