pyroSAR/gamma/srtm.py
def hgt(parfiles):
    """
    concatenate hgt file names overlapping with multiple SAR scenes
    input is a list of GAMMA SAR scene parameter files
    this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed
    hgt files are supplied in 1 degree equiangular format named e.g. N16W094.hgt (with pattern [NS][0-9]{2}[EW][0-9]{3}.hgt
    For north and east hemisphere the respective absolute latitude and longitude values are smaller than the lower left coordinate of the SAR image
    west and south coordinates are negative and hence the nearest lower left integer absolute value is going to be larger
    """

    lat = []
    lon = []
    for parfile in parfiles:
        if isinstance(parfile, pyroSAR.ID):
            corners = parfile.getCorners()
        elif parfile.endswith('.par'):
            corners = slc_corners(parfile)
        lat += [int(float(corners[x]) // 1) for x in ['ymin', 'ymax']]
        lon += [int(float(corners[x]) // 1) for x in ['xmin', 'xmax']]

    # add missing lat/lon values (and add an extra buffer of one degree)
    lat = range(min(lat), max(lat)+1)
    lon = range(min(lon), max(lon)+1)

    # convert coordinates to string with leading zeros and hemisphere identification letter
    lat = [str(x).zfill(2+len(str(x))-len(str(x).strip('-'))) for x in lat]
    lat = [x.replace('-', 'S') if '-' in x else 'N'+x for x in lat]

    lon = [str(x).zfill(3+len(str(x))-len(str(x).strip('-'))) for x in lon]
    lon = [x.replace('-', 'W') if '-' in x else 'E'+x for x in lon]

    # concatenate all formatted latitudes and longitudes with each other as final product
    return [x+y+'.hgt' for x in lat for y in lon]

    concatenate hgt file names overlapping with multiple SAR scenes
    input is a list of GAMMA SAR scene parameter files
    this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed
    hgt files are supplied in 1 degree equiangular format named e.g. N16W094.hgt (with pattern [NS][0-9]{2}[EW][0-9]{3}.hgt
    For north and east hemisphere the respective absolute latitude and longitude values are smaller than the lower left coordinate of the SAR image
    west and south coordinates are negative and hence the nearest lower left integer absolute value is going to be larger
    
concatenate hgt file names overlapping with multiple SAR scenes
input is a list of GAMMA SAR scene parameter files
this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed
hgt files are supplied in 1 degree equiangular format named e.g. N16W094.hgt (with pattern [NS][0-9]{2}[EW][0-9]{3}.hgt
For north and east hemisphere the respective absolute latitude and longitude values are smaller than the lower left coordinate of the SAR image
west and south coordinates are negative and hence the nearest lower left integer absolute value is going to be larger
concatenate hgt file names overlapping with multiple SAR scenes input is a list of GAMMA SAR scene parameter files this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed hgt files are supplied in 1 degree equiangular format named e . g . N16W094 . hgt ( with pattern [ NS ] [ 0 - 9 ] { 2 } [ EW ] [ 0 - 9 ] { 3 } . hgt For north and east hemisphere the respective absolute latitude and longitude values are smaller than the lower left coordinate of the SAR image west and south coordinates are negative and hence the nearest lower left integer absolute value is going to be larger
def hgt(parfiles):
    lat = []
    lon = []
    for parfile in parfiles:
        if isinstance(parfile, pyroSAR.ID):
            corners = parfile.getCorners()
        elif parfile.endswith('.par'):
            corners = slc_corners(parfile)
        lat += [int(float(corners[x]) // 1) for x in ['ymin', 'ymax']]
        lon += [int(float(corners[x]) // 1) for x in ['xmin', 'xmax']]
    lat = range(min(lat), max(lat)+1)
    lon = range(min(lon), max(lon)+1)
    lat = [str(x).zfill(2+len(str(x))-len(str(x).strip('-'))) for x in lat]
    lat = [x.replace('-', 'S') if '-' in x else 'N'+x for x in lat]
    lon = [str(x).zfill(3+len(str(x))-len(str(x).strip('-'))) for x in lon]
    lon = [x.replace('-', 'W') if '-' in x else 'E'+x for x in lon]
    return [x+y+'.hgt' for x in lat for y in lon]
def hgt ( parfiles ) : lat = [ ] lon = [ ] for parfile in parfiles : if isinstance ( parfile , pyroSAR . ID ) : corners = parfile . getCorners ( ) elif parfile . endswith ( '.par' ) : corners = slc_corners ( parfile ) lat += [ int ( float ( corners [ x ] ) // 1 ) for x in [ 'ymin' , 'ymax' ] ] lon += [ int ( float ( corners [ x ] ) // 1 ) for x in [ 'xmin' , 'xmax' ] ] lat = range ( min ( lat ) , max ( lat ) + 1 ) lon = range ( min ( lon ) , max ( lon ) + 1 ) lat = [ str ( x ) . zfill ( 2 + len ( str ( x ) ) - len ( str ( x ) . strip ( '-' ) ) ) for x in lat ] lat = [ x . replace ( '-' , 'S' ) if '-' in x else 'N' + x for x in lat ] lon = [ str ( x ) . zfill ( 3 + len ( str ( x ) ) - len ( str ( x ) . strip ( '-' ) ) ) for x in lon ] lon = [ x . replace ( '-' , 'W' ) if '-' in x else 'E' + x for x in lon ] return [ x + y + '.hgt' for x in lat for y in lon ]
concatenate hgt file names overlapping with multiple SAR scenes
input is a list of GAMMA SAR scene parameter files
this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed
hgt files are supplied in 1 degree equiangular format named e.g.
concatenate hgt file names overlapping with multiple SAR scenes input is a list of GAMMA SAR scene parameter files this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed hgt files are supplied in 1 degree equiangular format named e . g .
"""
    concatenate hgt file names overlapping with multiple SAR scenes
    input is a list of GAMMA SAR scene parameter files
    this list is read for corner coordinates of which the next integer lower left latitude and longitude is computed
    hgt files are supplied in 1 degree equiangular format named e.g. N16W094.hgt (with pattern [NS][0-9]{2}[EW][0-9]{3}.hgt
    For north and east hemisphere the respective absolute latitude and longitude values are smaller than the lower left coordinate of the SAR image
    west and south coordinates are negative and hence the nearest lower left integer absolute value is going to be larger
    """ # add missing lat/lon values (and add an extra buffer of one degree) # convert coordinates to string with leading zeros and hemisphere identification letter # concatenate all formatted latitudes and longitudes with each other as final product
parfiles