pyroSAR/gamma/srtm.py
def swap(data, outname):
    """
    byte swapping from small to big endian (as required by GAMMA)
    """
    rast = raster.Raster(data)
    dtype = rast.dtype
    if rast.format != 'ENVI':
        raise IOError('only ENVI format supported')
    dtype_lookup = {'Int16': 2, 'CInt16': 2, 'Int32': 4, 'Float32': 4, 'CFloat32': 4, 'Float64': 8}
    if dtype not in dtype_lookup:
        raise IOError('data type {} not supported'.format(dtype))
    process(['swap_bytes', data, outname, str(dtype_lookup[dtype])])
    header = HDRobject(data+'.hdr')
    header.byte_order = 1
    hdr(header, outname+'.hdr')

    byte swapping from small to big endian (as required by GAMMA)
    
byte swapping from small to big endian (as required by GAMMA)
byte swapping from small to big endian ( as required by GAMMA )
def swap(data, outname):
    rast = raster.Raster(data)
    dtype = rast.dtype
    if rast.format != 'ENVI':
        raise IOError('only ENVI format supported')
    dtype_lookup = {'Int16': 2, 'CInt16': 2, 'Int32': 4, 'Float32': 4, 'CFloat32': 4, 'Float64': 8}
    if dtype not in dtype_lookup:
        raise IOError('data type {} not supported'.format(dtype))
    process(['swap_bytes', data, outname, str(dtype_lookup[dtype])])
    header = HDRobject(data+'.hdr')
    header.byte_order = 1
    hdr(header, outname+'.hdr')
def swap ( data , outname ) : rast = raster . Raster ( data ) dtype = rast . dtype if rast . format != 'ENVI' : raise IOError ( 'only ENVI format supported' ) dtype_lookup = { 'Int16' : 2 , 'CInt16' : 2 , 'Int32' : 4 , 'Float32' : 4 , 'CFloat32' : 4 , 'Float64' : 8 } if dtype not in dtype_lookup : raise IOError ( 'data type {} not supported' . format ( dtype ) ) process ( [ 'swap_bytes' , data , outname , str ( dtype_lookup [ dtype ] ) ] ) header = HDRobject ( data + '.hdr' ) header . byte_order = 1 hdr ( header , outname + '.hdr' )
byte swapping from small to big endian (as required by GAMMA)
byte swapping from small to big endian ( as required by GAMMA )
"""
    byte swapping from small to big endian (as required by GAMMA)
    """
data
outname