Go to the USGS Home Page

USGS MIPS Swap Documentation






This program corrects image  data which is byte swapped. Some computers use different byte ordering than others. When images are transferred from one computer to another with different byte ordering, the DNs  in the image will not be correct. SWAP can be used to correct this problem. Byte ordering problems typically occur in 16-bit images; however, they can occur in 8-bit images and are generally difficult to detect. An 8-bit byte image can be examined around lines/edges and if they appear jagged it may be byte swapped. A 16-bit image which is byte swapped will look unrecognizable. The following are types of computers and their byte ordering:

Least Significant      Most Signigicant
   Byte (LSB)             Byte (MSB)

  DEC Computers          Sun Computers
  DG Computers
If data is moved from an LSB machine to an MSB machine and vice versa, byte ordering problems may be experienced.

  

Files

This program requires as input one unsigned 8-bit , or one signed 16-bit  or one 32-bit  floating point image and will produce the same type of file as was input. The following information is transferred from the input file to the output file(if appropriate):

Image labels 
Mosaic labels
Projection labels
Sonar labels
Navigation file
History file
  

Parameters

NBYTES

This parameter is used to specify the number of bytes to swap, either 2 or 4. The default is 2 which can be used to swap bytes in signed word images while 4 can be used to swap bytes in floating point images.

Examples

From left to right, Landsat MSS band 6 image with swapped bytes and corrected image.

[Example Image] [Example Image]
U.S. Department of the Interior | U.S. Geological Survey | Jobs
Home | Search | Disclaimers & Privacy Web Rings
Send comments to webman@TerraWeb.wr.usgs.gov
URL:
Last Modified: Thu Oct 31 15:08:22 MST 2002
FirstGov: Your First Click to the U.S. Gov ernment