help='Clean up raw and slc files.') inps = parser.parse_args() return inps if __name__ == '__main__': ''' The main driver. ''' inps = parse() currDir = os.getcwd() if inps.subset in ['', None]: pairDirs = SS.getPairDirs(dirname=inps.dirname) else: pairDirs = SS.pairDirs_from_file(inps.subset, base=inps.dirname) print 'Number of IFGs : ', len(pairDirs) print 'Start step: ', inps.start print 'End step: ', inps.end for pair in pairDirs: unwfile = os.path.join(pair, 'filt_topophase.unw') if os.path.exists(unwfile) and (not inps.force) and (inps.start != 'geocode'): print 'Interferogram {0} already processed upto unwrapping'.format( pair) else: print 'Processing: {0}'.format(pair)
if __name__ == '__main__': inps = parse() #Get current directory currdir = os.getcwd() #Check if GIAnT dir exists. Create it if not. if os.path.isdir(inps['prepDir']): print("{0} directory already exists".format(inps['prepDir'])) else: os.mkdir(inps['prepDir']) pairs = [] #####Get list of IFGS if inps['list'] in ['', None]: pairs = SS.getPairDirs(dirname=inps['insarDir']) else: pairs = SS.pairDirs_from_file(inps['list'], base=inps['insarDir']) #Create ifg.list ifglist = os.path.join(inps['prepDir'], 'ifg.list') xObj = None if (not os.path.exists(ifglist)) or inps['force']: fid = open(ifglist, 'w') for pair in pairs: dates = os.path.basename(pair).split('_') xmlFile = os.path.join(pair, 'insarProc.xml') xObj = OB.fromstring(open(xmlFile, 'r').read()) try: bTop = xObj.baseline.perp_baseline_top
if __name__ == '__main__': inps = parse() #Get current directory currdir = os.getcwd() #Check if GIAnT dir exists. Create it if not. if os.path.isdir(inps.prepDir): print "{0} directory already exists".format(inps.prepDir) else: os.mkdir(inps.prepDir) pairs = [] #####Get list of IFGS if inps.ilist in ['', None]: pairs = SS.getPairDirs(dirname=inps.srcDir) else: pairs = SS.pairDirs_from_file(inps.ilist, base=inps.srcDir) #Create ifg.list ifglist = os.path.join(inps.prepDir, 'ifg.list') xObj = None if (not os.path.exists(ifglist)) or inps.force: fid = open(ifglist, 'w') for pair in pairs: dates = os.path.basename(pair).split('_') print pair xmlFile = os.path.join(pair, 'insarProc.xml') xObj = OB.fromstring(open(xmlFile, 'r').read()) try:
parser.add_argument('-f', action='store_true', default=False, dest='force', help = 'Force recomputing and updating of bbox') inps = parser.parse_args() return inps if __name__ == '__main__': inps = parse() snwe = () currSnwe = read_bbox_from_file(dirname=inps.intdir) if inps.ilist in [None,'']: pairs = SS.getPairDirs(inps.intdir) else: pairs = SS.pairDirs_from_file(inps.ilist, base=inps.intdir) flist = [os.path.join(val, 'PICKLE/unwrap') for val in pairs] if (currSnwe is None) or inps.force: newSnwe = edit_bbox(flist) write_bbox_to_file(newSnwe, dirname=inps.intdir) else: print 'Using predefined: ', currSnwe newSnwe = edit_bbox(flist, snwe=currSnwe) print 'Final Snwe: ', newSnwe