示例#1
0
def main():
    opts, ifiles = getOptions()
    ccpara = CCConfig()
    gsac = loadData(ifiles, opts, ccpara)
    opts.ccpara = ccpara
    ccpara.twcorr = opts.twcorr
    ccpara.cchdrs = [opts.ipick, opts.wpick]
    # check data coverage, initialize quality factors
    checkCoverage(gsac, opts)
    initQual(gsac.saclist, opts.ccpara.hdrsel, opts.ccpara.qheaders)

    if opts.auto_on:
        autoiccs(gsac, opts)
    elif opts.auto_on_all:
        print('Selecting all seismograms..')
        hdrsel = opts.ccpara.hdrsel
        for sacdh in gsac.saclist:
            sacdh.selected = True
            sacdh.sethdr(hdrsel, 'True    ')
        autoiccs(gsac, opts)
    else:
        stkdh, stkdata, quas = ccWeightStack(gsac.saclist, opts)
        gsac.stkdh = stkdh
        saveData(gsac, opts)
    if opts.plotiter:
        plotiter(stkdata)
示例#2
0
文件: algiccs.py 项目: ehparker/pysmo
def main():
	opts, ifiles = getOptions()
	ccpara = CCConfig()
	gsac = loadData(ifiles, opts, ccpara)
	opts.ccpara = ccpara
	ccpara.twcorr = opts.twcorr
	ccpara.cchdrs = [opts.ipick, opts.wpick]
	# check data coverage, initialize quality factors
	checkCoverage(gsac, opts) 
	initQual(gsac.saclist, opts.ccpara.hdrsel, opts.ccpara.qheaders)

	if opts.auto_on:
		autoiccs(gsac, opts)
	elif opts.auto_on_all:
		print ('Selecting all seismograms..')
		hdrsel = opts.ccpara.hdrsel
		for sacdh in gsac.saclist:
			sacdh.selected = True
			sacdh.sethdr(hdrsel, 'True    ')
		autoiccs(gsac, opts)
	else:
		stkdh, stkdata, quas = ccWeightStack(gsac.saclist, opts)
		gsac.stkdh = stkdh
		saveData(gsac, opts)
	if opts.plotiter:
		plotiter(stkdata)
示例#3
0
	def shod(self, event):
		shouldRun = messagebox.askokcancel("Will Override Files!","This will override the data in your files with the filtered data. \nAre you sure?")
		if shouldRun: 
			for sacdh in self.gsac.saclist: 
				sacdh.data = ftr.filtering_time_signal(sacdh.data, self.opts.delta, self.opts.filterParameters['lowFreq'], self.opts.filterParameters['highFreq'], self.opts.filterParameters['band'], self.opts.filterParameters['order'])
			if 'stkdh' in self.gsac.__dict__:
				self.gsac.stkdh.data = ftr.filtering_time_signal(self.gsac.stkdh.data, self.opts.delta, self.opts.filterParameters['lowFreq'], self.opts.filterParameters['highFreq'], self.opts.filterParameters['band'], self.opts.filterParameters['order'])
			saveData(self.gsac, self.opts)
示例#4
0
    def save_headers_filterParams(self, event):
        # write params to file
        for sacdh in self.gsac.saclist:
            sacdh.user0 = self.opts.filterParameters['lowFreq']
            sacdh.user1 = self.opts.filterParameters['highFreq']
            sacdh.kuser0 = self.opts.filterParameters['band']
            sacdh.kuser1 = self.opts.filterParameters['order']
        if 'stkdh' in self.gsac.__dict__:
            self.gsac.stkdh.user0 = self.opts.filterParameters['lowFreq']
            self.gsac.stkdh.user1 = self.opts.filterParameters['highFreq']
            self.gsac.stkdh.kuser0 = self.opts.filterParameters['band']
            self.gsac.stkdh.kuser1 = self.opts.filterParameters['order']

        # save
        saveData(self.gsac, self.opts)
示例#5
0
	def shfp(self, event):
		# write params to file
		for sacdh in self.gsac.saclist: 
			sacdh.user0 = self.opts.filterParameters['lowFreq']
			sacdh.user1 = self.opts.filterParameters['highFreq']
			sacdh.kuser0 = self.opts.filterParameters['band']
			sacdh.kuser1 = self.opts.filterParameters['order']
		if 'stkdh' in self.gsac.__dict__:
			self.gsac.stkdh.user0 = self.opts.filterParameters['lowFreq']
			self.gsac.stkdh.user1 = self.opts.filterParameters['highFreq']
			self.gsac.stkdh.kuser0 = self.opts.filterParameters['band']
			self.gsac.stkdh.kuser1 = self.opts.filterParameters['order']

		# save
		saveData(self.gsac, self.opts)
示例#6
0
    def saveButtonClicked(self):
        # move stacked sacfile into sacgroup
        self.sacgroup.stkdh = self.stkdh

        # write params to user headers of sac files
        for sacdh in self.sacgroup.saclist:
            sacdh.user0 = self.opts.filterParameters['lowFreq']
            sacdh.user1 = self.opts.filterParameters['highFreq']
            sacdh.kuser0 = self.opts.filterParameters['band']
            sacdh.kuser1 = self.opts.filterParameters['order']
        if 'stkdh' in self.sacgroup.__dict__:
            self.sacgroup.stkdh.user0 = self.opts.filterParameters['lowFreq']
            self.sacgroup.stkdh.user1 = self.opts.filterParameters['highFreq']
            self.sacgroup.stkdh.kuser0 = self.opts.filterParameters['band']
            self.sacgroup.stkdh.kuser1 = self.opts.filterParameters['order']

        saveData(self.sacgroup, self.opts)
示例#7
0
	def saveButtonClicked(self):
		# move stacked sacfile into sacgroup
		self.sacgroup.stkdh = self.stkdh

		# write params to user headers of sac files
		for sacdh in self.sacgroup.saclist: 
			sacdh.user0 = self.opts.filterParameters['lowFreq']
			sacdh.user1 = self.opts.filterParameters['highFreq']
			sacdh.kuser0 = self.opts.filterParameters['band']
			sacdh.kuser1 = self.opts.filterParameters['order']
		if 'stkdh' in self.sacgroup.__dict__:
			self.sacgroup.stkdh.user0 = self.opts.filterParameters['lowFreq']
			self.sacgroup.stkdh.user1 = self.opts.filterParameters['highFreq']
			self.sacgroup.stkdh.kuser0 = self.opts.filterParameters['band']
			self.sacgroup.stkdh.kuser1 = self.opts.filterParameters['order']

		saveData(self.sacgroup, self.opts)
示例#8
0
def main():
    opts, ifiles = getOptions()
    mcpara = MCConfig()
    gsac = loadData(ifiles, opts, mcpara)

    if opts.phase is None:
        phase = findPhase(ifiles[0])
        print('Found phase to be: ' + phase + '\n')
        mcpara.phase = phase

    opts.fstack = mcpara.fstack
    if opts.filemode == 'sac' and os.path.isfile(opts.fstack):
        print('Read array stack file: ' + opts.fstack)
        gsac.stkdh = SacDataHdrs(opts.fstack, opts.delta)

    getParams(gsac, mcpara, opts)
    if opts.allseis_on:
        solution = mccc(gsac, mcpara)
        gsac.selist, gsac.delist = gsac.saclist, []
    else:
        initQual(gsac.saclist, mcpara.hdrsel, [])
        gsac.selist, gsac.delist = seleSeis(gsac.saclist)
        solution = mccc(gsac, mcpara)
    saveData(gsac, opts)
示例#9
0
文件: algmccc.py 项目: xlougeo/aimbat
def main():
	opts, ifiles = getOptions()
	mcpara = MCConfig()
	gsac = loadData(ifiles, opts, mcpara)

	if opts.phase is None:
		phase = findPhase(ifiles[0])
		print ('Found phase to be: ' + phase + '\n')
		mcpara.phase = phase

	opts.fstack = mcpara.fstack
	if opts.filemode == 'sac' and os.path.isfile(opts.fstack):
		print ('Read array stack file: ' + opts.fstack )
		gsac.stkdh = SacDataHdrs(opts.fstack, opts.delta)

	getParams(gsac, mcpara, opts)
	if opts.allseis_on:
		solution = mccc(gsac, mcpara)
		gsac.selist, gsac.delist = gsac.saclist, []
	else:
		initQual(gsac.saclist, mcpara.hdrsel, [])
		gsac.selist, gsac.delist = seleSeis(gsac.saclist)
		solution = mccc(gsac, mcpara)
	saveData(gsac, opts)
示例#10
0
 def save_headers(self, event):
     saveData(self.gsac, self.opts)
示例#11
0
	def save(self, event):
		saveData(self.gsac, self.opts)
示例#12
0
	def shdo(self, event):
		saveData(self.gsac, self.opts)
示例#13
0
	def save_headers(self, event):
		saveData(self.gsac, self.opts)