Exemplo n.º 1
0
def main(argv):

    start_time = time.time()
    inps = cmdLineParse()
    Mdate = inps.Mdate
    Sdate = inps.Sdate

    projectName = inps.projectName
    scratchDir = os.getenv('SCRATCHDIR')
    templateDir = os.getenv('TEMPLATEDIR')
    templateFile = templateDir + "/" + projectName + ".template"
    templateDict = ut.update_template(templateFile)
    rlks = templateDict['range_looks']
    azlks = templateDict['azimuth_looks']
    masterDate = templateDict['masterDate']
    downDir = scratchDir + '/' + projectName + '/DOWNLOAD'
    M_raw = glob.glob(downDir + '/S1*_' + ut.yyyymmdd(Mdate) + '*')[0]
    S_raw = glob.glob(downDir + '/S1*_' + ut.yyyymmdd(Sdate) + '*')[0]
    slcDir = scratchDir + '/' + projectName + '/SLC'

    ######### down 2 slc #############
    call_str = 'down2slc_sen.py ' + M_raw + ' ' + slcDir
    os.system(call_str)

    call_str = 'down2slc_sen.py ' + S_raw + ' ' + slcDir
    os.system(call_str)

    ########## extract common bursts ##
    #call_str = 'extract_s1_bursts.py ' + projectName + ' ' + Mdate
    #os.system(call_str)

    #call_str = 'extract_s1_bursts.py ' + projectName + ' ' + Sdate
    #os.system(call_str)

    ######### generate rdc_dem ##########
    call_str = 'generate_rdc_dem.py ' + projectName
    os.system(call_str)

    ########## coregister SLC ########

    call_str = 'coreg_s1_gamma.py ' + projectName + ' ' + Mdate
    os.system(call_str)

    call_str = 'coreg_s1_gamma.py ' + projectName + ' ' + Sdate
    os.system(call_str)

    ######## Interferometry process ###########
    call_str = 'diff_gamma.py ' + projectName + ' ' + Mdate + ' ' + Sdate
    os.system(call_str)

    call_str = 'unwrap_gamma.py ' + projectName + ' ' + Mdate + ' ' + Sdate
    os.system(call_str)

    call_str = 'geocode_gamma.py ' + projectName + ' ' + Mdate + '-' + Sdate
    os.system(call_str)

    print("Generate Ifg from raw-TOPs data is done! ")
    ut.print_process_time(start_time, time.time())
    sys.exit(1)
Exemplo n.º 2
0
def main(argv):
    
    inps = cmdLineParse()
    Mdate = inps.Mdate
    Sdate = inps.Sdate
    
    projectName = inps.projectName
    
    if 'S1' in projectName:
        call_str = 'raw2ifg_s1.py ' + projectName + ' ' + ut.yyyymmdd(Mdate) + ' ' + ut.yyyymmdd(Sdate)
        os.system(call_str)
        
    sys.exit(1)
Exemplo n.º 3
0
def main(argv):
    start_time = time.time()
    inps = cmdLineParse()
    projectName = inps.projectName
    scratchDir = os.getenv('SCRATCHDIR')
    templateDir = os.getenv('TEMPLATEDIR')
    templateFile = templateDir + "/" + projectName + ".template"
    projectDir = scratchDir + '/' + projectName
    ifgDir = scratchDir + '/' + projectName + '/ifgrams'
    templateDict = ut.update_template(templateFile)
    rlks = templateDict['range_looks']
    azlks = templateDict['azimuth_looks']

    if inps.ifgarmListTxt: ifgramList_txt = inps.ifgarmListTxt
    else: ifgramList_txt = scratchDir + '/' + projectName + '/ifgram_list.txt'
    ifgList0 = ut.read_txt2array(ifgramList_txt)
    ifgList = ifgList0[:, 0]

    err_txt = scratchDir + '/' + projectName + '/diff_gamma_all.err'
    if os.path.isfile(err_txt): os.remove(err_txt)

    data_para = []
    for i in range(len(ifgList)):
        m0 = ut.yyyymmdd(ifgList[i].split('-')[0])
        s0 = ut.yyyymmdd(ifgList[i].split('-')[1])
        cmd0 = ['diff_gamma.py', projectName, m0, s0]
        diff_file0 = ifgDir + '/' + ifgList[i] + '/' + ifgList[
            i] + '_' + rlks + 'rlks.diff_filt.bmp'
        data0 = [cmd0, err_txt]

        k00 = 0
        if os.path.isfile(diff_file0):
            if os.path.getsize(diff_file0) > 0:
                k00 = 1
        if k00 == 0:
            data_para.append(data0)

    ut.parallel_process(data_para,
                        work,
                        n_jobs=inps.parallelNumb,
                        use_kwargs=False)
    print("Generate differential interferograms for project %s is done! " %
          projectName)
    ut.print_process_time(start_time, time.time())

    sys.exit(1)
Exemplo n.º 4
0
def main(argv):
    
    start_time = time.time()
    inps = cmdLineParse()
    projectName = inps.projectName
    templateDir = os.getenv('TEMPLATEDIR')
    scratchDir = os.getenv('SCRATCHDIR')
    templateFile = templateDir + "/" + projectName + ".template"
    templateDict = ut.update_template(templateFile)
    masterDate = templateDict['masterDate']
    rlks = templateDict['range_looks']
    azlks = templateDict['azimuth_looks']
    HGTSIM = scratchDir + '/' + projectName + '/DEM/' + ut.yyyymmdd(masterDate) + '_' + rlks + 'rlks.rdc.dem' 
    
    ### download data
    
    if templateDict['download_data'] == '1':
        print('Start to download SAR data using SSARA...')
        call_str = 'ssara_federated_query.py -p ' +  templateDict['sensor'] + ' -r ' + templateDict['track'] + ' -f ' + templateDict['frame'] + ' -s ' + templateDict['start_time'] + ' -e ' + templateDict['end_time'] + ' --print --download --parallel ' + templateDict['down_parallel']
        print(call_str)
        os.system(call_str)
        
    ### raw 2 slc 
    if templateDict['raw2slc_all'] == '1':   # only for S1 data now
        print('Start to convert downloaded-raw data into SLC ...')
        print('Number of processor: %s' % str(templateDict['raw2slc_all_parallel']))
        call_str = 'down2slc_sen_all.py ' + projectName + ' --parallel ' + templateDict['raw2slc_all_parallel']
        os.system(call_str)
        
    ### extract bursts  
    if templateDict['extract_burst_all'] == '1':
        print('Start to extract common bursts ...')
        print('Number of processor: %s' % str(templateDict['extract_all_parallel']))
        call_str = 'extract_s1_bursts_all.py ' + projectName + ' --parallel ' + templateDict['extract_all_parallel']
        os.system(call_str)
        
    ### generate rdc_dem
    if not os.path.isfile(HGTSIM):
        print('Start to generate geometry file ...')
        call_str = 'generate_rdc_dem.py ' + projectName 
        os.system(call_str)
    
    ### coreg SLC  
    if templateDict['coreg_all'] == '1':
        print('Start to coregister SLCs ...')
        print('Number of processor: %s' % str(templateDict['coreg_all_parallel']))
        call_str = 'coreg_gamma_all.py ' + projectName + ' --parallel ' + templateDict['coreg_all_parallel']
        os.system(call_str)
    
    ### select interferometric pairs 
    if templateDict['select_pairs'] == '1':
        print('Start to select interferometric pairs ...')
        print('Network selection method: %s' % templateDict['network_method'])
        #print('Meximum temporal baseline threshold: %s' % templateDict['max_tb'])
        #print('Meximum spatial baseline threshold: %s' % templateDict['max_sb'])
        call_str = 'select_pairs.py ' + projectName
        os.system(call_str)
    
    ### diff ifg
    if templateDict['diff_all'] == '1':
        print('Start to generate differential interferograms ...')
        print('Number of processor: %s' % str(templateDict['diff_all_parallel']))
        call_str = 'diff_gamma_all.py ' + projectName + ' --parallel ' + templateDict['diff_all_parallel']
        os.system(call_str)
    
    ### unw ifg
    if templateDict['unwrap_all'] == '1':
        print('Start to unwrap interferometric phases ...')
        print('Number of processor: %s' % str(templateDict['unwrap_all_parallel']))
        call_str = 'unwrap_gamma_all.py ' + projectName + ' --parallel ' + templateDict['unwrap_all_parallel']
        os.system(call_str)
        
    ### geocode ifg
    if templateDict['geocode_all'] == '1':
        print('Start to geocode Ifgs ...')
        print('Number of processor: %s' % str(templateDict['geocode_all_parallel']))
        call_str = 'geocode_gamma_all.py ' + projectName + ' --parallel ' + templateDict['geocode_all_parallel']
        os.system(call_str)
        
    ### load data
    if templateDict['load_data'] == '1':
        print('Start to load data for mintPy time-series analysis ...')                                                   
        call_str = 'load_mintpy.py ' + projectName
        os.system(call_str)
    
    print("PyINT processing for project %s is done." % projectName)
    ut.print_process_time(start_time, time.time()) 
    sys.exit(1)