pyroSAR/gamma/srtm.py
def dempar(dem, logpath=None):
    """
    create GAMMA parameter text files for DEM files
    currently only EQA and UTM projections with WGS84 ellipsoid are supported
    """
    rast = raster.Raster(dem)

    # determine data type
    dtypes = {'Int16': 'INTEGER*2', 'UInt16': 'INTEGER*2', 'Float32': 'REAL*4'}
    if rast.dtype not in dtypes:
        raise IOError('data type not supported')
    else:
        dtype = dtypes[rast.dtype]

    # format pixel posting and top left coordinate
    posting = str(rast.geo['yres'])+' '+str(rast.geo['xres'])
    latlon = str(rast.geo['ymax'])+' '+str(rast.geo['xmin'])

    # evaluate projection
    projections = {'longlat': 'EQA', 'utm': 'UTM'}
    if rast.proj4args['proj'] not in projections:
        raise ValueError('projection not supported (yet)')
    else:
        projection = projections[rast.proj4args['proj']]

    # get ellipsoid
    ellipsoid = rast.proj4args['ellps'] if 'ellps' in rast.proj4args else rast.proj4args['datum']
    if ellipsoid != 'WGS84':
        raise ValueError('ellipsoid not supported (yet)')

    # create list for GAMMA command input
    if projection == 'UTM':
        zone = rast.proj4args['zone']
        falsenorthing = 10000000. if rast.geo['ymin'] < 0 else 0
        parlist = [projection, ellipsoid, 1, zone, falsenorthing, os.path.basename(dem), dtype, 0, 1, rast.cols, rast.rows, posting, latlon]
    else:
        parlist = [projection, ellipsoid, 1, os.path.basename(dem), dtype, 0, 1, rast.cols, rast.rows, posting, latlon]

    # execute GAMMA command
    process(['create_dem_par', os.path.splitext(dem)[0] + '.par'], os.path.dirname(dem), logpath, inlist=parlist)

    create GAMMA parameter text files for DEM files
    currently only EQA and UTM projections with WGS84 ellipsoid are supported
    
create GAMMA parameter text files for DEM files
currently only EQA and UTM projections with WGS84 ellipsoid are supported
create GAMMA parameter text files for DEM files currently only EQA and UTM projections with WGS84 ellipsoid are supported
def dempar(dem, logpath=None):
    rast = raster.Raster(dem)
    dtypes = {'Int16': 'INTEGER*2', 'UInt16': 'INTEGER*2', 'Float32': 'REAL*4'}
    if rast.dtype not in dtypes:
        raise IOError('data type not supported')
    else:
        dtype = dtypes[rast.dtype]
    posting = str(rast.geo['yres'])+' '+str(rast.geo['xres'])
    latlon = str(rast.geo['ymax'])+' '+str(rast.geo['xmin'])
    projections = {'longlat': 'EQA', 'utm': 'UTM'}
    if rast.proj4args['proj'] not in projections:
        raise ValueError('projection not supported (yet)')
    else:
        projection = projections[rast.proj4args['proj']]
    ellipsoid = rast.proj4args['ellps'] if 'ellps' in rast.proj4args else rast.proj4args['datum']
    if ellipsoid != 'WGS84':
        raise ValueError('ellipsoid not supported (yet)')
    if projection == 'UTM':
        zone = rast.proj4args['zone']
        falsenorthing = 10000000. if rast.geo['ymin'] < 0 else 0
        parlist = [projection, ellipsoid, 1, zone, falsenorthing, os.path.basename(dem), dtype, 0, 1, rast.cols, rast.rows, posting, latlon]
    else:
        parlist = [projection, ellipsoid, 1, os.path.basename(dem), dtype, 0, 1, rast.cols, rast.rows, posting, latlon]
    process(['create_dem_par', os.path.splitext(dem)[0] + '.par'], os.path.dirname(dem), logpath, inlist=parlist)
def dempar ( dem , logpath = None ) : rast = raster . Raster ( dem ) dtypes = { 'Int16' : 'INTEGER*2' , 'UInt16' : 'INTEGER*2' , 'Float32' : 'REAL*4' } if rast . dtype not in dtypes : raise IOError ( 'data type not supported' ) else : dtype = dtypes [ rast . dtype ] posting = str ( rast . geo [ 'yres' ] ) + ' ' + str ( rast . geo [ 'xres' ] ) latlon = str ( rast . geo [ 'ymax' ] ) + ' ' + str ( rast . geo [ 'xmin' ] ) projections = { 'longlat' : 'EQA' , 'utm' : 'UTM' } if rast . proj4args [ 'proj' ] not in projections : raise ValueError ( 'projection not supported (yet)' ) else : projection = projections [ rast . proj4args [ 'proj' ] ] ellipsoid = rast . proj4args [ 'ellps' ] if 'ellps' in rast . proj4args else rast . proj4args [ 'datum' ] if ellipsoid != 'WGS84' : raise ValueError ( 'ellipsoid not supported (yet)' ) if projection == 'UTM' : zone = rast . proj4args [ 'zone' ] falsenorthing = 10000000. if rast . geo [ 'ymin' ] < 0 else 0 parlist = [ projection , ellipsoid , 1 , zone , falsenorthing , os . path . basename ( dem ) , dtype , 0 , 1 , rast . cols , rast . rows , posting , latlon ] else : parlist = [ projection , ellipsoid , 1 , os . path . basename ( dem ) , dtype , 0 , 1 , rast . cols , rast . rows , posting , latlon ] process ( [ 'create_dem_par' , os . path . splitext ( dem ) [ 0 ] + '.par' ] , os . path . dirname ( dem ) , logpath , inlist = parlist )
create GAMMA parameter text files for DEM files
currently only EQA and UTM projections with WGS84 ellipsoid are supported
create GAMMA parameter text files for DEM files currently only EQA and UTM projections with WGS84 ellipsoid are supported
"""
    create GAMMA parameter text files for DEM files
    currently only EQA and UTM projections with WGS84 ellipsoid are supported
    """ # determine data type # format pixel posting and top left coordinate # evaluate projection # get ellipsoid # create list for GAMMA command input # execute GAMMA command
dem
logpath