pyroSAR/gamma/util.py
def S1_deburst(burst1, burst2, burst3, name_out, rlks=5, azlks=1, replace=False, path_log=None):
    """
    Debursting of Sentinel-1 SLC imagery in GAMMA.
    The procedure consists of two steps. First antenna pattern deramping and
    then mosaicing of the single deramped bursts.
    For mosaicing, the burst boundaries are calculated from the number of looks in range (`rlks`)
    and azimuth (`azlks`), in this case 5 range looks and 1 azimuth looks.
    Alternately 10 range looks and 2 azimuth looks could be used.
    
    Parameters
    ----------
    burst1: str
        burst image 1
    burst2: str
        burst image 2
    burst3: str
        burst image 3
    name_out: str
        the name of the output file
    rlks: int
        the number of looks in range
    azlks: int
        the number of looks in azimuth
    replace: bool
        replace the burst images by the new file? If True, the three burst images will be deleted.
    path_log: str
        the directory to write the logfiles to

    Returns
    -------
    
    """
    for burst in [burst1, burst2, burst3]:
        if not os.path.isfile(burst) or not os.path.isfile(burst + '.par') or not os.path.isfile(burst + '.tops_par'):
            raise IOError('input files missing; parameter files must be named e.g. {burst1}.par and {burst1}.tops_par')
    outpath = os.path.dirname(name_out)
    if not os.path.isdir(outpath):
        os.makedirs(outpath)
    tab_in = os.path.join(outpath, 'tab_deramp1')
    tab_out = os.path.join(outpath, 'tab_deramp2')
    with open(tab_in, 'w') as out1:
        with open(tab_out, 'w') as out2:
            for item in [burst1, burst2, burst3]:
                out1.write(item + '\t' + item + '.par\t' + item + '.tops_par\n')
                out2.write(item + '_drp\t' + item + '_drp.par\t' + item + '_drp.tops_par\n')
    process(['SLC_deramp_S1_TOPS', tab_in, tab_out, 0, 0], logpath=path_log)
    process(['SLC_mosaic_S1_TOPS', tab_out, name_out, name_out + '.par', rlks, azlks], logpath=path_log)
    
    if replace:
        for item in [burst1, burst2, burst3]:
            for subitem in [item + x for x in ['', '.par', '.tops_par']]:
                os.remove(subitem)
    for item in [burst1, burst2, burst3]:
        for subitem in [item + x for x in ['_drp', '_drp.par', '_drp.tops_par']]:
            os.remove(subitem)
    os.remove(tab_in)
    os.remove(tab_out)

    Debursting of Sentinel-1 SLC imagery in GAMMA.
    The procedure consists of two steps. First antenna pattern deramping and
    then mosaicing of the single deramped bursts.
    For mosaicing, the burst boundaries are calculated from the number of looks in range (`rlks`)
    and azimuth (`azlks`), in this case 5 range looks and 1 azimuth looks.
    Alternately 10 range looks and 2 azimuth looks could be used.
    
    Parameters
    ----------
    burst1: str
        burst image 1
    burst2: str
        burst image 2
    burst3: str
        burst image 3
    name_out: str
        the name of the output file
    rlks: int
        the number of looks in range
    azlks: int
        the number of looks in azimuth
    replace: bool
        replace the burst images by the new file? If True, the three burst images will be deleted.
    path_log: str
        the directory to write the logfiles to

    Returns
    -------
    
    
Debursting of Sentinel-1 SLC imagery in GAMMA.
The procedure consists of two steps. First antenna pattern deramping and
then mosaicing of the single deramped bursts.
For mosaicing, the burst boundaries are calculated from the number of looks in range (`rlks`)
and azimuth (`azlks`), in this case 5 range looks and 1 azimuth looks.
Alternately 10 range looks and 2 azimuth looks could be used.

Parameters



Returns
Debursting of Sentinel - 1 SLC imagery in GAMMA . The procedure consists of two steps . First antenna pattern deramping and then mosaicing of the single deramped bursts . For mosaicing the burst boundaries are calculated from the number of looks in range ( ` rlks ` ) and azimuth ( ` azlks ` ) in this case 5 range looks and 1 azimuth looks . Alternately 10 range looks and 2 azimuth looks could be used . Parameters Returns
def S1_deburst(burst1, burst2, burst3, name_out, rlks=5, azlks=1, replace=False, path_log=None):
    for burst in [burst1, burst2, burst3]:
        if not os.path.isfile(burst) or not os.path.isfile(burst + '.par') or not os.path.isfile(burst + '.tops_par'):
            raise IOError('input files missing; parameter files must be named e.g. {burst1}.par and {burst1}.tops_par')
    outpath = os.path.dirname(name_out)
    if not os.path.isdir(outpath):
        os.makedirs(outpath)
    tab_in = os.path.join(outpath, 'tab_deramp1')
    tab_out = os.path.join(outpath, 'tab_deramp2')
    with open(tab_in, 'w') as out1:
        with open(tab_out, 'w') as out2:
            for item in [burst1, burst2, burst3]:
                out1.write(item + '\t' + item + '.par\t' + item + '.tops_par\n')
                out2.write(item + '_drp\t' + item + '_drp.par\t' + item + '_drp.tops_par\n')
    process(['SLC_deramp_S1_TOPS', tab_in, tab_out, 0, 0], logpath=path_log)
    process(['SLC_mosaic_S1_TOPS', tab_out, name_out, name_out + '.par', rlks, azlks], logpath=path_log)
    if replace:
        for item in [burst1, burst2, burst3]:
            for subitem in [item + x for x in ['', '.par', '.tops_par']]:
                os.remove(subitem)
    for item in [burst1, burst2, burst3]:
        for subitem in [item + x for x in ['_drp', '_drp.par', '_drp.tops_par']]:
            os.remove(subitem)
    os.remove(tab_in)
    os.remove(tab_out)
def S1_deburst ( burst1 , burst2 , burst3 , name_out , rlks = 5 , azlks = 1 , replace = False , path_log = None ) : for burst in [ burst1 , burst2 , burst3 ] : if not os . path . isfile ( burst ) or not os . path . isfile ( burst + '.par' ) or not os . path . isfile ( burst + '.tops_par' ) : raise IOError ( 'input files missing; parameter files must be named e.g. {burst1}.par and {burst1}.tops_par' ) outpath = os . path . dirname ( name_out ) if not os . path . isdir ( outpath ) : os . makedirs ( outpath ) tab_in = os . path . join ( outpath , 'tab_deramp1' ) tab_out = os . path . join ( outpath , 'tab_deramp2' ) with open ( tab_in , 'w' ) as out1 : with open ( tab_out , 'w' ) as out2 : for item in [ burst1 , burst2 , burst3 ] : out1 . write ( item + '\t' + item + '.par\t' + item + '.tops_par\n' ) out2 . write ( item + '_drp\t' + item + '_drp.par\t' + item + '_drp.tops_par\n' ) process ( [ 'SLC_deramp_S1_TOPS' , tab_in , tab_out , 0 , 0 ] , logpath = path_log ) process ( [ 'SLC_mosaic_S1_TOPS' , tab_out , name_out , name_out + '.par' , rlks , azlks ] , logpath = path_log ) if replace : for item in [ burst1 , burst2 , burst3 ] : for subitem in [ item + x for x in [ '' , '.par' , '.tops_par' ] ] : os . remove ( subitem ) for item in [ burst1 , burst2 , burst3 ] : for subitem in [ item + x for x in [ '_drp' , '_drp.par' , '_drp.tops_par' ] ] : os . remove ( subitem ) os . remove ( tab_in ) os . remove ( tab_out )
Debursting of Sentinel-1 SLC imagery in GAMMA.
Debursting of Sentinel - 1 SLC imagery in GAMMA .
"""
    Debursting of Sentinel-1 SLC imagery in GAMMA.
    The procedure consists of two steps. First antenna pattern deramping and
    then mosaicing of the single deramped bursts.
    For mosaicing, the burst boundaries are calculated from the number of looks in range (`rlks`)
    and azimuth (`azlks`), in this case 5 range looks and 1 azimuth looks.
    Alternately 10 range looks and 2 azimuth looks could be used.
    
    Parameters
    ----------
    burst1: str
        burst image 1
    burst2: str
        burst image 2
    burst3: str
        burst image 3
    name_out: str
        the name of the output file
    rlks: int
        the number of looks in range
    azlks: int
        the number of looks in azimuth
    replace: bool
        replace the burst images by the new file? If True, the three burst images will be deleted.
    path_log: str
        the directory to write the logfiles to

    Returns
    -------
    
    """
burst1
burst2
burst3
name_out
rlks
azlks
replace
path_log