pyroSAR/gamma/util.py
def ovs(parfile, targetres):
    """
    compute DEM oversampling factors for a target resolution in meters

    Parameters
    ----------
    parfile: str
        a GAMMA DEM parameter file
    targetres: int or float
        the target resolution in meters
    
    Returns
    -------
    tuple of float
        the oversampling factors for latitude and longitude
    """
    # read DEM parameter file
    dempar = ISPPar(parfile)
    
    # extract coordinates and pixel posting of the DEM
    if hasattr(dempar, 'post_north'):
        post_north, post_east = [abs(float(x)) for x in
                                 [dempar.post_north, dempar.post_east]]
    else:
        res_lat, res_lon = [abs(float(x)) for x in [dempar.post_lat, dempar.post_lon]]
        
        # compute center coordinate
        lat = float(dempar.corner_lat) - (res_lat * (dempar.nlines // 2))
        lon = float(dempar.corner_lon) + (res_lon * (dempar.width // 2))
        
        # convert DEM resolution to meters
        post_north = haversine(lat, lon, lat + res_lat, lon)
        post_east = haversine(lat, lon, lat, lon + res_lon)
    
    # compute resampling factors for the DEM
    ovs_lat = post_north / targetres
    ovs_lon = post_east / targetres
    return ovs_lat, ovs_lon

    compute DEM oversampling factors for a target resolution in meters

    Parameters
    ----------
    parfile: str
        a GAMMA DEM parameter file
    targetres: int or float
        the target resolution in meters
    
    Returns
    -------
    tuple of float
        the oversampling factors for latitude and longitude
    
compute DEM oversampling factors for a target resolution in meters
Parameters

str
a GAMMA DEM parameter file
targetres: int or float
the target resolution in meters

Returns

tuple of float
the oversampling factors for latitude and longitude
compute DEM oversampling factors for a target resolution in meters Parameters str a GAMMA DEM parameter file targetres : int or float the target resolution in meters Returns tuple of float the oversampling factors for latitude and longitude
def ovs(parfile, targetres):
    dempar = ISPPar(parfile)
    if hasattr(dempar, 'post_north'):
        post_north, post_east = [abs(float(x)) for x in
                                 [dempar.post_north, dempar.post_east]]
    else:
        res_lat, res_lon = [abs(float(x)) for x in [dempar.post_lat, dempar.post_lon]]
        lat = float(dempar.corner_lat) - (res_lat * (dempar.nlines // 2))
        lon = float(dempar.corner_lon) + (res_lon * (dempar.width // 2))
        post_north = haversine(lat, lon, lat + res_lat, lon)
        post_east = haversine(lat, lon, lat, lon + res_lon)
    ovs_lat = post_north / targetres
    ovs_lon = post_east / targetres
    return ovs_lat, ovs_lon
def ovs ( parfile , targetres ) : dempar = ISPPar ( parfile ) if hasattr ( dempar , 'post_north' ) : post_north , post_east = [ abs ( float ( x ) ) for x in [ dempar . post_north , dempar . post_east ] ] else : res_lat , res_lon = [ abs ( float ( x ) ) for x in [ dempar . post_lat , dempar . post_lon ] ] lat = float ( dempar . corner_lat ) - ( res_lat * ( dempar . nlines // 2 ) ) lon = float ( dempar . corner_lon ) + ( res_lon * ( dempar . width // 2 ) ) post_north = haversine ( lat , lon , lat + res_lat , lon ) post_east = haversine ( lat , lon , lat , lon + res_lon ) ovs_lat = post_north / targetres ovs_lon = post_east / targetres return ovs_lat , ovs_lon
compute DEM oversampling factors for a target resolution in meters
Parameters
compute DEM oversampling factors for a target resolution in meters Parameters
"""
    compute DEM oversampling factors for a target resolution in meters

    Parameters
    ----------
    parfile: str
        a GAMMA DEM parameter file
    targetres: int or float
        the target resolution in meters
    
    Returns
    -------
    tuple of float
        the oversampling factors for latitude and longitude
    """ # read DEM parameter file # extract coordinates and pixel posting of the DEM # compute center coordinate # convert DEM resolution to meters # compute resampling factors for the DEM
parfile
targetres