Summary
Creates a raster object by unpacking the bits of the input pixel and mapping them to specified bits in the output pixel. The purpose of this function is to manipulate bits from a couple of inputs, such as the Landsat 8 quality band products.
Discussion
For more information about how this function works, see the Transpose Bits raster function.
The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.
Syntax
TransposeBits (raster, {input_bit_positions}, {output_bit_positions}, {constant_fill_value}, {fill_raster})
Parameter | Explanation | Data Type |
raster | The input raster to unpack and remap. | Raster |
input_bit_positions [input_bit_positions,...] | The list of input bits. (The default value is [12, 13]) | Integer |
output_bit_positions [output_bit_positions,...] | The list of output bits. (The default value is [0, 1]) | Integer |
constant_fill_value | An integer used to fill in all bits that are not involved in the transpose. (The default value is 0) | Integer |
fill_raster | A raster used to fill in all bits that are not involved in the transpose. (The default value is None) | Raster |
Data Type | Explanation |
Raster | The output raster. |
Code sample
Remaps the bits from the input raster to the Landsat 8 Water bit pattern.
import acrpy
transpose_raster = arcpy.ia.TransposeBits("Landsat_8.tif",[4, 5],[0, 1], 0, None)