SAF

Also Known As:

Standard Archive Format, AMSC Archive Format, POD


Type Bitmap and other (see text)
Colors unlimited
Compression GZIP (see article)
Maximum Image Size Unlimited
Multiple Images Per File No
Numerical Format Any
Originator Advanced Missile Signature Center
Platform All
Supporting Applications Unknown
See Also None

Usage
Archival storage of multiple data types in one standard format.

Comments
A flexible format designed for the storage of bitmap and other types of data.

Vendor specifications are available for this format.


The Advanced Missile Signature Center (AMSC) has created a file format known as the Standard Archive Format (SAF) designed for flexible and extensible use in data archiving. The data may be in ASCII or one of a number of binary formats. The file header is ASCII, however, and can be browsed visually to quickly determine content. As an example of file format technology, it incorporates some unique and interesting features, perhaps reflecting its recent vintage and the experience of its creators.

Contents:
File Organization
File Details
For More Information

A file suffix of .SAF usually indicates that the file contains image data. The .POD suffix is usually reserved for files containing POD (Parameter Oriented Data) information. This article discusses the forms of the file that are appropriate for storing image data. Please refer to the document on the CD-ROM for the complete specification and further information.

File Organization

The file consists of an ASCII header followed by binary or ASCII data.

File Details

This section describes the details of the SAF file header, tags, and image data.

Header

The header, always at the start of the file, begins with the ASCII string "HdSize", followed by the length of the header in bytes. HdSize functions as a designated magic number intended to enhance automated file type recognition. HdSize may be followed by the string "auto", in which case the header must be terminated by the string "data".

The rest of the header consists of a list of tags, or field identifiers, followed by data fields. The number of tags is not fixed, and tags can be in any order. Tags in SAF files are simply names in ASCII text followed by a space and are case-insensitive. Only tags necessary to interpret or render the data are included, which keeps down fixed file overhead. This technique--using variable numbers of tags in the header--was apparently designed to enhance automated file handling and data extraction while maintaining maximum flexibility. The header supports editing revisions after initial file creation and can be extended at will.

The specification allows both standard tags and user-defined tags. Standard tags are 6 characters or less, and user-defined tags may be up to 29 characters in length. ASCII lines may be terminated by either linefeed or carriage return/linefeed pairs.

Tags

The following tables, adapted from the SAF specification, list standard tags in SAF files.

Table SAF-1: Generic SAF Tags

Tag

Description

Data Type

HdSize

Header Size (in bytes, or it may be AUTO)

Integer

AqMode

Acquisition Mode

Text

AspAng

Aspect Angle (degrees)

Float

BgFile

Background File

Text

BgType

Background Type

Text

BgValu

Background Value (Average or Fixed)

Float

BPFile

Bad Pixel File

Text

BytOrd

Byte Order

Text

CaFile

Calibration File

Text

ChTemp

High Temp of Cal Source (degrees C)

Float

Class

Classification

Text

CIDay

Collection IRIG Day

Integer

CIHour

Collection IRIG Hour

Integer

CIMin

Collection IRIG Minute

Integer

CISec

Collection IRIG Seconds

Float

ClTemp

Low Temp of Cal Source (degrees C)

Float

COMENT

Comment Line (Repeated as Required)

Text

CSFile

Calibration Source File

Text

Data

End of header

DaType

Data Type

Text

DaUnit

Data Units

Text

DDOff

Data Distribution Office

Text

DiaFOV

Circular FOV (degrees)

Float

DiStat

Distribution Statement

Text

ElAng

Elevation Angle (deg)

Float

EURAW

Processed Level of the Data EU/RAW/Flat-fielded (FF)

Text

ExpID

AMSC Experiment ID#

Text

Filter

Filter Name

Text

Filtno

Filter Number

Integer

FOVAxl

Chamber Test FOV Axial Location (meters)

Float

FOVRdl

Chamber Test FOV Radial Location (meters)

Float

HdVers

Header Version (= 2.0)

Text

HorFOV

Horizontal FOV (degrees)

Float

IHFOV

Instantaneous Horizontal FOV (microradians)

Float

Itime

Integration Time (seconds)

Float

IVFOV

Instantaneous Vertical FOV (microradians)

Float

LinLog

Linear/Log Indicator (LIN/LOG/ASG)

Text

LODAng

Observer Line-of-Sight Angle with respect to True North (CW is +)

Float

LogASl

Log Amp Slope

Float

LogOff

Log Offset

Float

Mach

Mach Number

Float

Mdate

Mission Date (MM/DD/YY)

Text

MeasUn

Measurement Uncertainty-Nominal (%)

Float

Miss

Mission

Text

NCoads

Number of Coads

Integer

NEQ

Noise Equivalent Quantity

Float

NodeNo

Node Number

Text

Note01

Numbered Notes, valid from Note01 through Note99

Text

OffCor

Offset Correction

Float

PPCNam

Platform AMSC Component Name

Text

RDFile

Raw Data File

Text

RolAng

Roll Angle (degrees)

Float

SBPLo

System Bandpass, Lower Wavelength (microns)

Float

SBPUp

System Bandpass, Upper Wavelength (microns)

Float

SclFac

Calibration or Scale Factor

Float

SDLevl

SDIO Data Level

Text

SecCol

Number of Seconds Collected

Integer

SLFile

Spectral Lamp File

Text

SltRng

Slant Range (meters)

Float

SnsAlt

Sensor Altitude (meters)

Float

SPCNam

Sensor AMSC Component Name

Text

Stage

Launch Vehicle Stage Number

Float

StdUnt

Standard Data Units Index

Integer

SUncLo

Independent Parameter Uncertainty Lower Limit

Float

SUncUp

Independent Parameter Uncertainty Upper Limit

Float

TALO

TALO (seconds)

Float

TAOA

Target Angle of Attack (degrees)

Float

Target

Target Name

Text

TestNo

Test Number

Text

TPCNam

Target PC Component Name

Text

TPFact

Transmission Path Factor

Float

TrgAlt

Target Altitude (meters)

Float

TrgHdg

Target Heading with respect to True North (CW is +)

Float

TrgTyp

Target Type (Liquid/Solid)

Text

TrgVel

Target Velocity (meters/second)

Float

TrlNum

Trial Number

Text

TZDay

T-Zero Day

Integer

TZHour

T-Zero Hour

Integer

TZMin

T-Zero Minute

Integer

TZSec

T-Zero Seconds

Float

USRCON

User-Specified Parameters Header Filename

Text

VrtFOV

Vertical FOV (degrees)

Float

Warn01

Warning to the user, valid from 01 thru 99

Text

XUncUn

Independent Parameter Uncertainty Units

Float

YUncLo

Dependent Parameter Uncertainty Lower Limit

Float

YUncLo

Dependent Parameter Uncertainty Upper Limit

Float

YUncUn

Dependent Parameter Uncertainty Units

Float

Table SAF-2: Additional Tags for SAF Image Data

Tag

Description

Data Type

ACFile

Area Correction Factor File

Text

ADJFAC

Non-Linear Adjustment Factor

Float

ApSize

Aperture Size

Float

BGBLLX

Lower Left X for Background Box

Integer

BGBLLY

Lower Left Y for Background Box

Integer

BGBLRX

Lower Right X for Background Box

Integer

BGBLRY

Lower Right Y for Background Box

Integer

BGBULX

Upper Left X for Background Box

Integer

BGBULY

Upper Left Y for Background Box

Integer

BGBURX

Upper Right X for Background Box

Integer

BGBURY

Upper Right Y for Background Box

Integer

Bnd01

Boundary Point for PAV files, valid from 01 thru 99

Integer

Bx1Int

Box 1 Integral Value

Float

Bx1LLX

Box 1 Lower Left X

Integer

Bx1LLY

Box 1 Lower Left Y

Integer

Bx1LRX

Box 1 Lower Right X

Integer

Bx1LRY

Box 1 Lower Right Y

Integer

Bx1ULX

Box 1 Upper Left X

Integer

Bx1ULY

Box 1 Upper Left Y

Integer

Bx1URX

Box 1 Upper Right X

Integer

Bx1URY

Box 1 Upper Right Y

Integer

Bx2Int

Box 2 Integral Value

Float

Bx2LLY

Box 2 Lower Left X

Integer

Bx2LLY

Box 2 Lower Left Y

Integer

Bx2LRX

Box 2 Lower Right X

Integer

Bx2ULX

Box 2 Upper Left X

Integer

Bx2ULY

Box 2 Upper Left Y

Integer

Bx2URX

Box 2 Upper Right X

Integer

Bx2URY

Box 2 Upper Right Y

Integer

CentMX

Center Cursor X Position

Integer

CentMY

Center Cursor Y Position

Integer

CGain

Camera Gain

Float

Colr1

Color 1 Value

Text

Colr2

Color 2 Value

Text

Colr3

Color 3 Value

Text

Colr4

Color 4 Value

Text

Colr5

Color 5 Value

Text

Colr6

Color 6 Value

Text

Colr7

Color 7 Value

Text

Colr8

Color 8 Value

Text

Colr9

Color 9 Value

Text

Colr10

Color 10 Value

Text

Colr11

Color 11 Value

Text

Colr12

Color 12 Value

Text

Colr13

Color 13 Value

Text

Colr14

Color 14 Value

Text

Colr15

Color 15 Value

Text

Colr16

Color 16 Value

Text

ComPrs

Compression Type

Text

DGFld

Digitizer Gamma setting (non-linear adj.)

Float

DiType

Digitizer Type

Text

DPtNum

Data Point Number

Integer

DSGain

Digitizer System Gain

Float

DSOff

Digitizer System Offset

Float

FldFrm

Fields per Frame

Integer

FlorFr

Field or Frame Data in this File

Text

FRate

Frame Rate (frames/second)

Float

FrstCl

First Color

Integer

EMFile

Emissivity File

Text

IDFile

Image Display Control File

Text

ImDisp

Pre-digitized Image Display Format

Text

ImQual

Image Quality

Text

ImSig

Pre-digitized Image Signal Type

Text

ImSize

Image Size (in bytes after any compression)

Integer

Intrlc

Frame Data Are Interlaced in the File

Text

NClrs

Number of Colors Used

Integer

PLeftX

Profile Left X

Integer

PLeftY

Profile Left Y

Integer

PRghtX

Profile Right X

Integer

PRghtY

Profile Right Y

Integer

ProCX

Profile Cursor X

Integer

ProCY

Profile Cursor Y

Integer

SpecFn

Special Function to Apply to the Image

Text

SRFile

Slant Range Correction Factor File

Text

VrtAtt

Vertical Attitude (degrees)

Float

XMag

X Compress or Enlarge Factor

Float

XPixls

Digitized Data Image Width (pixels)

Integer

XPxWid

X (horizontal) Pixel Width (meters)

Float

YMag

Y Compress or Enlarge Factor

Float

YMax

Maximum y value

Float

YMin

Minimum y value

Float

YPixls

Digitized Data Image Height (pixels)

Integer

YPxWid

Y (vertical) Pixel Width (meters)

Float

Table SAF-3: Tags for Ordered Pair Data

Tag

Description

Data Type

Calc01

Calculated Parameter, valid from 01 thru 99

Text

FreRsp

System Electrical Frequency Response (Hz)

Float

Keywrd

XY File Keyword

Text

NParam

Number of Parameters in File

Integer

NumDPs

Number of Data Points in File

Integer

PcSize

Parameter Classification Size (bytes)

Integer

PltSub

XY Plot Subtitle

Text

PltTtl

XY Plot Title

Text

PnSize

Parameter Name Size (bytes)

Integer

PodOrd

Data Ordering in POD Files

Text

PuSize

Parameter Units Size (bytes)

Integer

SampRa

Sample Rate (Hz)

Float

XCFile

X-Axis Calibration File

Text

XDaUnt

X-Axis Data Units

Text

XFName

X-Axis Filename (a 1-parameter POD file)

Text

XParam

X-Axis Parameter name

Text

XScFac

X-Axis Scale Factor (applied to XFName values)

Float

XYFNum

XY File Number

Integer

XYFrst

XY First Value

Float

XYLast

XY Last Value

Float

YParam

Y-Axis Parameter name

Text

The following are the possible data types that can be stored in the DaType tag:

ASCII ASCII strings
Int8 1-byte integer (0-255 unsigned)
Int16 2-byte integer
Int32 4-byte integer
Int64 8-byte integer
Flt32 Single-precision floating-point
Flt64 Double-precision floating-point
RGB24 24-bit color image (3 bytes per pixel, RGB)

KeyWrd tags can contain the following values:

Data Type

Tag Value

Image

IMG

2D array of values (the default tag value)

CMAP

2D array of colormap indices

PAV

Position and value triplets

Parameter Oriented Data

POD

Multiple dependent parameters with the same independent parameter

xy pairs

XYPT

(x,y) pairs, y vs. points

XYFN

(x,y) pairs, y vs. file number

XYTM

(x,y) pairs, vs. time

XYDI

(x,y) pairs, y vs. distance (in meters)

y values only

YPT

y vs. points

YFN

y vs. file number

YTM

y vs. time

YDI

y vs. distance (in meters)

YWL

y vs. wavelength

YWN

y vs. wavenumber

Image Files

Files containing image data contain the tag KeyWrd, which is followed by one of the three types: IMG, CMAP, and PAV:

In IMG files, the header is followed by the image data, XPixls columns by Ypixls rows, and stored in row major order (row one, followed by row two, followed by row three, etc.). The file may contain more than one field; in this case, the image is assumed to be interlaced. A footer may be present following the image data and may contain information about background information (to be subtracted from the image during rendering or analysis) in the form of an array of single-precision floating-point numbers. Units are specified by values for StdUnt or DaUnit tags.

Following the header in CMAP files is a 768-byte palette, consisting of 256 RGB values. This is following by the image data stored as palette indices indexed from the beginning of the palette.

PAV files contain data in the form of ordered triplets, consisting of an ordered pair denoting position and another value related to amplitude. This is designed to enable a rendering application to generate a rectangular array of a size denoted by the values in the XPixls and YPixls tags. Origin is in the upper left corner of the image.

XY data files

Ordered pair data consists of a list of data pairs in (x y) format. The second element of the pair is separated from the first by one or more spaces. Parameter names are stored in tags XParam and YParam, and units for x and y elements of the pair are stored in XDaUnt and DaUnit, respectively.

Data in (x y) format can also be stored as a list of singlet y data, with x values calculated from data stored in tags XYFIRST, XYLAST, and NumDPs.

Other types of files supported directly with predefined tags are Active Source Files and Parameter Oriented Data (POD) files. Please consult the documentation on the CD-ROM for more information on these types of data.

CMAP file example

The following fragment should give you some idea of what a SAF file looks like. This is a uncompressed CMAP (palette) bitmap image file six pixels wide by six pixels high. The DaType of Int8 denotes byte size data. Note that at the time of this writing SAF supports only GZIP compression of image data (or none).

HdSize Auto
Class  Unclassified
DaType Int8
Keywrd CMAP
XPixls 6
YPixls 6
ComPrs NONE
Data
ff ff ff ab 0f 0d...[rest of 768-byte palette data]...00 00 00
00 00 01 fe 0d 0c
bb 02 04 05 09 27
cc 0d 0a 23 21 22
41 de d2 c3 b9 02
aa ab ad 0a 09 32
cd 44 01 09 03 09

For More Information

Information about the SAF format was kindly provided by Dave Holt, and you can reach him at:

Dale Holt
Sverdrup Technology
Arnold AFB, TN 37355
Email: holt@hap.arnold.af.mil

Consult the specification document on the SAF format included .



Copyright © 1996, 1994 O'Reilly & Associates, Inc. All Rights Reserved.