def __init__(self, folder, dataxml='data.xml', procxml='sbas.xml'): self.io = basic.DictObj() self.io.folder = folder if not os.path.exists(folder): #Initialize barebones pass else: try: self.io.dparsxml = os.path.join(self.io.folder, dataxml) self.dpars = ts.TSXML(self.io.dparsxml, True) except: self.io.dparsxml = None self.dpars = None try: self.io.pparsxml = os.path.join(self.io.folder, procxml) self.ppars = ts.TSXML(self.io.pparsxml, True) except: self.io.pparsxml = None self.ppars = None if os.path.exists( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'RAW-STACK.h5')): self.RAW_STACK = ts.loadh5( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'RAW-STACK.h5')) if os.path.exists( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'PROC-STACK.h5')): self.PROC_STACK = ts.loadh5( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'PROC-STACK.h5')) if os.path.exists( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'LS-PARAMS.h5')): self.LS_PARAMS = ts.loadh5( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'LS-PARAMS.h5')) if os.path.exists( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'NSBAS-PARAMS.h5')): self.NSBAS_PARAMS = ts.loadh5( os.path.join(self.io.folder, self.dpars.data.dirs.h5dir, 'NSBAS-PARAMS.h5'))
import tsinsar as ts import argparse import numpy as np #def parse(): # parser= argparse.ArgumentParser(description='Preparation of XML files for setting up the processing chain. Check tsinsar/tsxml.py for details on the parameters.') # parser.parse_args() #parse() #reference point coh = adore.getProduct(iobj.coherence) ref = basic.ind2sub(coh.shape, coh.argmax()) del coh g = ts.TSXML('data') #g.prepare_data_xml('example',xlim=[30,380],ylim=[100,600],rxlim=[30,50],rylim=[50,70],latfile='lat.map',lonfile='lon.map',hgtfile='hgt.map', # inc=21.,cohth=0.2,demfmt='RMG',chgendian='False',masktype='f4') g.prepare_data_xml([iobj.resfile, mobj.resfile], proc='DORIS', looks=1, cohth=0., mask='', xlim=None, ylim=None, rxlim=[ref[0] - 1, ref[0] + 1], rylim=[ref[1] - 1, ref[1] + 1], latfile='', lonfile='', hgtfile='', inc=iobj.coarse_orbits.inc_angle,
#!/usr/bin/env python import tsinsar as ts import argparse import numpy as np if __name__ == '__main__': g = ts.TSXML('params') g.prepare_sbas_xml(nvalid = 5, netramp=False, atmos='', demerr = False, uwcheck=False, regu=True, filt = 0.1) g.writexml('sbas.xml')
#!/usr/bin/env python import tsinsar as ts import argparse import numpy as np if __name__ == '__main__': ######Prepare the data.xml g = ts.TSXML('data') g.prepare_data_xml('example.rsc', proc='RPAC', xlim=[0,5005], ylim=[0, 6049], rxlim = [2445,2455], rylim=[2225,2235], latfile='', lonfile='', hgtfile='', inc = 38.5, cohth=0.2, chgendian='False', unwfmt='FLT', corfmt='FLT') g.writexml('data.xml')
par.recons[:, ii] = np.nan if __name__ == '__main__': ############Read parameter file. inps = parse() logger = ts.logger #######Load the user defined dictionary exists. try: user = imp.load_source('timedict', inps.user) except: logger.error('No user defined time dictionary in %s' (inps.user)) sys.exit(1) dpars = ts.TSXML(inps.dxml, File=True) ppars = ts.TSXML(inps.pxml, File=True) ######Dirs h5dir = (dpars.data.dirs.h5dir) figdir = (dpars.data.dirs.figsdir) netramp = (ppars.params.proc.netramp) gpsramp = (ppars.params.proc.gpsramp) if inps.fname is None: if netramp or gpsramp: fname = os.path.join(h5dir, 'PROC-STACK.h5') else: fname = os.path.join(h5dir, 'RAW-STACK.h5') else: