Project SIR-C

SIR-C DATA COMPRESSION SOFTWARE USER GUIDE

Bruce Chapman

chapman@radar-email.jpl.nasa.gov

JPL D-11427

Revision 2.0

June 1994

National Aeronautics and Space Administration

Jet Propulsion Laboratory

California Institute of Technology

Pasadena, California

Copyright (c)1994, California Institute of Technology. U. S. Government Sponsorship under NASA Contract NAS7-918 is acknowledged.

This software is provided to you 'as is' and without warranty of any kind, expressed or implied, including but not limited to, warranties of performance, merchantability, or fitness for a particular purpose. User bears all risk as to the quality and performance of the software.

Table of Contents

1. Introduction

The SIR-C instrument has many different modes of operation. Radar image data generated by the SIR-C team will be compressed in several slightly different formats to reduce the disk space usage requirements.

The software described in this user guide is designed to be used to decompress the various SIR-C data formats. These subroutines are provided to enable users to quickly analyze and obtain results from SIR-C data.

A separate CEOS reader software package is provided for reading the CEOS headers. This program is called CEOS_READER, has its own user guide, and accompanies this software package.

The software described in this user guide is intended to be copied and modified by SIR-C investigators, and incorporated into analysis software that they may write. In order to analyze SIR-C data, the data must be decompressed to floating point numbers. The floating point numbers may then be interpreted by the investigator, converted to byte values, or used by existing software packages for data analysis. The software described here is not a substitute for image display, analysis, or calibration software such as RAVEN, or POLCAL.

The FORTRAN77 software described in this user guide is for converting SIR-C compressed format data to floating point values. Input data may be multilook complex (MLC), multilook detected (MLD), or single look complex (SLC). The decompression software converts the compressed format data to floating point values. These floating point values are either the elements of the scattering matrix (SLC data); or 'crossproducts', which may be combined to form the Stokes matrix (see appendix C). See [1-2] for a description of the Stokes matrix and the cross-product format. The recompression software is included in case the user wants to compress floating point values back to the compressed format.

There are four main programs included for demonstration purposes. The decompression and recompression routines are all subroutines called by these programs.

Each of these main programs sets up the appropriate lookup tables, decompresses the input image file to floating point values, and types out some values for verification purposes. Code for writing the recompressed data back to the same file has been commented out, but is included so that investigators will see how to recompress data. Due to round-off errors, the recompressed bytes might not be exactly the same as the original data file. The purpose of these programs is to demonstrate how the compression subroutines work. The intent is that investigators would copy this software to their analysis software, and modify it for their needs.

In addition to these demonstration programs, a program has been included in this package for creating a byte image file from any format SIR-C data or AIRSAR CM or scattering matrix format data. For quad-pol data, the user is allowed to synthesize any polarization into the byte image file. For dual and single pol data, the user is allowed to select the polarization of the byte image. A subset of the data may be specified. Software is not provided for displaying these images.

A program has also been included for multilooking any SIR-C or AIRSAR format data set. The amount of multilooking in both range and azimuth is selectable by the user.

Following a description of the software is a description of the compression equations for SIR-C format data. AIRSAR format data is discussed in appendix A, as many SIR-C users may have experience and/or software for analysing AIRSAR data. Software is provided here for converting from AIRSAR to SIR-C format data. In appendix C is a description of the Stokes matrix in terms of the crossproducts. The difference between the AIRSAR 'CM' data and SIR-C MLC data is chiefly that, for AIRSAR, the elements of the Stokes Matrix are stored directly to each compressed byte; while for SIR-C, the cross-products (which when combined appropriately comprise the Stokes matrix) are stored. In addition, the AIRSAR data employs a general scale factor, while SIR-C does not.

See [3] for a description of the CEOS headers. These subroutines assume that the first 12 bytes of each line of the input image file that have CEOS prefix information have been stripped off. If this is not the case, the software described here will yield erroneous results.

WARNING: If the image data file has 12 bytes of prefix per line, and the existing readit_CEOS subroutine is used, completely incorrect values will result! Software provided to the members of the SIR-C science team to transfer data from tape to disk, called CEOS_READER, strips off these bytes, but the data files stored on the CEOS formatted tapes do have these 12 bytes of header at the beginning of each line.

Each 10 bytes of compressed MLC data yields 80 bytes of floating point values, linear combinations of which result in 36 bytes of floating point values corresponding to the nine independent values of the Stokes matrix. Given the large data volume of the data sets from SIR-C, it is recommended that, if possible, data be decompressed only as needed.

Makefiles for unix computers are included for compiling and linking the software. For VAX/VMS computers, .com files are included for compilation and linking. All of the software may be compiled and linked by using a single 'make' command on a UNIX OS, which will use the included Makefile. On a VAX/VMS computer, @all.com will compile and link all of the software.

Please contact the author if you need any assistance.

2. Data Compression Software Description

Each of the example main programs described in this section read two files. The first file contains some image parameters, and is created by the user. These parameters may be obtained from the CEOS headers associated with the image file. An example of this ASCII file is :

4,0,40960,4096,8192,10

These values correspond to the input image file. This is the only line in the file. For the example above:

4 : quad-pol SLC data datatype

0 : quad-pol datamode

40960 : the input image record length in bytes reclen

4096 : the number of samples nsamp

8192 : the number of lines nline

10 : the number of bytes per sample nbytes

A program has been supplied which will read the ASCII CEOS files that are created by the CEOS_READER software, and create this common block input file. This program is called create_in.f . See appendix B for the a detailed description of these parameters and how they may be determined without create_in.f . NOTE: as is discussed in appendix B, the record length reclen should be divided by 4 on some DEC computers. This is because, on some DEC computers, the record length is in words, not bytes, and a word is 4 bytes. The program create_in will do this for you, when you tell it that you are using a DEC computer.

The second input file is the SIR-C input compressed image file name, and is copied (using software that the SIR-C project will distribute with this software) from a tape that the SIR-C project provides.

All of the software was written in standard FORTRAN 77 as much as possible, and should work on any computer platform that meets the requirements of the CEOS tape reader software. The demonstration programs are :

CREATE_IN This program creates the common block file (with a user generated name) that contains parameters to be used during compression.

SLC This program demonstrates the compression algorithms for Single Look Complex (SLC) data. The user is prompted for the name of the common block file, and then for the name of the compressed SLC image file.

SLC-CROSS This program demonstrates the compression algorithms for Single Look Complex data. This program is basically identical to SLC, except that it also calculates the cross-products of the scattering matrix.

MLC This program demonstrates the compression algorithms for Multi Look Complex (MLC) data. The user is prompted for the name of the common block file, and then for the name of the compressed MLC image file.

MLD This program demonstrates the compression algorithms for Multi Look Detected (MLD) data. The user is prompted for the name of the common block file, and then for the name of the compressed MLD image file.

The subroutines used in the decompression and recompression of the SIR-C data are:

FASTSLC_SETUP This subroutine calculates the lookup tables for SLC decompression.

FASTSLC_D This subroutine decompresses SLC data to floating point values corresponding to the elements of the scattering matrix.

FASTSCL_CROSS This subroutine calculates the crossproducts of SLC scattering matrix elements that may be combined to give the elements of the Stokes matrix.

FASTMLC_SETUP This subroutine calculates the lookup tables for MLC decompression.

FASTMLC_D This subroutine decompresses MLC data to floating point values corresponding to crossproducts that may be combined to give the Stokes matrix.

FASTMLD_SETUP This subroutine calculates the lookup table for MLD decompression. FASTMLC_SETUP gives the same lookup table.

FASTMLD_D This subroutine decompresses MLD data to floating point values corresponding to the detected power for this single pol dataset.

RECMPSLC This subroutine compresses floating point scattering matrix elements to the SIR-C compressed SLC format.

RECMPMLC This subroutine compresses floating point crossproducts to the SIR-C compressed MLC format.

RECMPMLD This subroutine compresses floating point detected values to the SIR-C compressed MLD format.

READIT_CEOS This subroutine reads in one line of compressed CEOS format data. This subroutine assumes that there are no 12 non-data bytes at the beginning of every line.

WRITEIT_CEOS This subroutine writes out one line of compressed CEOS-like format data.

READASCII_IMG This subroutine reads some quantities from the ASCII CEOS header created by the program CEOS_READER, prxxxxx_img_ceos_ascii.

Many of these subroutines also include a file 'inc.inc'. This file contains a common block corresponding to image parameters read out of one of the input files.

In order to compile and link these programs, the software must first be copied to the users computer disk, into one directory. The following unix command may then be used to compile and link the programs:

> make

This command will compile and link all of the programs. Likewise, all of the main programs may be created with the appropriate make file. MAKESLC, MAKEMLC, MAKEMLD, MAKESLC_CROSS, and MAKECREATE_IN, will compile and link SLC, MLC, MLD, SLC_CROSS, and CREATE_IN, respectively.

On a VAX/VMS computer, command files have been included for compiling and linking the software. For example, the following command file could be executed :

> @all.com

This command file would compile all the necessary subroutines and link the main programs. SLC.COM, MLC.COM, MLD.COM, SLC_CROSS.COM, and CREATE_IN.COM will compile and link SLC, MLC, MLD, SLC_CROSS, and CREATE_IN, respectively.

Alternatively, the subroutines could to be individually compiled, and linked to the main programs. Examination of the make files or .com files will indicate which subroutines are required for each main program. Appendix D describes in more detail how to compile and link each main program.

3. Data Compression Examples

Assume we have received an SLC quad-pol dataset, pr09999 . We wish to demonstrate how to decompress the data. User input is indicated by boldface. First, we create the .input file with create_in. If this program is being run on a DEC computer, the record length in bytes must be divided by 4. Create_in will do this for the user.

>create_in

*************************************************************

* Welcome to create_in *

* *

* Copyright (c) 1993, California Institute of *

* Technology. U.S Government Sponsorship under *

* NASA Contract NAS7-918 is acknowledged. *

* This software is provided to you "as is" and *

* without warranty of any kind, expressed or *

* implied, including but not limited to, *

* warranties of performance, merchantability, or *

* fitness for a particular purpose. User bears *

* all risk as to the quality and performance of the *

* software. *

* *

* This program creates a file that contains *

* required quantities for decompression of SIR-C data *

* *

*************************************************************

enter the processing run number :

9999

processing id : 09999

The ASCII version of the CEOS imagery options file is:

pr09999_img_ceos_ascii

This file is created by the CEOS tape reader software.

See section 6 of the CEOS tape reader user guide

on how to make this file if you dont have it

already.

The output file will be called :

pr09999.input

ASCII file exists and has been opened successfully.

ouput file has been created and opened successfully.

enter type of computer that you are working on :

(0) non-DEC computer

(1) DEC computer

enter number :

0

This file will now be read to obtain quantities

necessary to decompress the data...

----------------Imagery Options ASCII file-------------

SAR Data Record Count: 8192

**(DEC computer, record length is bytes divided by 4)

SAR Record Length (BYTES): 40960

Samples/Pixels/Data Groups per Line: 4096

SAR Format Indicator: COMPRESSED SCATTERING 4

Polarization HH HV VV VH 0

-------------------------------------------------------

File created:

pr09999.input

4 0 40960 4096 8192 10

>

Secondly, we run the demonstration program SLC. This program, as well as MLC, MLD, and SLC_CROSS, types out the average value of the total power between the lines indicated by the user.

> slc

*******************************************************

* *

Copyright (c)1993, California Institute of Technology. U. S. Government Sponsorship under NASA Contract NAS7-918 is acknowledged.

This software is provided to you 'as is' and without warranty of any kind, expressed or implied, including but not limited to, warranties of performance, merchantability, or fitness for a particular purpose. User bears all risk as to the quality and performance of the software.

* This program demonstrates the data handling routines *

* for SLC decompression. *

* *

*******************************************************

enter common block header file name :

pr09999.input

enter SLC SIR-C image file name :

pr09999_img_ceos_image

file type : 4

file mode : 0

input record length : 40960

number of samples : 4096

number of lines : 8192

number of bytes per sample : 10

enter starting line :

1

enter ending line :

4096

average total power :

156.034

number of pixels decompressed :

16777216

>

The program SLC may be copied to the investigators analysis software and modified to analyze the decompressed values, according to the desires of the investigator. Commented out from this demonstration program is a subroutine that would write out the recompressed values. Due to round-off errors, these compressed values might not be exactly the same as those input.

Decompression of MLC and MLD data is very similar to the above. Dual and single pol data formats are handled internally to the software, and execution of the software is the same.

4. Multilook of Data

The datafiles from SIR-C will usually be quite large. The radar swath on the ground, and the size of each image pixel in range and azimuth (samples and lines) will depend on the mode that the radar was operating in, and in the processing of the data that occurred. For various reasons, the scientist using this data may wish to have the data that they have received multilooked (averaged) by a selected amount in either range or azimuth. For instance, the user may want to multilook the data to reduce speckle, to make the dataset smaller and more easily displayed, or to make SLC pixels more square in the ground projection. This multilooking is performed by finding the average of the cross-products of the Stokes matrix.

Unlike the MLC and MLD format data that is produced during normal processing of SIR-C data, the multilook data sets created here from SLC data are NOT in the ground range projection. SLC data is in the slant range projection, in which samples in range correspond to distance from the radar, rather than distance on the ground from the nadir point of the radar, and then geo-rectified to surface coordinates (i.e. ground range projection). Even if the SLC data has square pixels, because it is in the slant range projection, they will not be square pixels on the ground. Likewise, with any SLC data multilooked to MLC or MLD format with the MULTILOOK program, the ground pixel size of the resulting files will differ from the slant range pixel sizes. MLC and MLD data that is multilooked with this program will, of course, still be in the ground range projection, but, depending on the relative amount of multilooking in the range and azimuth direction, may or may not have square pixels.

A program has been supplied that reads the ASCII CEOS leader file that the CEOS_READER software generates, and prints out miscellaneous information about the file, such as incidence angle of the scene, the pixel spacings, scene name, etc from this leader file. In addition, for SLC data (which is in the slant range projection), it prints out a table indicating which multilooking options will result in somewhat square (but not exactly) ground pixels, and the resulting image pixel dimensions. This program also writes this information to a file. This program is called INFO.

For example :

> info

*********************************************************

* Welcome to info *

* *

* Copyright (c) 1993, California Institute of *

* Technology. U.S Government Sponsorship under *

* NASA Contract NAS7-918 is acknowledged. *

* This software is provided to you "as is" and *

* without warranty of any kind, expressed or *

* implied, including but not limited to, *

* warranties of performance, merchantability, or *

* fitness for a particular purpose. User bears *

* all risk as to the quality and performance of the *

* software. *

* *

* This program reads and digests the ASCII *

* CEOS leader file. *

* *

*********************************************************

enter the processing run number :

9995

processing id : 09995

The ASCII version of the CEOS leader file is:

pr09995_ldr_ceos_ascii

This file is created by the CEOS tape reader software.

See section 6 of the CEOS tape reader user guide

on how to make this file if you dont have it

already.

The output file will be called :

pr09995.info

ASCII file exists and has been opened successfully.

ouput file has been created and opened successfully.

This file will now be read to obtain useful

information about the data...

----------------SAR leader ASCII file-------------

---------------Data Set Summary Record------------

Site ID: EB2

Site Name: Nelson House, Manitoba, Can

Geodetic Latitude at Image Center (deg): 50.1837769

Geodetic Longitude at Image Center (deg): -116.9789886

Track Angle at Image Center (deg): 60.8174095

Image Center Line Number: 1294.0000000

Image Center Pixel Number: 724.0000000

Image Length (km): 32.3375015

Image Width (km): 18.0875015

Number of SAR Polarization Channels: 4

SAR Band: L

Resolution (HI = 20 MHz, LO = 10 MHz): HI

Data Acquisition Mode (0 - 23): 16

Transmit Polarization: HV

Receive Polarization: HV

Datatake ID: 35.20

Clock Angle (Left: -90, Right: +90) (deg): 90.000

Incidence Angle at Image Center (deg): 39.356

Radar Wavelength (m): 0.2400894

Hardware Version: 1.10

Software Version: 1.10

Product Type: MULTI-LOOK COMPLEX

Total Number of Looks: 4.0000000

Nominal Range Resolution (m): 25.0000000

Nominal Azimuth Resolution (m): 25.0000000

Line Spacing (m): 12.5000000

Pixel Spacing (m): 12.5000000

Orbit Direction: ASCENDING

-------------------------------------------------------

MULTI-LOOK COMPLEX

Data in ground range projection

ground range pixel size is:

12.50000 m in range direction

12.50000 m in azimuth direction

swath size:

18.08750 Km in range direction

32.33750 Km in azimuth direction

1447 pixels in range direction

2587 pixels in azimuth direction

optimum multilook for square pixels

(range, azimuth) is 1, 1

Potential multilook options:

looks ground pixel size (m) swath(pixels)

range azimuth range azimuth range azimuth No. of looks

10 10 125.00 125.00 144 258 400.0

5 5 62.50 62.50 289 517 100.0

2 2 25.00 25.00 723 1293 16.0

20 20 250.00 250.00 72 129 1600.0

File created:

pr09995.info

>

This file is Multilook complex, so it is already in the ground range projection. However, if it was SLC data, it would calculate the approximate pixel sizes on the ground, and the multilooking that would result in approximately square ground pixels.

Next, we will run CREATE_IN to calculate the common block header file. Then, we will run the MULTILOOK program so that the image will be under 1K x 1K in range and azimuth, for easier display:

>create_in

*************************************************************

* Welcome to create_in *

* Copyright (c) 1993, California Institute of *

* Technology. U.S Government Sponsorship under *

* NASA Contract NAS7-918 is acknowledged. *

* This software is provided to you "as is" and *

* without warranty of any kind, expressed or *

* implied, including but not limited to, *

* warranties of performance, merchantability, or *

* fitness for a particular purpose. User bears *

* all risk as to the quality and performance of the *

* software. *

* This program creates a file that contains *

* required quantities for decompression of SIR-C data *

*************************************************************

enter the processing run number :

9995

processing id : 09995

The ASCII version of the CEOS imagery options file is:

pr09995_img_ceos_ascii

This file is created by the CEOS tape reader software.

See section 6 of the CEOS tape reader user guide

on how to make this file if you dont have it

already.

The output file will be called :

pr09995.input

ASCII file exists and has been opened successfully.

ouput file has been created and opened successfully.

enter type of computer that you are working on :

(0) non-DEC computer

(1) DEC computer

enter number :

0

This file will now be read to obtain quantities

necessary to decompress the data...

----------------Imagery Options ASCII file-------------

SAR Data Record Count: 8192

**(DEC computer, record length is bytes divided by 4)

SAR Record Length (BYTES): 40960

Samples/Pixels/Data Groups per Line: 4096

SAR Format Indicator: COMPRESSED CROSS-PROD 2

Polarization HH HV VV VH 0

-------------------------------------------------------

File created:

pr09995.input

2 0 40960 4096 8192 10

>

Now, we multilook the data:

>multilook

******************************************************

* *

* *

* Copyright (c) 1993, California Institute of *

* Technology. U.S Government Sponsorship under *

* NASA Contract NAS7-918 is acknowledged. *

* This software is provided to you "as is" and *

* without warranty of any kind, expressed or *

* implied, including but not limited to, *

* warranties of performance, merchantability, or *

* fitness for a particular purpose. User bears *

* all risk as to the quality and performance of *

* the software. *

* *

* multilook generates a mulitlooked data file from *

* any SIR-C data take. *

* *

* *

******************************************************

enter common block header file name :

pr09995.input

file type : 2

file mode : 0

input record length : 40960

number of samples : 4096

number of lines : 8192

number of bytes per sample : 10

enter corresponding image data file :

pr09995_img_ceos_image

enter output multilooked file name :

pr09995.ml

Enter the amount of multilooking desired in the

azimuth direction (corresponding to lines of data).

If you want to make a multilooked file less than

1024 lines then the amount of multilooking is 4

this will result in 1024 lines of data

enter amount of multilooking in azimuth direction:

4

Enter the amount of multilooking desired in the

range direction (corresponding to samples of data).

If you want to make a ML file less than 1024 samples,

then the amount of multilooking is 8

this will result in 1024 samples of data

enter amount of multilooking in range direction:

8

This program creates a common block file corresponding

to this MLC or MLD file about to be created.

enter the file name of this common block file

(i.e. prxxxxxml.input):

pr09995ml.input

This MLC quad pol data will still be

MLC quad pol data after multilooking

beginning to multilook...

1

401

801

1201

1601

2001

2401

2801

3201

3601

4001

4401

4801

5201

5601

6001

6401

6801

7201

7601

8001

the amount of multilooking in azimuth is : 4

the amount of multilooking in range is : 8

record length is : 10240

the number of samples per line is : 1024

number of bytes per line is : 10240

number of lines is : 1024

number of bytes per sample is : 10

The output multilook file is:

pr09995.ml

the output common block file is :

pr09995ml.input

>

Using the output common block header file pr09995ml.input, the MLC data file pr09995.ml may be displayed with the program BYTE_IMAGE or analysed with other software. This data set no longer corresponds to the CEOS headers in its dimensions, which is why the new common block header file pr09995ml.input was created.

On a DEC computer, the output record length must be evenly divisible by 4. If it is not, then MULTILOOK will reduce the number of samples of the output until the record length is divisible by 4. The program will know if this is necessary by examination of the input record length (which will be 1/4 of the number of samples for a DEC computer) and the output number of samples.

If MLC data is being multilooked, the result will be an MLC data set. If MLD data is being multilooked, then the result will be an MLD data set. However, if an SLC data set is being multilooked, then, for quad pol and dual pol data, the output will be MLC quad or dual pol data; and if the input data is SLC single pol data, then the result will be MLD data.

There is a make file for compiling and linking this program. It is called MAKEMULTILOOK. For a VMS computer, there is a .com file for the same purpose, multilook.com. This program calls the decompression software described previously.

The MULTILOOK program may also be used to multilook AIRSAR 'CM' compressed Stokes matrix data and AIRSAR compressed scattering matrix data. The CM data is multilooked and converted to MLC format, and the scattering matrix data is multilooked and converted to MLC format. It is assumed that the AIRSAR data is the normal quad pol data format. See section 6 for

a more complete description for using AIRSAR data.

The main programs for multilooking data are:

MULTILOOK - This program multilooks any format SIR-C or AIRSAR data set to MLC or MLD format. It generates a new common block header file that corresponds to this new data set. It does not make corresponding CEOS header files. It does not resample SLC data to ground range. It can be used to convert AIRSAR CM data to MLC format, or AIRSAR SLC data to MLC format.

INFO - This program reads in the SIR-C CEOS ASCII leader file that the CEOS_READER software generates, and saves to a file and to the screen various parameters of

the data set. It also calculates the effect of multilooking on the data in terms of image dimensions and pixel spacings, to help the user choose multilooking factors.

A Subroutine that is called by these programs that is not described elsewhere is:

READASCII_LDR - This program reads the ASCII CEOS leader file, and examines the Data Set Summary record, where many parameters of the scene may be found, decodes them, and saves them to a file.

5. Byte Image Generation

Software is included in this package for creating a byte image of the amplitude of the data file from any format of SIR-C data or AIRSAR data. Depending on the format of the data, the user may select which polarization to convert to a byte image. For single pol data, there is no choice. For dual pol data, the user may select either the total power, or one of the two channels. For quad pol data, the user may synthesize any transmit and receive polarization to convert to a byte image file. In order to synthesize any transmit and receive polarization from quad-pol data, the following operation is performed :

p = Sr M St

Where p is the power value for the chosen transmit and receive Stokes vectors St and Sr , and M is the Stokes matrix. The Stokes vectors are given by

S = BBC[(Ahs4co1(1.0,cos(2[[psi]])*cos(2[[xi]]),sin(2[[psi]])*cos(2[[xi]]),sin(2[[xi])))

where [[psi]] is the orientations angle, and [[xi]] is the ellipticity angle of the polarization ellipse in degrees. See [4] for further information.

The following table lists common transmit and receive polarizations and the corresponding orientation and ellipticity angles in degrees, where H is horizontal polarization, V is vertical polarization, L is left circular polarization, and R is right circular polarization.

polarization [[psi]]t [[xi]]t [[psi]]r [[xi]]r

HH 0 0 0 0

HV 0 0 0 90

VH 0 90 0 0

VV 0 90 0 90

LL 45 135 45 135

RR 45 45 45 45

where [[psi]]t is the transmit orientation angle, [[xi]]t is the transmit ellipticity angle, [[psi]]r is the receive orientation angle, and [[xi]]r receive ellipticity angle. In addition, we may define the total power Pt as the sum of the powers for all four measured polarizations divided by 4 .

In other words, given the transmit and receive orientation and ellipticity angles, we may synthesize the power for any transmit and receive polarization we like from the stokes matrix of the target. We use the square root of this quantity to convert to a byte image.

The program BYTE_IMAGE has been provided for this purpose. This program reads in any format of data, decompresses the data, synthesizes the desired polarization (for quad-pol data) or chooses the desired polarization (for dual and single pol data), determines a scale factor for the byte image file, scales the image to byte values and writes the result out to a file. The user may also optionally select a subset of the data to be converted to a byte image.

BYTE_IMAGE is composed of the following, in addition to decompression subroutines described in the previous chapter:

BYTE_IMAGE This is the main program. It prompts the user for file names, determines allowable polarizations, prompts the user for desired polarization, reads and calls subroutines for decompressing the data, calls subroutines for synthesizing the appropriate polarization, determines a scale factor which may be modified by the user, scales the data to bytes, and writes the result out to a file.

STOKES_SLC This subroutine calculates the Stokes matrix from the cross-products of the scattering matrix.

STOKES_MLC This subroutine calculates the Stokes matrix from the cross-products of the scattering matrix (for symmetrized data).

SYNTH This subroutine synthesizes the power in a chosen polarization.

MAKEBYTE_IMAGE is the unix make file for compiling and linking this program, as described in chapter 2, and BYTE_IMAGE.COM is the VAX/VMS command file for compiling and linking the program.

An example of the execution of using this program follows. First, we must create the .input file as before, this time for a MLC quad-pol data set:

>create_in

*************************************************************

* Welcome to create_in *

* *

* Copyright (c) 1993, California Institute of *

* Technology. U.S Government Sponsorship under *

* NASA Contract NAS7-918 is acknowledged. *

* This software is provided to you "as is" and *

* without warranty of any kind, expressed or *

* implied, including but not limited to, *

* warranties of performance, merchantability, or *

* fitness for a particular purpose. User bears *

* all risk as to the quality and performance of the *

* software. *

* *

* This program creates a file that contains *

* required quantities for decompression of SIR-C data *

* *

*************************************************************

enter the processing run number :

9998

processing id : 09998

The ASCII version of the CEOS imagery options file is:

pr09998_img_ceos_ascii

This file is created by the CEOS tape reader software.

See section 6 of the CEOS tape reader user guide

on how to make this file if you dont have it

already.

The output file will be called :

pr09998.input

ASCII file exists and has been opened successfully.

ouput file has been created and opened successfully.

enter type of computer that you are working on :

(0) non-DEC computer

(1) DEC computer

enter number :

0

This file will now be read to obtain quantities

necessary to decompress the data...

----------------Imagery Options ASCII file-------------

SAR Data Record Count: 8192

**(DEC computer, record length is bytes divided by 4)

SAR Record Length (BYTES): 40960

Samples/Pixels/Data Groups per Line: 4096

SAR Format Indicator: COMPRESSED CROSS-PROD 2

Polarization HH HV VV VH 0

-------------------------------------------------------

File created:

pr09998.input

2 0 40960 4096 8192 10

>

Next, we execute the BYTE_IMAGE program for this quad pol MLC dataset:

> byte_image

******************************************************

* *

Copyright (c)1993, California Institute of Technology. U. S. Government Sponsorship under NASA Contract NAS7-918 is acknowledged.

This software is provided to you 'as is' and without warranty of any kind, expressed or implied, including but not limited to, warranties of performance, merchantability, or fitness for a particular purpose. User bears all risk as to the quality and performance of the software.

* byte_image generates a byte image data file from *

* a SIR-C data take. *

* *

* *

******************************************************

enter common block header file name :

pr09998.input

file type : 2

file mode : 0

input record length : 40960

number of samples : 4096

number of lines : 8192

number of bytes per sample : 10

enter corresponding image data file :

pr09998_img_ceos_image

enter output byte file name :

pr09998.hh

do you wish to make a byte image

of a SUBSET of the data ? (1 = yes) :

1

enter first line of data to start at :

1000

enter how many lines :

500

enter first sample of data :

250

enter how many samples :

500

starting line = 1000

ending line = 1499

starting sample = 250

ending sample = 749

output record length is : 500

Any transmit and receive polarization may be

synthesized from this quadpol data file.

in many cases, H or V polarization is desired.

Any polarization may be entered, but the

following values are tabulated for your information.

pol transmit(ellipt.,orient.) receive(ellipt.,orient.)

--------------------------------------------------------

HH ( 0, 0) (0, 0)

HV ( 0, 0) (0, 90)

VH ( 0, 90) (0, 0)

VV ( 0, 90) (0, 90)

LL (45,135) (45,135)

RR (45,45) (45,45)

Total Power => enter -1

--------------------------------------------------------

enter transmit ellipticity :

0

enter tranmit orientation :

90

enter receive ellipticity :

0

enter receive orientation :

90

stokes transmit and receive vectors :

T R

1.000 1.000

-1.000 -1.000

0.000 0.000

0.000 0.000

...Average scale factor is 4529.21

enter a relative scale factor :

1

line avg power

1000 162.870

1200 146.420

1300 101.2775

1400 106.366

1500 87.0305

The output byte file is:

pr09998.hh

>

As stated by BYTE_IMAGE during execution, the record length of the output byte image is 500 bytes.

Now, we will show an example for a MLC dual pol data set, with the .input file already created:

> byte_image

******************************************************

* *

Copyright (c)1993, California Institute of Technology. U. S. Government Sponsorship under NASA Contract NAS7-918 is acknowledged.

This software is provided to you 'as is' and without warranty of any kind, expressed or implied, including but not limited to, warranties of performance, merchantability, or fitness for a particular purpose. User bears all risk as to the quality and performance of the software.

* byte_image generates a byte image data file from *

* a SIR-C data take. *

* *

* *

******************************************************

enter common block header file name :

pr09997.input

file type : 3

file mode : 1

input record length : 20480

number of samples : 4096

number of lines : 8192

number of bytes per sample : 5

enter corresponding image data file :

pr09997_img_ceos_image

enter output byte file name :

pr09997.vv

do you wish to make a byte image

of a SUBSET of the data ? (1 = yes) :

0

starting line = 1

ending line = 8192

starting sample = 1

ending sample = 4096

output record length is : 4096

This is dual pol data

possible output polarizations:

0. total power

1. HH

2. unavailable

3. unavailable

4. VV

select desired output polarization:

4

...Average scale factor is 4.28990

enter a relative scale factor :

1

line avg power

100 2.20858

200 2.12610

300 49.2359

400 0.293563

500 1.18972

600 0.447104

700 7.58034

800 14.4178

900 5.12934

1000 4.52315

The output byte file is:

pr09997.vv

>

As stated by BYTE_IMAGE during execution, the record length of the output byte image is 4096 bytes.

6. Using AIRSAR Data

Many SIR-C investigators have been testing algorithms and theories with AIRSAR data. AIRSAR is a NASA/JPL multipolarization, three frequency (C-band, L-band, and P-band) airborne SAR. AIRSAR data is stored in a slightly different format that SIR-C data. There are no CEOS headers. The standard product is currently 16 look data, in which the Stokes matrix is compressed and stored directly, rather than the cross-products of the Stokes matrix that the SIR-C project stores. This format is known as AIRSAR CM data. This data is NOT resampled to the ground range projection, but is in the slant range projection, which is the natural projection of the SAR. Another product that is distributed is the compressed scattering matrix data, which is very similar to the SLC data format, but is not identical. This data is also not resampled to ground range projection.

Another difference between AIRSAR data and SIR-C data is that AIRSAR data is 'cornerturned' with respect to SIR-C data. For SIR-C data, the range (cross-track distance) to each sample in the data file increases horizontally with pixel sample number in the file, and azimuth (along-track) distance increases vertically with pixel line number in the file. However, AIRSAR data is 'cornerturned' from SIR-C format data, with pixel samples of decreasing azimuth (along-track), and pixel lines of increasing range (cross-track).

AIRSAR data may have up to three lines of header information at the beginning of the file. These three headers are called the newheader, the oldheader, and the parameter header, respectively. The program CREATE_IN_AIRSAR reads the newheader to obtain image dimension information and to write that information to an ASCII common block header file, for use with the software herein described. The subroutine AIRSAR_HDR reads the oldheader for just one value, the general scale factor, which is used in compressing the data.

Some users may have existing software for reading AIRSAR data, and analyzing it. Therefore, software is included here for converting MLC quad pol data to AIRSAR cm format, called MLC_TO_AIRSAR. This conversion consists of selecting a region in the MLC image to convert, cornerturning the data, decompressing the cross-products, compressing the stokes matrix to the AIRSAR format, and writing necessary AIRSAR header values to the first two lines of the file. No parameter header is created, and only a few oldheader values are written. The newheader is written in its entirety. The compression scale factor in the oldheader is crucial for determing the sigma naught values, but its location in the oldheader is somewhat non-standard. However, its value written by the program MLC_TO_AIRSAR is always 1.0. Other values that may be required will have to be determined from the CEOS headers by the user. If a quad pol SLC data set must be converted to the AIRSAR cm format, the user should first use the MULTILOOK program to multilook the data to the MLC format. One requirment for AIRSAR data is that the record length must be 10240 bytes (in azimuth). Therefore, after any multilooking, there should be at least 1024 lines of MLC data in azimuth. In addition, AIRSAR cm format data is only defined for quad pol data.

If the user has AIRSAR data to manipulate, the ASCII common block header file may be created from either CREATE_IN_AIRSAR or by manually entering the values (see Appendix B). Then, the user may use one of three programs:

MULTILOOK - This program may be used to multilook the data any number of looks, Both SIR-C format data and AIRSAR format data. The result will be stored in the MLC data format. The data is NOT resampled to the ground range projection. There will be no CEOS headers created, though a common block header file will be created corresponding to this new data file.

BYTE_IMAGE - This program may be used to create a byte image of either AIRSAR data format.

AIRSAR_SCAT2SLC - This program may be used to convert the AIRSAR scattering matrix format data to the SIR-C SLC data format. There will be no CEOS headers created, though a common block header file will be created corresponding to this new data file.

If the user wishes to convert AIRSAR data to SIR-C format, the following may be done: for AIRSAR CM data, the program MULTILOOK may be run, in which, if no multilooking is desired, a multilook of 1 in both directions may be calculated. The resulting data file will simply be the AIRSAR file in SIR-C MLC format (with no ground range resampling). For AIRSAR scattering matrix data, the program AIRSAR_SCAT2SLC will convert the data format to SLC format. If multilooking is desired, the program MULTILOOK may be run, and the desired multilook data will be converted to MLC format.

The following programs have been written specifically for AIRSAR format data :

CREATE_IN_AIRSAR - This program reads the AIRSAR newheader, extracts the dimensions of the file, and writes it to an ASCII common block header file used by all of the other software.

AIRSAR_SCAT2SLC - This program converts AIRSAR scattering matrix format data to SIR-C SLC format data. It also creates an ASCII common block header file used by all of the other software.

The following subroutines have been written to decompress and read AIRSAR data:

FASTCM_SETUP - This subroutine sets up the look up tables for decompression of AIRSAR CM data. It requires as input the general scale factor.

FASTSCAT_SETUP - This subroutine sets up the look up tables for decompression of AIRSAR scattering matrix data. It requires as input the general scale factor.

FASTCM_D - This subroutine decompresses AIRSAR CM format data, using the lookup tables generated by FASTCM_SETUP.

UNSTOKES - This subroutine calculates the cross products of the Stokes matrix from the elements of the Stokes matrix. This makes it possible for AIRSAR CM data to be transparently used in other software. This subroutine is called by FASTCM_D.

FASTSCAT_D - This subroutine decompresses AIRSAR scattering matrix format data, using the lookup tables generated by FASTSCAT_SETUP.

AIRSAR_HDR - This subroutine attempts to read the AIRSAR general scale factor from the oldheader. If it is not able to decode the value, it prints the string that it should occur in, and asks the user to input the value. AIRSAR scattering matrix data has the general scale factor in a slightly different spot than CM data, and subsequently, has difficulty decoding the value.

The following program may be used to convert MLC quad pol data to AIRSAR CM format.

MLC_TO_AIRSAR - This program will convert a subset of an MLC quad pol data set to AIRSAR CM data set. The newheader will be written in its entirety, and a few values will be written to the oldheader. The MLC data selected is cornerturned to be in agreement with the AIRSAR cm format. There must be exactly 1024 azimuth lines converted.

7. Miscellaneous Software

There are a few programs included here for relatively rare ,specialized applications:

Cornerturn (transpose) any format data.

Convert compressed format data to floating point files, and floating point files to cmpressed files.

Convert dual pol SLC data to quad pol SLC data by either assuming that HV=VH and HH=VV, or that the HV=VH=HH-6dB (depending on mode).

Convert quad pol SLC data to dual pol SLC data by eliminating two polarizations.

All of these programs are included here for testing purposes only. In the future, a software package will be released that includes these and other funtions.

8. Data Compression Formats

For SIR-C there are three possible data formats:

1) compressed cross-products data (MLC) (Multilook data)

quad-pol, 10 bytes per pixel

dual-pol 5 bytes per pixel

2) compressed detected data (MLD) (Multilook data)

single-pol, 2 bytes per pixel

3) compressed scattering matrix data (SLC) (Singlelook data)

quad-pol, 10 bytes per pixel

dual-pol, 6 bytes per pixel

single-pol, 4 bytes per pixel

In the following descriptions:

sign( ) will return the sign of the argument ( +/- 1)

nint( ) will indicate that the nearest integer value is calculated of its argument.

int( ) will indicate that the truncation of the floating point value to integer is calculated of its argument, and that, if the floating point value is less than zero, subtraction by 1.0 is additionally required. Note that this is not the same as FORTRAN int( ).

8.1 Single Look Complex data

There are three data products for complex scattering matrix data, depending of polarization mode.

SIR-C "SLC" quad-pol data - 10 bytes per pixel. Consists of one file for each scene, per frequency. Each line of the file consists of TBD range samples, in which range increases with sample number. There are a TBD number of lines per file, in which each line corresponds to different azimuth or along track locations. There are no header lines after the file has been stripped for the header by the CEOS reader. The standard output product by the GDPS will not have 12 bytes of file information at the beginning of each line. There will be separate header files. This data will be single look complex scattering matrix data. This is the only format that is supported by the SIR-C calibration processor during phase 1. There is no symmetrization of the data. There is no general scale factor.

deg. 10 bytes per pixel - quad-pol data, with:

deg. Byte(1) : int{log2 (SHHSHH* + SHVSHV* + SVHSVH*+ SVVSVV*)}

deg. Byte(2) : nint{254[Mantissa - 1.5]}

Mantissa = (SHHSHH* + SHVSHV* + SVHSVH*+ SVVSVV*) / 2Byte(1)

qsca = sqrt{ [ (Byte(2) / 254 ) + 1.5] 2Byte(1) }

deg. Byte(3) : nint{127 Re(SHH)/qsca}

deg. Byte(4) : nint{127 Im(SHH)/qsca}

deg. Byte(5) : nint{127 Re(SHV)/qsca}

deg. Byte(6) : nint{127 Im(SHV)/qsca}

deg. Byte(7) : nint{127 Re(SVH)/qsca}

deg. Byte(8) : nint{127 Im(SVH)/qsca}

deg. Byte(9) : nint{127 Re(SVV)/qsca}

deg. Byte(10) : nint{127 Im(SVV)/qsca}

The total power (when decompressing) is :

TP = 0.25 ( byte(2) / 254 + 1.5) 2Byte(1))

and the remaining terms are given by :

ysca = sqrt{ [ (Byte(2) / 254 ) + 1.5] 2Byte(1) }

Re(SHH) = byte(3) ysca/127

Im(SHH) = byte(4) ysca/127

Re(SHV) = byte(5) ysca/127

Im(SHV) = byte(6) ysca/127

Re(SVH) = byte(7) ysca/127

Im(SVH) = byte(8) ysca/127

Re(SVV) = byte(9) ysca/127

Im(SVV) = byte(10) ysca/127

SIR-C "SLC" dual-pol data - 6 bytes per pixel. Consists of one file for each scene, per frequency. Each line of the file consists of TBD range samples, in which range increases with sample number. There are a TBD number of lines per file, in which each line corresponds to different azimuth or along track locations. There are no header lines after the file has been stripped for the header by the CEOS reader. The standard output product by the GDPS will not have 12 bytes of file information at the beginning of each line. There will be separate header files. This data will be single look complex scattering matrix data. The compression format is the same as for the quad-pol data format, except that not all 10 bytes are present. The bytes present depend on the polarization mode.

HH and VV polarizations : bytes 1,2,3,4,9,10

HH and HV polarizations : bytes 1,2,3,4,5,6

VH and VV polarizations : bytes 1,2,7,8,9,10

SIR-C "SLC" single-pol data - 4 bytes per pixel. Consists of one file for each scene, per frequency. Each line of the file consists of TBD range samples, in which range increases with sample number. There are a TBD number of lines per file, in which each line corresponds to different azimuth or along track locations. There are no header lines after the file has been stripped for the header by the CEOS reader. The standard output product by the GDPS will have 12 bytes of file information at the beginning of each line. There will be separate header files. This data will be single look complex scattering matrix data. The compression format is the same as for the quad-pol data format, except that not all 10 bytes are present. The bytes present depend on the polarization mode.

HH polarization : bytes 1,2,3,4

VV polarization : bytes 1,2,9,10

8.2 Multi Look Complex data

There are two possible data formats for Cross-products data, depending on polarization mode.

SIR-C "MLC" quad-pol data - 10 bytes per pixel. Consists of one file for each scene, per frequency. Each line of the file consists of TBD range samples, in which range increases with sample number. There are a TBD number of lines per file, in which each line corresponds to different azimuth or along track locations. There are no header lines after the file has been stripped for the header by the CEOS reader. The standard output product by the GDPS will not have 12 bytes of file information at the beginning of each line. There will be separate header files. This data will be multi look complex cross-product data. The bytes present depend on the polarization mode. The data has been symmetrized such that SHV = 0.5 (SHV +SVH).

deg. 10 bytes per pixel - quad-pol data, with:

deg. Byte(1) : int{log2(SHHSHH* + 2SHVSHV* + SVVSVV*)}

deg. Byte(2) : nint{254[Mantissa - 1.5]}

Mantissa = (SHHSHH* + 2SHVSHV* + SVVSVV*) / 2Byte(1))

qsca = [ (Byte(2) / 254 ) + 1.5] 2Byte(1)

deg. Byte(3) : nint{255 sqrt(SHVSHV* / qsca)} - 127

deg. Byte(4) : nint{255 (SVVSVV* / qsca)} - 127

deg. Byte(5) : nint{sign[Re(SHHSHV*)]

127sqrt(2|Re(SHHSHV*) | / qsca)}

deg. Byte(6) : nint{sign[Im(SHHSHV*)]

127sqrt(2|Im(SHHSHV*) | / qsca)}

deg. Byte(7) : nint{127 (2Re(SHHSVV* ) / qsca)}

deg. Byte(8) : nint{127 (2Im(SHHSVV* ) / qsca)}

deg. Byte(9) : nint{sign[Re(SHVSVV*)]

127sqrt(2|Re(SHVSVV*) | / qsca)}

deg. Byte(10) : nint{sign[Im(SHVSVV*)]

127sqrt(2|Im(SHVSVV*) | / qsca)}

The total power is :

TP = 0.25 ( byte(2) / 254 + 1.5) 2Byte(1))

The remaining terms are given by :

SHVSHV* = qsca[ (byte(3) + 127)/255]2

SVVSVV* = qsca[ (byte(4) + 127)/255]

SHHSHH* = qsca - SVVSVV* - 2 SHVSHV*

Re(SHHSHV*) = 0.5 qsca {sign(byte(5)) [byte(5)/127]2}

Im(SHHSHV*) = 0.5 qsca {sign(byte(6)) [byte(6)/127]2}

Re(SHHSVV*) = qsca [byte(7)/254]

Im(SHHSVV*) = qsca [byte(8)/254]

Re(SHVSVV*) = 0.5 qsca {sign(byte(9)) [byte(9)/127]2}

Im(SHVSVV*) = 0.5 qsca {sign(byte(10)) [byte(10)/127]2}

SIR-C "MLC" dual-pol data - 5 bytes per pixel. Consists of one file for each scene, per frequency. Each line of the file consists of TBD range samples, in which range increases with sample number. There are a TBD number of lines per file, in which each line corresponds to different azimuth or along track locations. There are no header lines after the file has been stripped for the header by the CEOS reader. The standard output product by the GDPS will have 12 bytes of file information at the beginning of each line. There will be separate header files. This data will be multi look complex cross-product data. The compression format is the same as for the quad-pol data format, except that not all 10 bytes are present. The bytes present depend on the polarization mode.

HH and VV polarizations : bytes 1,2,4,7,8

HH and HV polarizations : bytes 1,2,3,5,6

VH and VV polarizations : bytes 1,2,3,9,10

8.3 Multi Look Detected data

There is one Multilook detected data product :

SIR-C "MLD" single pol data - 2 bytes per pixel. Consists of one file for each scene, per frequency. Each line of the file consists of TBD range samples, in which range increases with sample number. There are a TBD number of lines per file, in which each line corresponds to different azimuth or along track locations. There are no header lines after the file has been stripped for the header by the CEOS reader. The standard output product by the GDPS will not have 12 bytes of file information at the beginning of each line. There will be separate header files. This data will be multi look detected power values. The polarization will be either HH , HV, VH, or VV, depending on mode.

deg. 2 bytes per pixel - single-pol data, with:

deg. Byte(1) : int{log2(SXYSXY*)}

deg. Byte(2) : nint{254[SXYSXY*/2Byte(1) - 1.5]}

To decompress the power,

TP = ( byte(2) / 254 + 1.5) 2Byte(1))

Appendix A: AIRSAR format data

For AIRSAR data, there are four possible formats :

1) compressed stokes matrix data

(multilook,quad-pol, low-res, 10 bytes/pixel)

2) compressed scattering matrix (730 processor) data

(single look,quad-pol,10 bytes/pixel)

3) compressed scattering matrix (3.5 processor) data

(single look,quad-pol, low-res, 10 bytes/pixel)

4) uncompressed synoptic amplitude data

(vax real*4, single pol, low-res, 4 bytes/pixel)

In the following descriptions:

sign( ) will return the sign of the argument ( +/- 1)

nint( ) will indicate that the nearest integer value is calculated of its argument.

int( ) will indicate that the truncation of the floating point value to integer is calculated of its argument, and that, if the floating point value is less than zero, subtraction by 1.0 is additionally required. Note that this is not the same as FORTRAN int( ).

gen_fac is the AIRSAR general scale factor whose value is recorded in the header of the oldheader, field 133.

A.1 Complex scattering matrix data

AIRSAR 730 processor "hi-res" quad-pol data - 10 bytes per pixel. Consists of four files for each scene, per frequency. Each line of each file consists of 1024 azimuth samples. There are 750 lines, each corresponding to progressively greater range from the radar. The azimuth pixel spacing is 3.33 meters. The range pixel spacing is 6.66 meters (assumes 20 MHz data). The four files are exactly adjacent to each other in azimuth. Generally, the first two lines of the file are header lines. There is no symmetrization of the data.

deg. 10 bytes per pixel - quad-pol data, with:

deg. Byte(1) : int{log2(0.25 (SHHMHH* + SHVSHV* + SVHSVH*+ SVVSVV*))}

deg. Byte(2) : nint{254[Mantissa - 1.5]}

Mantissa = 0.25 (SHHSHH* + SHVSHV* + SVHSVH*+ SVVSVV*) / 2Byte(1)

qsca = 2 sqrt{ gen_fac [ (Byte(2) / 254 ) + 1.5] 2Byte(1) }

deg. Byte(3) : nint{127 Re(SHH)/qsca}

deg. Byte(4) : nint{127 Im(SHH)/qsca}

deg. Byte(5) : nint{127 Re(SHV)/qsca}

deg. Byte(6) : nint{127 Im(SHV)/qsca}

deg. Byte(7) : nint{127 Re(SVH)/qsca}

deg. Byte(8) : nint{127 Im(SVH)/qsca}

deg. Byte(9) : nint{127 Re(SVV)/qsca}

deg. Byte(10) : nint{127 Im(SVV)/qsca}

The total power (when decompressing) is :

TP = gen_fac ( byte(2) / 254 + 1.5) 2Byte(1))

and the remaining terms are given by :

ysca = 2 sqrt{ gen_fac [ (Byte(2) / 254 ) + 1.5] 2Byte(1) }

Re(SHH) = byte(3) ysca/127

Im(SHH) = byte(4) ysca/127

Re(SHV) = byte(5) ysca/127

Im(SHV) = byte(6) ysca/127

Re(SVH) = byte(7) ysca/127

Im(SVH) = byte(8) ysca/127

Re(SVV) = byte(9) ysca/127

Im(SVV) = byte(10) ysca/127

AIRSAR 3.5 processor "complex" quad-pol data - 10 bytes per pixel. Consists of four files for each scene, per frequency. Each line of each file consists of 1024 azimuth samples. There are 1282 lines, each corresponding to progressively greater range from the radar. For 20 MHz bandwidth data, the azimuth pixel spacing is 12.2 meters (1993 and after, the prf was increased, such that the azimuth pixel spacing was decreased to 8 meters). The range pixel spacing is 6.66 meters (again assuming 20 MHz data). The first 2 lines of each file are header lines. The four files correspond to the center four looks of 16 processed looks. There is no symmetrization of the data. The compression is identical to the AIRSAR 730 processor "hi-res" quad-pol data.

The differences between AIRSAR and SIR-C data, is that the first two bytes are defined differently, and that the scale factor is defined differently. The value stored in the first two bytes by AIRSAR is the total power, while the value stored in the first two bytes by SIR-C is four times the total power. The scale factor for AIRSAR is two times larger than the scale factor used by SIR-C. In addition, there is no general scale factor for SIR-C.

Because of round off errors for some of the cross-product terms that are small, AIRSAR data converted to the SIR-C format, and then compared with the original AIRSAR compressed scattering matrix data, or with the AIRSAR Stokes data derived from the scattering matrix data, might not be in exact agreement.

A.2 Stokes matrix data

AIRSAR compressed Stokes matrix "CM" quad-pol data - 10 bytes per pixel. Consists of one file for each scene, per frequency. Each line of each file consists of 1024 azimuth samples. There are 750 or 1282 lines depending on the processor, each corresponding to progressively greater range from the radar. The azimuth pixel spacing is 12.1 meters for the pre-1993 prf, and 8 meters for the 1993 and later prf. The range pixel spacing is 6.66 meters (assumes 20 MHz data). The first two or three lines in the file are header lines. The data has been symmetrized such that SHV = 0.5 (SHV +SVH), and is usually calibrated. For the "730 processor", the data has been multilooked by 4, while for the "3.5 processor", the data has been multilooked by 16.

deg. 10 bytes per pixel - quad-pol data, with:

deg. Byte(1) : int{log2(M11)}

deg. Byte(2) : nint{254[Mantissa - 1.5]}

Mantissa = (M11) / 2Byte(1))

qsca = gen_fac [ (Byte(2) / 254 ) + 1.5] 2Byte(1)

deg. Byte(3) : nint{127 M12/qsca}

deg. Byte(4) : nint{127 sign(M13/qsca) sqrt(M13/qsca)}

deg. Byte(5) : nint{127 sign(M14/qsca) sqrt(M14/qsca)}

deg. Byte(6) : nint{127 sign(M23/qsca) sqrt(M23/qsca)}

deg. Byte(7) : nint{127 sign(M24/qsca) sqrt(M24/qsca)}

deg. Byte(8) : nint{127 M33/qsca}

deg. Byte(9) : nint{127 M34/qsca}

deg. Byte(10) : nint{127 M44/qsca}

The total power is :

TP = M11 = gen_fac ( byte(2) / 254 + 1.5) 2Byte(1))

The remaining terms are given by :

M12 = M11 byte(3) /127

M13 = sign(byte(4)) M11 (byte(4) /127)**2

M14 = sign(byte(5)) M11 (byte(5) /127)**2

M23 = sign(byte(6)) M11 (byte(6) /127)**2

M24 = sign(byte(7)) M11 (byte(7) /127)**2

M33 = M11 byte(8) /127

M34 = M11 byte(9) /127

M44 = M11 byte(10) /127

M22 = M11 - M33 - M44

The difference between the AIRSAR 'CM' data and SIR-C MLC data is chiefly that, for AIRSAR, the elements of the Stokes Matrix are stored directly to each compressed byte; while for SIR-C, the cross-products (that when combined appropriately comprise the Stokes matrix) are stored. In addition, the AIRSAR data employs a general scale factor, while SIR-C does not. And finally, the value stored in the first two bytes by AIRSAR is the total power divided by the general scale factor, while the value stored in the first two bytes by SIR-C is four times the total power.

A.3 Detected data products

AIRSAR synoptic amplitude data - 4 bytes per pixel. This data is not compressed. Consists of one file for each scene, per channel processed (usually three). Each line of the file consists of 1279 range samples, in which range increases with sample number. There are 5090 lines per file, in which each line corresponds to different azimuth or along track locations. The azimuth pixel spacing is 12.1 meters for the pre-1993 prf, and 8 meters for the 1993 and later prf. The range pixel spacing is 6.66 meters (assumes 20 MHz data). The first two lines in the file are header lines. The data has been multilooked by 16, and the pixels are amplitude rather than power values. The format is that each pixel is a four byte DEC VAX floating point number. There is no general scale factor that is used.

Appendix B: Parameter description

The following defined parameters may be determined and written to a file by running the program CREATE_IN. CREATE_IN determines these parameters by reading the ASCII CEOS headers that are created by the CEOS_READER software. This appendix describes how they are defined. Input parameters may be determined from the CEOS headers. In the SAR Leader File, Data Set Summary Record, field 86 is the data type (MLC,SLC, or MLD), while field 8 of the same record is the frequency and polarization (i.e. CHH and CVV , or Lquad). From these you may determine the numerical representation of datatype and datamode by the following:

datatype field 86 Field 8

1 MLD single pol

2 MLC quad pol

3 MLC dual pol

4 SLC quad pol

5 SLC dual pol

6 SLC single pol

(datatype 7 is AIRSAR CM data, while datatype 8 is AIRSAR scattering matrix data)

datamode field 8

0 Lquad,Cquad

1 LHH and LVV, or CHH and CVV

2 LHH and LHV, or CHH and CHV

3 LVH and LVV, or CVH and CVV

4 LHH or CHH

5 LVV or CVV

6 other single pol data (i.e. MLD HV)

The number of bytes per sample may be found in the Imagery Options File, file descriptor record, field 34. The number of samples nsamp is in the Imagery Options File, file descriptor record, field 39, while the number of lines is in the Imagery Options File, file descriptor record, field 29.

The record length in the Imagery Options File, file descriptor record, field 30. If this software is running on a DEC computer, the record length from the above field might have to be divided by 4. Check your FORTRAN reference guide.

For AIRSAR data, the ASCII common block header file is more simply determined. The program CREATE_IN_AIRSAR reads the newheader to produce the ASCII common block header file. Alternatively, the file may be created manually. Both the CM format data and the scattering matrix format data are only available as quad pol, the record length is always 10240 bytes, the number of samples is always 1024, the number of bytes per sample is always 10 , and the number of lines is usually either 750 or 1280.

The data type for AIRSAR CM data is '7', while the data type for AIRSAR scattering matrix data is '8'.

For AIRSAR CM data, the ASCII file will be :

7,0,10240(non-DEC computer) or 2560(DEC), 1024,750 or 1280, 10

For AIRSAR scattering matrix data, the ASCII file will be:

8,0,10240(non-DEC computer) or 2560(DEC), 1024,750 or 1280, 10

Appendix C: The Stokes matrix and Cross-Products

The symmetrized Stokes matrix may be formed from the cross-products of the scattering matrix that are stored by SIR-C in the MLC format as follows:

m(1,1) = (ShhShh* + SvvSvv* + 2ShvShv*) / 4.0

m(1,2) = (ShhShh* - SvvSvv*) / 4.0

m(1,3) = (Re(ShhShv*) + Re(ShvSvv*) ) / 2.0

m(1,4) = (-Im(ShhShv*) - Im(ShvSvv*) ) / 2.0

m(2,1) = m(1,2)

m(2,2) = (ShhShh* +SvvSvv* - 2ShvShv* ) / 4.0

m(2,3) = ( Re(ShhShv*) - Re(ShvSvv*) ) / 2.0

m(2,4) = (-Im(ShhShv*) + Im(ShvSvv*) )/ 2.0

m(3,1) = m(1,3)

m(3,2) = m(2,3)

m(3,3) = (ShvShv* + Re(ShhSvv*) / 2.0

m(3,4) = -Im(ShhSvv*) / 2.0

m(4,1) = m(1,4)

m(4,2) = m(2,4)

m(4,3) = m(3,4)

m(4,4) = (ShvShv* - Re(ShhSvv*) )/ 2.0

The cross-products in terms of the symmetrized Stokes matrix elements are :

ShhShh* = 2m(1,2) + 2m(1,1) - m(3,3) - m(4,4)

ShvShv* = m(3,3) + m(4,4)

SvvSvv* = 2m(1,1) - 2m(1,2) - m(3,3) - m(4,4)

ShhShv* = complex( m(1,3) + m(2,3), -m(1,4) - m(2, 4) )

ShhSvv* = complex( m(3,3) - m(4,4), -2m(3,4) )

ShvSvv* = complex( m(1,3) - m(2,3), -m(1,4) + m(2,4) )

For SLC data, the Stokes matrix will not be symmetrized. The unsymmetrized Stokes Matrix is given by:

m(1,1) = (ShhShh* + ShvShv* + SvhSvh* + SvvSvv*) / 4.0

m(1,2) = (ShhShh* - ShvShv* + SvhSvh* - SvvSvv*) / 4.0

m(1,3) = (Re(ShhShv*) + Re(SvhSvv*) ) / 2.0

m(1,4) = (-Im(ShhShv*) - Im(SvhSvv*) ) / 2.0

m(2,1) = (ShhShh* + ShvShv* - SvhSvh* - SvvSvv*) / 4.0

m(2,2) = (ShhShh* + SvvSvv* - ShvShv* - SvhSvh*) / 4.0

m(2,3) = ( Re(ShhShv*) - Re(SvhSvv*) ) / 2.0

m(2,4) = (-Im(ShhShv*) + Im(SvhSvv*) )/ 2.0

m(3,1) = (Re(ShhSvh*) + Re(ShvSvv*) ) / 2.0

m(3,2) = ( Re(ShhSvh*) - Re(ShvSvv*) ) / 2.0

m(3,3) = (ShvShv* + Re(ShhSvv*) / 2.0

m(3,4) = (-Im(ShhSvv*+Im(ShvSvh*) / 2.0

m(4,1) = (-Im(ShhSvh*) - Im(ShvSvv*) ) / 2.0

m(4,2) = (-Im(ShhSvh*) + Im(ShvSvv*) )/ 2.0

m(4,3) = (-Im(ShhSvv* - Im(ShvSvh*) / 2.0

m(4,4) = (Re(ShvSvh*) - Re(ShhSvv*) )/ 2.0

Appendix D: Compiling and linking

In order to use the software described in this manual, each program has to be compiled and linked on the computer that it will be executed on. If this software is copied and modified for more in-depth data analysis, that software will also have to be compiled and linked. A description of how to compile and link this software package follows.

Each file must first be compiled. Each of these FORTRAN files is believed to be standard FORTRAN 77, and should compile flawlessly on any computer. However, this is not guaranteed, as compilers are frequently not standard FORTRAN77. If it does not compile successfully, examine the error that is generated, and the FORTRAN manual for this computer.

On most unix computers, the FORTRAN compiler is called 'f77'. On some other computers (i.e. VAX computers) it is called 'fortran'. No options should be necessary to compile the software described here, other than the file names that follow these commands.

To link the main programs and generate the executable file, on unix computers the 'f77' command performs this function also. On some computers such as VAX computers, the command is 'link'.

A subroutine on a unix computer may be compiled by the following command:

> f77 -c -o subr.o subr.f

The main program may be compiled in a similar way:

>f77 -c -o main.o main.f

A main program may be linked by the following command, in which the main program depends on subroutine subr.f:

>f77 -o main main.o subr.o

where main will be the name of the executable program.

On a VAX/VMS computer, a subroutine may be compiled by the following command :

> fortran subr.f

The main program may be compiled in a similar way:

>fortran main.f

A main program may be linked by the following command, in which the main program depends on subroutine subr.f :

> link main,subr

The following table indicates which subroutine files each main program requires.

mlc mld slc slc_cross byte_image multilook

fastmlc_setup fastmld_setup fastslc_setup fastslc_setup fastmlc_setup fastmlc_setup

fastmlc_d fastmld_d fastslc_d fastslc_cross fastslc_setup fastslc_setup

recmpmlc recmpmld recmpslc recmpslc readit_CEOS readit_CEOS

readit_CEOS readit_CEOS readit_CEOS readit_CEOS writeit_CEOS writeit_CEOS

writeit_CEOS writeit_CEOS writeit_CEOS writeit_CEOS stokes_mlc fastslc_d

fastslc_d synth fastmlc_d

fastslc_d fastslc_cross

fastslc_cross fastmld_d

fastmlc_d recmpmld

fastmld_d recmpmlc

fastcm_setup fastcm_setup

fastscat_setup fastscat_setup

fastcm_d fastcm_d

fastscat_d fastscat_d

airsar_hdr airsar_hdr

stokes_slc

unstokes

airsar_scat2slc create_in info create_in_airsar

fastslc_setup readascii_img readascii_ldr no subroutines required

fastscat_setup

recmpslc

airsar_hdr

writeit_CEOS

readit_CEOS

References

[1] Dubois, P, Norikane, L., vanZyl, J., and Zebker, H., "Data volume reduction for Imaging Radar Polarimetry", 1989 IEEE Antenna Propogation Symposium, San Jose, IEEE Catalog No. CH-2654-2/89

[2] VanZyl, J., and Burnette, C., "Data volume reduction for single look polarimetric imaging radar data", IEEE Transactions Geoscience and Remote Sensing, 1990.

[3] Barrett, P., "CEOS data file definitions as adapted for SIR-C", JPL document #D-10870

[4] vanZyl, J., Zebker, H., and Elachi, C., "Imaging radar polarization signatures: theory and observation", Radio Science, 22, July-August 1987, page 529-543.

Appendix E: Software code

Make files and com files in alphabetical order...

Main programs in alphabetical order...

Subroutines in alphabetical order...

Common block