Merge tag '0.1a' into develop
First release of PyLoT
This commit is contained in:
		
						commit
						d668a483fc
					
				
							
								
								
									
										165
									
								
								LICENSE.txt
									
									
									
									
									
								
							
							
						
						
									
										165
									
								
								LICENSE.txt
									
									
									
									
									
								
							| @ -1,165 +0,0 @@ | ||||
|            GNU LESSER GENERAL PUBLIC LICENSE | ||||
|                        Version 3, 29 June 2007 | ||||
| 
 | ||||
|  Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||||
|  Everyone is permitted to copy and distribute verbatim copies | ||||
|  of this license document, but changing it is not allowed. | ||||
| 
 | ||||
| 
 | ||||
|   This version of the GNU Lesser General Public License incorporates | ||||
| the terms and conditions of version 3 of the GNU General Public | ||||
| License, supplemented by the additional permissions listed below. | ||||
| 
 | ||||
|   0. Additional Definitions. | ||||
| 
 | ||||
|   As used herein, "this License" refers to version 3 of the GNU Lesser | ||||
| General Public License, and the "GNU GPL" refers to version 3 of the GNU | ||||
| General Public License. | ||||
| 
 | ||||
|   "The Library" refers to a covered work governed by this License, | ||||
| other than an Application or a Combined Work as defined below. | ||||
| 
 | ||||
|   An "Application" is any work that makes use of an interface provided | ||||
| by the Library, but which is not otherwise based on the Library. | ||||
| Defining a subclass of a class defined by the Library is deemed a mode | ||||
| of using an interface provided by the Library. | ||||
| 
 | ||||
|   A "Combined Work" is a work produced by combining or linking an | ||||
| Application with the Library.  The particular version of the Library | ||||
| with which the Combined Work was made is also called the "Linked | ||||
| Version". | ||||
| 
 | ||||
|   The "Minimal Corresponding Source" for a Combined Work means the | ||||
| Corresponding Source for the Combined Work, excluding any source code | ||||
| for portions of the Combined Work that, considered in isolation, are | ||||
| based on the Application, and not on the Linked Version. | ||||
| 
 | ||||
|   The "Corresponding Application Code" for a Combined Work means the | ||||
| object code and/or source code for the Application, including any data | ||||
| and utility programs needed for reproducing the Combined Work from the | ||||
| Application, but excluding the System Libraries of the Combined Work. | ||||
| 
 | ||||
|   1. Exception to Section 3 of the GNU GPL. | ||||
| 
 | ||||
|   You may convey a covered work under sections 3 and 4 of this License | ||||
| without being bound by section 3 of the GNU GPL. | ||||
| 
 | ||||
|   2. Conveying Modified Versions. | ||||
| 
 | ||||
|   If you modify a copy of the Library, and, in your modifications, a | ||||
| facility refers to a function or data to be supplied by an Application | ||||
| that uses the facility (other than as an argument passed when the | ||||
| facility is invoked), then you may convey a copy of the modified | ||||
| version: | ||||
| 
 | ||||
|    a) under this License, provided that you make a good faith effort to | ||||
|    ensure that, in the event an Application does not supply the | ||||
|    function or data, the facility still operates, and performs | ||||
|    whatever part of its purpose remains meaningful, or | ||||
| 
 | ||||
|    b) under the GNU GPL, with none of the additional permissions of | ||||
|    this License applicable to that copy. | ||||
| 
 | ||||
|   3. Object Code Incorporating Material from Library Header Files. | ||||
| 
 | ||||
|   The object code form of an Application may incorporate material from | ||||
| a header file that is part of the Library.  You may convey such object | ||||
| code under terms of your choice, provided that, if the incorporated | ||||
| material is not limited to numerical parameters, data structure | ||||
| layouts and accessors, or small macros, inline functions and templates | ||||
| (ten or fewer lines in length), you do both of the following: | ||||
| 
 | ||||
|    a) Give prominent notice with each copy of the object code that the | ||||
|    Library is used in it and that the Library and its use are | ||||
|    covered by this License. | ||||
| 
 | ||||
|    b) Accompany the object code with a copy of the GNU GPL and this license | ||||
|    document. | ||||
| 
 | ||||
|   4. Combined Works. | ||||
| 
 | ||||
|   You may convey a Combined Work under terms of your choice that, | ||||
| taken together, effectively do not restrict modification of the | ||||
| portions of the Library contained in the Combined Work and reverse | ||||
| engineering for debugging such modifications, if you also do each of | ||||
| the following: | ||||
| 
 | ||||
|    a) Give prominent notice with each copy of the Combined Work that | ||||
|    the Library is used in it and that the Library and its use are | ||||
|    covered by this License. | ||||
| 
 | ||||
|    b) Accompany the Combined Work with a copy of the GNU GPL and this license | ||||
|    document. | ||||
| 
 | ||||
|    c) For a Combined Work that displays copyright notices during | ||||
|    execution, include the copyright notice for the Library among | ||||
|    these notices, as well as a reference directing the user to the | ||||
|    copies of the GNU GPL and this license document. | ||||
| 
 | ||||
|    d) Do one of the following: | ||||
| 
 | ||||
|        0) Convey the Minimal Corresponding Source under the terms of this | ||||
|        License, and the Corresponding Application Code in a form | ||||
|        suitable for, and under terms that permit, the user to | ||||
|        recombine or relink the Application with a modified version of | ||||
|        the Linked Version to produce a modified Combined Work, in the | ||||
|        manner specified by section 6 of the GNU GPL for conveying | ||||
|        Corresponding Source. | ||||
| 
 | ||||
|        1) Use a suitable shared library mechanism for linking with the | ||||
|        Library.  A suitable mechanism is one that (a) uses at run time | ||||
|        a copy of the Library already present on the user's computer | ||||
|        system, and (b) will operate properly with a modified version | ||||
|        of the Library that is interface-compatible with the Linked | ||||
|        Version. | ||||
| 
 | ||||
|    e) Provide Installation Information, but only if you would otherwise | ||||
|    be required to provide such information under section 6 of the | ||||
|    GNU GPL, and only to the extent that such information is | ||||
|    necessary to install and execute a modified version of the | ||||
|    Combined Work produced by recombining or relinking the | ||||
|    Application with a modified version of the Linked Version. (If | ||||
|    you use option 4d0, the Installation Information must accompany | ||||
|    the Minimal Corresponding Source and Corresponding Application | ||||
|    Code. If you use option 4d1, you must provide the Installation | ||||
|    Information in the manner specified by section 6 of the GNU GPL | ||||
|    for conveying Corresponding Source.) | ||||
| 
 | ||||
|   5. Combined Libraries. | ||||
| 
 | ||||
|   You may place library facilities that are a work based on the | ||||
| Library side by side in a single library together with other library | ||||
| facilities that are not Applications and are not covered by this | ||||
| License, and convey such a combined library under terms of your | ||||
| choice, if you do both of the following: | ||||
| 
 | ||||
|    a) Accompany the combined library with a copy of the same work based | ||||
|    on the Library, uncombined with any other library facilities, | ||||
|    conveyed under the terms of this License. | ||||
| 
 | ||||
|    b) Give prominent notice with the combined library that part of it | ||||
|    is a work based on the Library, and explaining where to find the | ||||
|    accompanying uncombined form of the same work. | ||||
| 
 | ||||
|   6. Revised Versions of the GNU Lesser General Public License. | ||||
| 
 | ||||
|   The Free Software Foundation may publish revised and/or new versions | ||||
| of the GNU Lesser General Public License from time to time. Such new | ||||
| versions will be similar in spirit to the present version, but may | ||||
| differ in detail to address new problems or concerns. | ||||
| 
 | ||||
|   Each version is given a distinguishing version number. If the | ||||
| Library as you received it specifies that a certain numbered version | ||||
| of the GNU Lesser General Public License "or any later version" | ||||
| applies to it, you have the option of following the terms and | ||||
| conditions either of that published version or of any later version | ||||
| published by the Free Software Foundation. If the Library as you | ||||
| received it does not specify a version number of the GNU Lesser | ||||
| General Public License, you may choose any version of the GNU Lesser | ||||
| General Public License ever published by the Free Software Foundation. | ||||
| 
 | ||||
|   If the Library as you received it specifies that a proxy can decide | ||||
| whether future versions of the GNU Lesser General Public License shall | ||||
| apply, that proxy's public statement of acceptance of any version is | ||||
| permanent authorization for you to choose that version for the | ||||
| Library. | ||||
							
								
								
									
										35
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								README
									
									
									
									
									
								
							| @ -1,35 +0,0 @@ | ||||
| PyLoT  | ||||
| 
 | ||||
| version: 0.1 | ||||
| 
 | ||||
| The Python picking and Localisation Tool | ||||
| 
 | ||||
| This python library contains a graphical user interfaces for picking | ||||
| seismic phases. This software needs ObsPy (http://github.com/obspy/obspy/wiki) | ||||
| and the PySide Qt4 bindings for python to be installed first. | ||||
| 
 | ||||
| PILOT has originally been developed in Mathworks' MatLab. In order to | ||||
| distribute PILOT without facing portability problems, it has been decided | ||||
| to redevelop the software package in Python. The great work of the ObsPy | ||||
| group allows easy handling of a bunch of seismic data and PyLoT will | ||||
| benefit a lot compared to the former MatLab version. | ||||
| 
 | ||||
| The development of PyLoT is part of the joint research project MAGS2.    | ||||
| 
 | ||||
| staff: | ||||
| ====== | ||||
| 
 | ||||
| original author(s): L. Kueperkoch, S. Wehling-Benatelli, M. Bischoff (PILOT) | ||||
| 
 | ||||
| developer(s): S. Wehling-Benatelli, L. Kueperkoch, K. Olbert, M. Bischoff, | ||||
|               C. Wollin, M. Rische | ||||
| 
 | ||||
| others: A. Bruestle, T. Meier, W. Friederich | ||||
| 
 | ||||
| release notes: | ||||
| ============== | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| October 2013 | ||||
| 
 | ||||
							
								
								
									
										92
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										92
									
								
								README.md
									
									
									
									
									
								
							| @ -1,2 +1,92 @@ | ||||
| # PyLoT | ||||
| Python picking and Location Tool | ||||
| 
 | ||||
| version: 0.1a | ||||
| 
 | ||||
| The Python picking and Localisation Tool | ||||
| 
 | ||||
| This python library contains a graphical user interfaces for picking | ||||
| seismic phases. This software needs [ObsPy][ObsPy] | ||||
| and the PySide Qt4 bindings for python to be installed first. | ||||
| 
 | ||||
| PILOT has originally been developed in Mathworks' MatLab. In order to | ||||
| distribute PILOT without facing portability problems, it has been decided | ||||
| to redevelop the software package in Python. The great work of the ObsPy | ||||
| group allows easy handling of a bunch of seismic data and PyLoT will | ||||
| benefit a lot compared to the former MatLab version. | ||||
| 
 | ||||
| The development of PyLoT is part of the joint research project MAGS2. | ||||
| 
 | ||||
| ##Installation | ||||
| 
 | ||||
| At the moment there is no automatic installation procedure available for PyLoT. | ||||
| Best way to install is to clone the repository and add the path to your Python path. | ||||
| 
 | ||||
| ####prerequisites: | ||||
| 
 | ||||
| In order to run PyLoT you need to install: | ||||
| 
 | ||||
| - python | ||||
| - scipy | ||||
| - numpy | ||||
| - matplotlib | ||||
| - obspy | ||||
| - pyside | ||||
| 
 | ||||
| ####some handwork | ||||
| 
 | ||||
| PyLoT needs a properties folder on your system to work. It should be situated in your home directory: | ||||
| 
 | ||||
|     mkdir ~/.pylot | ||||
| 
 | ||||
| In the next step you have to copy some files to this directory: | ||||
| 
 | ||||
|     cp path-to-pylot/inputs/pylot.in ~/.pylot/ | ||||
| 
 | ||||
| for local distance seismicity | ||||
| 
 | ||||
|     cp path-to-pylot/inputs/autoPyLoT_local.in ~/.pylot/autoPyLoT.in | ||||
| 
 | ||||
| for regional distance seismicity | ||||
| 
 | ||||
|     cp path-to-pylot/inputs/autoPyLoT_regional.in ~/.pylot/autoPyLoT.in | ||||
| 
 | ||||
| and some extra information on filtering, error estimates (just needed for reading old PILOT data) and the Richter magnitude scaling relation | ||||
| 
 | ||||
|     cp path-to-pylot/inputs/filter.in path-to-pylot/inputs/PILOT_TimeErrors.in path-to-pylot/inputs/richter_scaling.data ~/.pylot/ | ||||
| 
 | ||||
| You may need to do some modifications to these files. Especially folder names should be reviewed. | ||||
| 
 | ||||
| PyLoT has been tested on Mac OSX (10.11) and Debian Linux 8. | ||||
| 
 | ||||
| 
 | ||||
| ##release notes: | ||||
| ============== | ||||
| 
 | ||||
| #### Features | ||||
| 
 | ||||
| - consistent manual phase picking through predefined SNR dependant zoom level | ||||
| - uniform uncertainty estimation from waveform's properties for automatic and manual picks | ||||
| - pdf representation and comparison of picks taking the uncertainty intrinsically into account  | ||||
| - Richter and moment magnitude estimation | ||||
| - location determination with external installation of [NonLinLoc](http://alomax.free.fr/nlloc/index.html) | ||||
| 
 | ||||
| #### Known issues | ||||
| 
 | ||||
| - Magnitude estimation from manual PyLoT takes some time (instrument correction) | ||||
| 
 | ||||
| We hope to solve these with the next release. | ||||
| 
 | ||||
| ####staff: | ||||
| ====== | ||||
| 
 | ||||
| original author(s): L. Kueperkoch, S. Wehling-Benatelli, M. Bischoff (PILOT) | ||||
| 
 | ||||
| developer(s): S. Wehling-Benatelli, L. Kueperkoch, K. Olbert, M. Bischoff, | ||||
|               C. Wollin, M. Rische, M. Paffrath | ||||
| 
 | ||||
| others: A. Bruestle, T. Meier, W. Friederich | ||||
| 
 | ||||
| 
 | ||||
| [ObsPy]: http://github.com/obspy/obspy/wiki | ||||
| 
 | ||||
| October 2016 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| 5f92-dirty | ||||
| 0.1a | ||||
|  | ||||
| @ -1,539 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| import os | ||||
| import sys | ||||
| import matplotlib | ||||
| matplotlib.use('Qt4Agg') | ||||
| matplotlib.rcParams['backend.qt4']='PySide' | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| from pylot.core.active import activeSeismoPick, surveyUtils, fmtomoUtils, seismicArrayPreparation | ||||
| from pylot.core.active.gui.asp3d_layout import * | ||||
| from pylot.core.active.gui.windows import Gen_SeisArray, Gen_Survey_from_SA, Gen_Survey_from_SR, Call_autopicker, Call_FMTOMO, Call_VTK_dialog, Postprocessing | ||||
| from pylot.core.active.gui.windows import openFile, saveFile, browseDir, getMaxCPU, printDialogMessage, continueDialogExists, continueDialogMessage | ||||
| 
 | ||||
| from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas | ||||
| from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar | ||||
| import matplotlib.pyplot as plt | ||||
| from matplotlib.figure import Figure | ||||
| 
 | ||||
| class gui_control(object): | ||||
|     def __init__(self): | ||||
|         self.mainwindow = MainWindow | ||||
|         self.mainUI = ui | ||||
|         self.connectButtons() | ||||
|         self.survey = None | ||||
|         self.seisarray = None | ||||
|         self.seisArrayFigure = None | ||||
|         self.cancelpixmap = self.mainwindow.style().standardPixmap(QtGui.QStyle.SP_DialogCancelButton) | ||||
|         self.applypixmap = self.mainwindow.style().standardPixmap(QtGui.QStyle.SP_DialogApplyButton) | ||||
|         self.addArrayPlot() | ||||
|         self.addSurfacePlot() | ||||
|         self.addStatPlots() | ||||
|         self.setInitStates() | ||||
|         self.mainUI.progressBar.setVisible(False) | ||||
|         self.printSurveyTextbox() | ||||
|         self.printSeisArrayTextbox() | ||||
|         self.initWindowObjects() | ||||
|         app.aboutToQuit.connect(self.exitApp) | ||||
| 
 | ||||
|     def initWindowObjects(self): | ||||
|         self.gsa = None | ||||
|         self.gssa = None | ||||
|         self.gssr = None | ||||
|         self.autopicker = None | ||||
|         self.fmtomo = None | ||||
|         self.vtktools = None | ||||
|         self.postprocessing = None | ||||
| 
 | ||||
|     def setInitStates(self): | ||||
|         self.setPickState(False) | ||||
|         self.setSurveyState(False) | ||||
|         self.setSeisArrayState(False) | ||||
|         self.setConnected2SurveyState(False) | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.mainUI.actionGenerate_new_Seismic_Array, QtCore.SIGNAL("triggered()"), self.gen_seisarray) | ||||
|         QtCore.QObject.connect(self.mainUI.actionLoad_Seismic_Array, QtCore.SIGNAL("triggered()"), self.load_seisarray) | ||||
|         QtCore.QObject.connect(self.mainUI.actionSave_Seismic_Array, QtCore.SIGNAL("triggered()"), self.save_seisarray) | ||||
|         QtCore.QObject.connect(self.mainUI.actionLoad_Survey, QtCore.SIGNAL("triggered()"), self.load_survey) | ||||
|         QtCore.QObject.connect(self.mainUI.actionSave_Survey, QtCore.SIGNAL("triggered()"), self.save_survey) | ||||
|         QtCore.QObject.connect(self.mainUI.actionConnect_to_Survey, QtCore.SIGNAL("triggered()"), self.connect2Survey) | ||||
|         QtCore.QObject.connect(self.mainUI.actionInterpolate_Receivers, QtCore.SIGNAL("triggered()"), self.interpolate_receivers) | ||||
|         QtCore.QObject.connect(self.mainUI.actionGenerate_new_Survey, QtCore.SIGNAL("triggered()"), self.gen_survey) | ||||
|         QtCore.QObject.connect(self.mainUI.actionAutomatic_Picking, QtCore.SIGNAL("triggered()"), self.startPicker) | ||||
|         QtCore.QObject.connect(self.mainUI.actionPostprocessing, QtCore.SIGNAL("triggered()"), self.postprocessing) | ||||
|         QtCore.QObject.connect(self.mainUI.actionStart_FMTOMO_Simulation, QtCore.SIGNAL("triggered()"), self.startFMTOMO) | ||||
|         QtCore.QObject.connect(self.mainUI.actionVTK_Visualization, QtCore.SIGNAL("triggered()"), self.startVTKtools) | ||||
|         QtCore.QObject.connect(self.mainUI.actionExit, QtCore.SIGNAL("triggered()"), self.exitApp) | ||||
|         QtCore.QObject.connect(self.mainUI.actionFullscreen, QtCore.SIGNAL("triggered()"), self.fullscreen) | ||||
|         QtCore.QObject.connect(self.mainUI.comboBox_stats, QtCore.SIGNAL("activated(int)"), self.refreshPickedWidgets) | ||||
|         QtCore.QObject.connect(self.mainUI.shot_left, QtCore.SIGNAL("clicked()"), self.decreaseShotnumber) | ||||
|         QtCore.QObject.connect(self.mainUI.shot_right, QtCore.SIGNAL("clicked()"), self.increaseShotnumber) | ||||
|         QtCore.QObject.connect(self.mainUI.plot_shot, QtCore.SIGNAL("clicked()"), self.plotShot) | ||||
| 
 | ||||
|     def fullscreen(self): | ||||
|         if self.mainUI.actionFullscreen.isChecked(): | ||||
|             MainWindow.showFullScreen() | ||||
|         else: | ||||
|             MainWindow.showNormal()                     | ||||
|          | ||||
|     def gen_seisarray(self): | ||||
|         disconnect = False | ||||
|         if self.checkSeisArrayState(): | ||||
|             if not continueDialogExists('Seismic Array'): | ||||
|                 return | ||||
|         if self.checkConnected2SurveyState(): | ||||
|             if not continueDialogMessage('Seismic Array connected to present Survey.\n' | ||||
|                                               'Continuation will disconnect the Seismic Array.'): | ||||
|                 return | ||||
|             else: | ||||
|                 self.survey.seisarray = None | ||||
|                 disconnect = True | ||||
|          | ||||
|         if self.gsa is None: | ||||
|             self.gsa = Gen_SeisArray(self.mainwindow) | ||||
|         else: | ||||
|             self.gsa.start_dialog() | ||||
| 
 | ||||
|         if self.gsa.executed: | ||||
|             self.seisarray = self.gsa.get_seisarray() | ||||
|             if disconnect: | ||||
|                 self.setConnected2SurveyState(False) | ||||
|             self.setSeisArrayState(True) | ||||
| 
 | ||||
|     def gen_survey(self): | ||||
|         if self.checkSurveyState(): | ||||
|             if not continueDialogExists('Survey'): | ||||
|                 return | ||||
|         if self.checkSeisArrayState(): | ||||
|             if len(self.seisarray.getSourceCoordinates()) > 0: | ||||
|                 if continueDialogMessage('Use geometry information of active Seismic Array?'): | ||||
|                     if self.gssa is None: | ||||
|                         self.gssa = Gen_Survey_from_SA(self.mainwindow, self.seisarray) | ||||
|                     else: | ||||
|                         self.gssa.start_dialog() | ||||
|                         self.update_seisarray(self.seisarray) | ||||
|                     if self.gssa.executed: | ||||
|                         self.survey = self.gssa.get_survey() | ||||
|                         self.initNewSurvey() | ||||
|                         self.setConnected2SurveyState(True) | ||||
|                         self.setPickState(False) | ||||
|                     return | ||||
|             else: | ||||
|                 if not continueDialogMessage('Can not use current Seismic Array,' | ||||
|                                                   ' because there are no sources given.'): | ||||
|                     return | ||||
|         if self.gssr is None: | ||||
|             self.gssr = Gen_Survey_from_SR(self.mainwindow) | ||||
|         else: | ||||
|             self.gssr.start_dialog() | ||||
|         if self.gssr.executed: | ||||
|             self.survey = self.gssr.get_survey() | ||||
|             self.seisarray = self.survey.seisarray | ||||
|             self.initNewSurvey() | ||||
|             self.setSeisArrayState(True) | ||||
|             self.setConnected2SurveyState(True) | ||||
| 
 | ||||
|     def initNewSurvey(self): | ||||
|         self.survey.setArtificialPick(0, 0) # artificial pick at source origin | ||||
|         self.setSurveyState(True) | ||||
|         self.setPickState(False) | ||||
| 
 | ||||
|     def addArrayPlot(self): | ||||
|         self.seisArrayFigure = Figure() | ||||
|         self.seisArrayCanvas = FigureCanvas(self.seisArrayFigure) | ||||
|         self.mainUI.verticalLayout_tr1.addWidget(self.seisArrayCanvas) | ||||
|         self.seisArrayToolbar = NavigationToolbar(self.seisArrayCanvas, self.mainwindow) | ||||
|         self.mainUI.verticalLayout_tr1.addWidget(self.seisArrayToolbar) | ||||
| 
 | ||||
|     def addSurfacePlot(self): | ||||
|         self.surfaceFigure = Figure() | ||||
|         self.surfaceCanvas = FigureCanvas(self.surfaceFigure) | ||||
|         self.mainUI.horizontalLayout_tr.addWidget(self.surfaceCanvas) | ||||
| 
 | ||||
|     def addStatPlots(self): | ||||
|         self.statFigure_left = Figure() | ||||
|         self.statCanvas_left = FigureCanvas(self.statFigure_left) | ||||
|         self.mainUI.verticalLayout_br1.addWidget(self.statCanvas_left) | ||||
|         self.statToolbar_left = NavigationToolbar(self.statCanvas_left, self.mainwindow) | ||||
|         self.mainUI.verticalLayout_br1.addWidget(self.statToolbar_left) | ||||
| 
 | ||||
|         self.statFigure_right = Figure() | ||||
|         self.statCanvas_right = FigureCanvas(self.statFigure_right) | ||||
|         self.mainUI.verticalLayout_br2.addWidget(self.statCanvas_right) | ||||
|         self.statToolbar_right = NavigationToolbar(self.statCanvas_right, self.mainwindow) | ||||
|         self.mainUI.verticalLayout_br2.addWidget(self.statToolbar_right) | ||||
| 
 | ||||
|         self.addItems2StatsComboBox() | ||||
| 
 | ||||
|     def addItems2StatsComboBox(self): | ||||
|         self.mainUI.comboBox_stats.insertItem(0, 'picked traces') | ||||
|         self.mainUI.comboBox_stats.insertItem(1, 'mean SNR') | ||||
|         self.mainUI.comboBox_stats.insertItem(2, 'median SNR') | ||||
|         self.mainUI.comboBox_stats.insertItem(3, 'mean SPE') | ||||
|         self.mainUI.comboBox_stats.insertItem(4, 'median SPE') | ||||
|         self.enablePickedTools(False) | ||||
| 
 | ||||
|     def addItems2ShotsComboBox(self): | ||||
|         shotnumbers = self.survey.data.keys() | ||||
|         shotnumbers.sort() | ||||
|         for index, shotnumber in enumerate(shotnumbers): | ||||
|             self.mainUI.comboBox_shots.insertItem(index, 'Shot: %s'%shotnumber) | ||||
|         self.mainUI.comboBox_shots.setMaxCount(len(shotnumbers)) | ||||
| 
 | ||||
|     def increaseShotnumber(self): | ||||
|         currentIndex = self.mainUI.comboBox_shots.currentIndex() | ||||
|         maxindex = self.mainUI.comboBox_shots.maxCount() - 1 | ||||
|         if currentIndex == maxindex: | ||||
|             self.mainUI.comboBox_shots.setCurrentIndex(0) | ||||
|         else: | ||||
|             self.mainUI.comboBox_shots.setCurrentIndex(currentIndex + 1) | ||||
| 
 | ||||
|     def decreaseShotnumber(self): | ||||
|         currentIndex = self.mainUI.comboBox_shots.currentIndex() | ||||
|         maxindex = self.mainUI.comboBox_shots.maxCount() - 1 | ||||
|         if currentIndex == 0: | ||||
|             self.mainUI.comboBox_shots.setCurrentIndex(maxindex) | ||||
|         else: | ||||
|             self.mainUI.comboBox_shots.setCurrentIndex(currentIndex - 1) | ||||
| 
 | ||||
|          | ||||
|     def plotShot(self): | ||||
|         shotnumber = int(self.mainUI.comboBox_shots.currentText().split()[1]) | ||||
|         self.survey.data[shotnumber].matshow() | ||||
| 
 | ||||
|     def addArrayAxes(self): | ||||
|         self.seisArrayAx = self.seisArrayFigure.add_subplot(111) | ||||
| 
 | ||||
|     def addSurfaceAxes(self): | ||||
|         self.surfaceAx = self.surfaceFigure.add_subplot(111, projection = '3d') | ||||
| 
 | ||||
|     def addStatAxes(self): | ||||
|         self.statAx_left = self.statFigure_left.add_subplot(111) | ||||
|         self.statAx_right = self.statFigure_right.add_subplot(111) | ||||
| 
 | ||||
|     def enablePickedTools(self, bool, twoDim = False): | ||||
|         self.mainUI.comboBox_stats.setEnabled(bool) | ||||
|         self.statToolbar_left.setEnabled(bool) | ||||
|         self.statToolbar_right.setEnabled(bool) | ||||
|         if not twoDim: | ||||
|             self.mainUI.comboBox_shots.setEnabled(bool) | ||||
|             self.mainUI.shot_left.setEnabled(bool) | ||||
|             self.mainUI.shot_right.setEnabled(bool) | ||||
|             self.mainUI.plot_shot.setEnabled(bool) | ||||
|         if bool == False: | ||||
|             self.mainUI.comboBox_shots.clear() | ||||
| 
 | ||||
|     def replotArray(self): | ||||
|         self.seisArrayFigure.clf() | ||||
|         self.addArrayAxes() | ||||
|         self.plotArray() | ||||
|         self.seisArrayCanvas.draw() | ||||
| 
 | ||||
|     def replotSurface(self): | ||||
|         self.surfaceFigure.clf() | ||||
|         self.addSurfaceAxes() | ||||
|         self.plotSurface() | ||||
|         self.surfaceCanvas.draw() | ||||
| 
 | ||||
|     def plotArray(self): | ||||
|         self.seisarray.plotArray2D(self.seisArrayAx, highlight_measured = True, plot_topo = True, twoDim = self.seisarray.twoDim) | ||||
| 
 | ||||
|     def plotSurface(self): | ||||
|         if not self.seisarray.twoDim: | ||||
|             self.seisarray.plotSurface3D(ax = self.surfaceAx, exag = True) | ||||
|         self.seisarray.plotArray3D(ax = self.surfaceAx, legend = False, markersize = 3) | ||||
| 
 | ||||
|     def InitPickedWidgets(self): | ||||
|         if self.checkPickState(): | ||||
|             surveyUtils.plotScatterStats4Receivers(self.survey, self.mainUI.comboBox_stats.currentText(), | ||||
|                                                    self.statAx_left, twoDim = self.survey.twoDim) | ||||
|             surveyUtils.plotScatterStats4Shots(self.survey, self.mainUI.comboBox_stats.currentText(), | ||||
|                                                self.statAx_right, twoDim = self.survey.twoDim) | ||||
|             self.addItems2ShotsComboBox() | ||||
| 
 | ||||
|     def refreshPickedWidgets(self): | ||||
|         self.statFigure_left.clf() | ||||
|         self.statFigure_right.clf() | ||||
|         self.addStatAxes() | ||||
|         self.InitPickedWidgets() | ||||
|         self.statCanvas_left.draw() | ||||
|         self.statCanvas_right.draw() | ||||
| 
 | ||||
|     def printSurveyTextbox(self, init = True): | ||||
|         if init == True: | ||||
|             surveytup = (0, 0, 0, 0) | ||||
|         else: | ||||
|             survey = self.survey | ||||
|             nshots = len(survey.getShotlist()) | ||||
|             tt = survey.countAllTraces() | ||||
|             pt = survey.countAllPickedTraces() | ||||
|             rate = float(pt) / float(tt) * 100 | ||||
|             surveytup = (nshots, tt, pt, rate) | ||||
|         surveyTitle = 'SURVEY:\n' | ||||
|         surveyText = 'Number of Sources: %s\nTotal Traces: %s\nPicked Traces: %s (%4.2f%%)'%surveytup | ||||
|         string = surveyTitle + surveyText | ||||
|         self.mainUI.textBox_survey.setText(string) | ||||
| 
 | ||||
|     def printSeisArrayTextbox(self, init = True): | ||||
|         if init == True: | ||||
|             seistup = (0, 0, 0) | ||||
|         else: | ||||
|             seisarray = self.seisarray | ||||
|             nshots = len(seisarray.getSourceCoordinates()) | ||||
|             nrec = len(seisarray.getReceiverCoordinates()) | ||||
|             nadd = len(seisarray.getMeasuredTopo()) | ||||
|             seistup = (nshots, nrec, nadd) | ||||
|         seisArrayTitle = 'SEISARRAY:\n' | ||||
|         seisArrayText = 'Sources: %s\nReceivers: %s\nAdditional Points:%s'%seistup | ||||
|         string = seisArrayTitle + seisArrayText | ||||
|         self.mainUI.textBox_seisarray.setText(string) | ||||
| 
 | ||||
|     def interpolate_receivers(self): | ||||
|         if not self.checkSeisArrayState(): | ||||
|             printDialogMessage('No Seismic Array defined.') | ||||
|             return | ||||
|         self.seisarray.interpolateAll() | ||||
|         self.refreshSeisArrayWidgets() | ||||
| 
 | ||||
|     def refreshSeisArrayWidgets(self): | ||||
|         self.replotArray() | ||||
|         self.replotSurface() | ||||
|         self.printSeisArrayTextbox(init = False) | ||||
| 
 | ||||
|          | ||||
|     def connect2Survey(self): | ||||
|         if not self.checkSurveyState(): | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         if not self.checkSeisArrayState(): | ||||
|             printDialogMessage('Got no Seismic Array.') | ||||
|             return | ||||
|         if self.checkConnected2SurveyState(): | ||||
|             if not continueDialogMessage('Existing Survey already got Seismic Array object. Continue?'): | ||||
|                 return | ||||
|         self.survey.seisarray = self.seisarray | ||||
|         self.setConnected2SurveyState(True) | ||||
|         self.survey._initiate_SRfiles() | ||||
|         self.printSurveyTextbox(init = False) | ||||
|         print('Connected Seismic Array to active Survey object.') | ||||
| 
 | ||||
|     def startPicker(self): | ||||
|         if not self.checkSurveyState(): | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         if self.checkPickState(): | ||||
|             if not continueDialogMessage('Survey already picked. Continue?'): | ||||
|                 return | ||||
| 
 | ||||
|         if self.autopicker is None: | ||||
|             self.autopicker = Call_autopicker(self.mainwindow, self.survey) | ||||
|         else: | ||||
|             self.autopicker.start_dialog() | ||||
|             self.autopicker.update_survey(self.survey) | ||||
|          | ||||
|         if self.autopicker.executed: | ||||
|             self.setPickState(True) | ||||
|             self.printSurveyTextbox(init = False) | ||||
| 
 | ||||
|     def startFMTOMO(self): | ||||
|         if not self.checkSurveyState(): | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         if not self.checkPickState(): | ||||
|             printDialogMessage('Survey not picked.') | ||||
|             return | ||||
| 
 | ||||
|         if self.fmtomo is None: | ||||
|             self.fmtomo = Call_FMTOMO(self.mainwindow, self.survey) | ||||
|         else: | ||||
|             self.fmtomo.start_dialog() | ||||
|             self.fmtomo.update_survey(self.survey) | ||||
| 
 | ||||
|         #if self.fmtomo.executed: | ||||
|          | ||||
| 
 | ||||
|     def startVTKtools(self): | ||||
|         if self.vtktools is None: | ||||
|             self.vtktools = Call_VTK_dialog(self.mainwindow) | ||||
|         else: | ||||
|             self.vtktools.start_dialog() | ||||
| 
 | ||||
|     def postprocessing(self): | ||||
|         if not self.checkSurveyState(): | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         self.postprocessing = Postprocessing(self.mainwindow, self.survey) | ||||
|         #self.survey.plotAllPicks() | ||||
|         #self.refreshPickedWidgets() # wait until finished | ||||
| 
 | ||||
|          | ||||
|     def load_survey(self): | ||||
|         if self.checkSurveyState(): | ||||
|             if not continueDialogExists('Survey'): | ||||
|                 return | ||||
|         filename = openFile() | ||||
|         if filename is None: | ||||
|             return | ||||
|         try: | ||||
|             survey = activeSeismoPick.Survey.from_pickle(filename) | ||||
|         except: | ||||
|             printDialogMessage('Could not load object %s.'%filename) | ||||
|             return | ||||
|         if not type(survey) == activeSeismoPick.Survey: | ||||
|             printDialogMessage('Wrong input file of type %s, expected %s.' | ||||
|                   %(type(survey), activeSeismoPick.Survey)) | ||||
|             return | ||||
|         if self.checkSeisArrayState() and survey.seisarray is not None: | ||||
|             if not continueDialogMessage('Survey got existing Seismic Array.' | ||||
|                                               ' Do you want to overwrite the current Seismic Array?'): | ||||
|                 return | ||||
|         self.survey = survey | ||||
|         self.setSurveyState(True) | ||||
|         if self.survey.picked: | ||||
|             self.setPickState(True) | ||||
|         else: | ||||
|             self.setPickState(False) | ||||
|         if self.survey.seisarray != None: | ||||
|             self.seisarray = self.survey.seisarray | ||||
|             self.setConnected2SurveyState(True) | ||||
|             self.setSeisArrayState(True) | ||||
|             printDialogMessage('Loaded Survey with active Seismic Array.') | ||||
|         else: | ||||
|             self.setConnected2SurveyState(False) | ||||
|             self.setSeisArrayState(False) | ||||
|             printDialogMessage('Loaded Survey.') | ||||
| 
 | ||||
|     def load_seisarray(self): | ||||
|         disconnect = False | ||||
|         if self.checkSeisArrayState(): | ||||
|             if not continueDialogExists('Seismic Array'): | ||||
|                 return | ||||
|         if self.checkConnected2SurveyState(): | ||||
|             if not continueDialogMessage('Seismic Array connected to present Survey.\n' | ||||
|                                               'Continuation will disconnect the Seismic Array.'): | ||||
|                 return | ||||
|             else: | ||||
|                 self.survey.seisarray = None | ||||
|                 disconnect = True | ||||
| 
 | ||||
|         filename = openFile() | ||||
|         if filename is None: | ||||
|             return | ||||
|         try: | ||||
|             seisarray = seismicArrayPreparation.SeisArray.from_pickle(filename) | ||||
|         except: | ||||
|             printDialogMessage('Could not load object %s.'%filename) | ||||
|             return | ||||
|         if not type(seisarray) == seismicArrayPreparation.SeisArray: | ||||
|             printDialogMessage('Wrong input file of type %s, expected %s.' | ||||
|                   %(type(seisarray), seismicArrayPreparation.SeisArray)) | ||||
|             return | ||||
|         if disconnect: | ||||
|             self.setConnected2SurveyState(False) | ||||
|         self.seisarray = seisarray | ||||
|         self.setSeisArrayState(True) | ||||
| 
 | ||||
|     def save_seisarray(self): | ||||
|         if not self.checkSeisArrayState(): | ||||
|             printDialogMessage('No Seismic Array defined.') | ||||
|             return | ||||
|         filename = saveFile() | ||||
|         if filename is None: | ||||
|             return | ||||
|         self.seisarray.saveSeisArray(filename) | ||||
| 
 | ||||
|     def save_survey(self): | ||||
|         if not self.checkSurveyState(): | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         filename = saveFile() | ||||
|         if filename is None: | ||||
|             return | ||||
|         self.survey.saveSurvey(filename) | ||||
| 
 | ||||
|     def setSurveyState(self, state): | ||||
|         if state == True: | ||||
|             self.mainUI.survey_active.setPixmap(self.applypixmap) | ||||
|             self.printSurveyTextbox(init = False) | ||||
|         elif state == False: | ||||
|             self.mainUI.survey_active.setPixmap(self.cancelpixmap) | ||||
| 
 | ||||
|     def checkSurveyState(self): | ||||
|         if self.survey == None: | ||||
|             return False | ||||
|         else: | ||||
|             return True | ||||
| 
 | ||||
|     def checkSeisArrayState(self): | ||||
|         if self.seisarray == None: | ||||
|             return False | ||||
|         else: | ||||
|             return True | ||||
| 
 | ||||
|     def setPickState(self, state): | ||||
|         if state == True and self.checkSurveyState(): | ||||
|             self.mainUI.picked_active.setPixmap(self.applypixmap) | ||||
|             self.refreshPickedWidgets() | ||||
|             self.enablePickedTools(True, self.survey.twoDim) | ||||
|             self.survey.picked = True | ||||
|         elif state == True and self.checkSurveyState() is False: | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         elif state == False: | ||||
|             self.mainUI.picked_active.setPixmap(self.cancelpixmap) | ||||
|             if self.checkSurveyState(): | ||||
|                 self.statFigure_left.clf() | ||||
|                 self.statFigure_right.clf() | ||||
|                 self.enablePickedTools(False) | ||||
|                 self.survey.picked = False | ||||
| 
 | ||||
|     def setSeisArrayState(self, state): | ||||
|         if state == True: | ||||
|             self.mainUI.seisarray_active.setPixmap(self.applypixmap) | ||||
|             self.refreshSeisArrayWidgets() | ||||
|             self.seisArrayToolbar.setEnabled(True) | ||||
|         elif state == False: | ||||
|             self.mainUI.seisarray_active.setPixmap(self.cancelpixmap) | ||||
|             self.seisArrayToolbar.setEnabled(False) | ||||
|             if self.seisArrayFigure is not None: | ||||
|                 self.seisArrayFigure.clf() | ||||
| 
 | ||||
|     def setConnected2SurveyState(self, state): | ||||
|         if state == True: | ||||
|             self.mainUI.seisarray_on_survey_active.setPixmap(self.applypixmap) | ||||
|         elif state == False: | ||||
|             self.mainUI.seisarray_on_survey_active.setPixmap(self.cancelpixmap) | ||||
| 
 | ||||
|     def checkConnected2SurveyState(self): | ||||
|         if self.checkSurveyState(): | ||||
|             if self.survey.seisarray != None: | ||||
|                 return True | ||||
|         else: | ||||
|             return False | ||||
| 
 | ||||
|     def checkPickState(self): | ||||
|         if not self.survey: | ||||
|             printDialogMessage('No Survey defined.') | ||||
|             return | ||||
|         return self.survey.picked | ||||
| 
 | ||||
|     def exitApp(self): | ||||
|         if self.checkSurveyState(): | ||||
|             if continueDialogMessage('Do you want to save the current Survey?'): | ||||
|                 self.save_survey() | ||||
|             else: | ||||
|                 return | ||||
|         QtCore.QCoreApplication.instance().quit() | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == "__main__": | ||||
|     app = QtGui.QApplication(sys.argv) | ||||
|     MainWindow = QtGui.QMainWindow() | ||||
|     ui = Ui_MainWindow() | ||||
|     ui.setupUi(MainWindow) | ||||
|     MainWindow.showMaximized() | ||||
|     gui = gui_control() | ||||
|     sys.exit(app.exec_()) | ||||
| 
 | ||||
| @ -1,2 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| __author__ = 'marcel' | ||||
| @ -1,779 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| import os | ||||
| import sys | ||||
| import math | ||||
| import numpy as np | ||||
| from pylot.core.active import seismicshot | ||||
| from pylot.core.active.surveyUtils import cleanUp | ||||
| from pylot.core.util.utils import worker, _pickle_method | ||||
| 
 | ||||
| def picker(shot): | ||||
|     picks = [] | ||||
|     for traceID in shot.getTraceIDlist(): | ||||
|         picks.append((shot.getShotnumber(), traceID, shot.pickTrace(traceID))) | ||||
|     return picks | ||||
| 
 | ||||
| class Survey(object): | ||||
|     def __init__(self, path, sourcefile = None, receiverfile = None, seisArray = None, useDefaultParas=False, fstart = None, fend = None): | ||||
|         ''' | ||||
|         The Survey Class contains all shots [class: Seismicshot] of a survey | ||||
|         as well as the aquisition geometry and the topography. | ||||
| 
 | ||||
|         It contains methods to pick all traces of all shots. | ||||
| 
 | ||||
|         It contains several methods e.g. for plotting of all picks (and postprocessing), | ||||
|         creating plots for all shots. | ||||
|         ''' | ||||
|         self.data = {} | ||||
|         self.seisarray = seisArray | ||||
|         self._topography = None | ||||
|         self._recfile = receiverfile | ||||
|         self._sourcefile = sourcefile | ||||
|         self._obsdir = path | ||||
|         self._generateSurvey(fstart, fend) | ||||
|         self._initiate_SRfiles() | ||||
|         if useDefaultParas == True: | ||||
|             self.setParametersForAllShots() | ||||
|         self._removeAllEmptyTraces() | ||||
|         self._updateShots() | ||||
|         self.picked = False | ||||
| 
 | ||||
|     def _coordsFromSeisArray(self): | ||||
|         self._receiverCoords = self.seisarray.getReceiverCoordinates() | ||||
|         self._sourceCoords = self.seisarray.getSourceCoordinates() | ||||
| 
 | ||||
|     def _coordsFromFiles(self): | ||||
|         self._receiversFromFile() | ||||
|         self._sourcesFromFile() | ||||
| 
 | ||||
|     def _receiversFromFile(self): | ||||
|         self._receiverCoords = {} | ||||
|         reclist = open(self.getReceiverfile(), 'r').readlines() | ||||
|         for line in reclist: | ||||
|             line = line.split() | ||||
|             traceID = int(line[0]) | ||||
|             x = float(line[1]) | ||||
|             y = float(line[2]) | ||||
|             z = float(line[3]) | ||||
|             self._receiverCoords[traceID] = (x, y, z) | ||||
| 
 | ||||
|     def _sourcesFromFile(self): | ||||
|         self._sourceCoords = {} | ||||
|         reclist = open(self.getSourcefile(), 'r').readlines() | ||||
|         for line in reclist: | ||||
|             line = line.split() | ||||
|             sourceID = int(line[0]) | ||||
|             x = float(line[1]) | ||||
|             y = float(line[2]) | ||||
|             z = float(line[3]) | ||||
|             self._sourceCoords[sourceID] = (x, y, z) | ||||
| 
 | ||||
|     def _initiate_SRfiles(self): | ||||
|         if self._recfile == None and self._sourcefile == None: | ||||
|             if self.seisarray == None: | ||||
|                 raise RuntimeError('No SeisArray defined. No source or receiver file given.') | ||||
|             self._coordsFromSeisArray() | ||||
|         else: | ||||
|             self._coordsFromFiles() | ||||
|             self.loadArray(self._obsdir, self._recfile, self._sourcefile) | ||||
|         for shotnumber in self.data.keys(): | ||||
|             shot = self.data[shotnumber] | ||||
|             shot.setShotnumber(shotnumber) | ||||
|             shot.setReceiverCoords(self._receiverCoords) | ||||
|             shot.setSourceCoords(self._sourceCoords[shotnumber]) | ||||
| 
 | ||||
|     def _generateSurvey(self, fstart = None, fend = None): | ||||
|         from obspy.core import read | ||||
| 
 | ||||
|         shot_dict = {} | ||||
|         shotlist = self.getShotlist() | ||||
|         for shotnumber in shotlist:  # loop over data files | ||||
|             # generate filenames and read manual picks to a list | ||||
|             #fileending = '.sg2' | ||||
|             if fend == None: | ||||
|                 fend = '_pickle.dat' | ||||
|             obsfile = os.path.join(self._obsdir, fstart + str(shotnumber)) + fend | ||||
|             if obsfile not in shot_dict.keys(): | ||||
|                 shot_dict[shotnumber] = [] | ||||
|             shot_dict[shotnumber] = seismicshot.SeismicShot(obsfile) | ||||
|             shot_dict[shotnumber].setParameters('shotnumber', shotnumber) | ||||
| 
 | ||||
|         if self._check2D(): | ||||
|             print('Survey is two dimensional!') | ||||
|             self.twoDim = True | ||||
|         else: | ||||
|             self.twoDim = False | ||||
|         self.data = shot_dict | ||||
|         print ("Generated Survey object for %d shots" % len(shotlist)) | ||||
|         print ("Total number of traces: %d \n" % self.countAllTraces()) | ||||
| 
 | ||||
|     def _removeAllEmptyTraces(self): | ||||
|         ''' | ||||
|         Removes traces of the dataset that are not found in the input receiver files. | ||||
|         ''' | ||||
|         logfile = 'removeEmptyTraces.out' | ||||
|         count = 0 | ||||
|         for shot in self.data.values(): | ||||
|             removed = shot.removeEmptyTraces() | ||||
|             if removed is not None: | ||||
|                 if count == 0: outfile = open(logfile, 'w') | ||||
|                 count += 1 | ||||
|                 outfile.writelines('shot: %s, removed empty traces: %s\n' | ||||
|                                    % (shot.getShotnumber(), removed)) | ||||
|         print ("\nremoveEmptyTraces: Finished! Removed %d traces" % count) | ||||
|         if count > 0: | ||||
|             print ("See %s for more information " | ||||
|                    "on removed traces." % (logfile)) | ||||
|             outfile.close() | ||||
| 
 | ||||
|     def _updateShots(self): | ||||
|         ''' | ||||
|         Removes traces that do not exist in the dataset for any reason, | ||||
|         but were set in the input files. | ||||
|         ''' | ||||
|         logfile = 'updateShots.out' | ||||
|         count = 0 | ||||
|         countTraces = 0 | ||||
|         for shot in self.data.values(): | ||||
|             del_traceIDs = shot.updateTraceList() | ||||
|             if len(del_traceIDs) > 0: | ||||
|                 if count == 0: outfile = open(logfile, 'w') | ||||
|                 count += 1 | ||||
|                 countTraces += len(del_traceIDs) | ||||
|                 outfile.writelines("shot: %s, removed traceID(s) %s because " | ||||
|                                    "they were not found in the corresponding stream\n" | ||||
|                                    % (shot.getShotnumber(), del_traceIDs)) | ||||
| 
 | ||||
|         print ("\nupdateShots: Finished! Updated %d shots and removed " | ||||
|                "%d traces" % (count, countTraces)) | ||||
|         if count > 0: | ||||
|             print ("See %s for more information " | ||||
|                    "on removed traces." % (logfile)) | ||||
|             outfile.close() | ||||
| 
 | ||||
|     def _check2D(self): | ||||
|         if self.seisarray is None: | ||||
|             print('Check2D: No SeisArray defined') | ||||
|             return | ||||
|         if self.seisarray.check2D(): | ||||
|             return True | ||||
|         else: | ||||
|             return False | ||||
| 
 | ||||
|     def updateSeisArray(self, SeisArray): | ||||
|         if not type(SeisArray) == pylot.core.active.seismicArrayPreparation.SeisArray: | ||||
|             print('Wrong data type.') | ||||
|             return | ||||
|         self.seisarray = SeisArray | ||||
|         self._initiate_SRfiles() | ||||
|          | ||||
|     def setParametersForAllShots(self, cutwindow=(0, 0.2), tmovwind=0.3, | ||||
|                                  tsignal=0.03, tgap=0.0007): | ||||
|         if (cutwindow == (0, 0.2) and tmovwind == 0.3 and | ||||
|                     tsignal == 0.03 and tgap == 0.0007): | ||||
|             print ("Warning: Standard values used for " | ||||
|                    "setParamters. This might not be clever.") | ||||
|         for shot in self.data.values(): | ||||
|             shot.setCut(cutwindow) | ||||
|             shot.setTmovwind(tmovwind) | ||||
|             shot.setTsignal(tsignal) | ||||
|             shot.setTgap(tgap) | ||||
|             shot.setOrder(order=4) | ||||
|         print ("setParametersForAllShots: Parameters set to:\n" | ||||
|                "cutwindow = %s, tMovingWindow = %f, tsignal = %f, tgap = %f" | ||||
|                % (cutwindow, tmovwind, tsignal, tgap)) | ||||
| 
 | ||||
| 
 | ||||
|     def loadArrayFromPickle(self, filename): | ||||
|         from pylot.core.active.seismicArrayPreparation import SeisArray | ||||
|         array = SeisArray.from_pickle(filename) | ||||
|         self.seisarray = array | ||||
| 
 | ||||
|     def loadArray(self, path, receiverfile, sourcefile): | ||||
|         from pylot.core.active.seismicArrayPreparation import SeisArray | ||||
| 
 | ||||
|         array = SeisArray(os.path.join(path, receiverfile)) | ||||
|         array.addSourceLocations(os.path.join(path, sourcefile)) | ||||
|         self.seisarray = array | ||||
| 
 | ||||
|     def setManualPicksFromFiles(self, directory='picks'): | ||||
|         ''' | ||||
|         Read manual picks from *.pck files in a directory. | ||||
|         Can be used for comparison of automatic and manual picks. | ||||
| 
 | ||||
|         The * must be identical with the shotnumber. | ||||
|         ''' | ||||
|         for shot in self.data.values(): | ||||
|             shot.setManualPicksFromFile(directory) | ||||
| 
 | ||||
|     def getDiffsFromManual(self): | ||||
|         ''' | ||||
|         Returns a dictionary with the differences between manual and automatic pick for all shots. | ||||
|         Key: Seismicshot [object] | ||||
|         ''' | ||||
|         diffs = {} | ||||
|         for shot in self.data.values(): | ||||
|             if not shot in diffs.keys(): | ||||
|                 diffs[shot] = {} | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) == 1 and shot.getManualPickFlag( | ||||
|                         traceID) == 1: | ||||
|                     diffs[shot][traceID] = shot.getPick( | ||||
|                         traceID) - shot.getManualPick(traceID) | ||||
|         return diffs | ||||
| 
 | ||||
|     def plotDiffs(self): | ||||
|         ''' | ||||
|         Creates a plot of all Picks colored by the | ||||
|         difference between automatic and manual pick. | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         diffs = [] | ||||
|         dists = [] | ||||
|         mpicks = [] | ||||
|         picks = [] | ||||
|         diffsDic = self.getDiffsFromManual() | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) == 1 and shot.getManualPickFlag( | ||||
|                         traceID) == 1: | ||||
|                     dists.append(shot.getDistance(traceID)) | ||||
|                     mpicks.append(shot.getManualPick(traceID)) | ||||
|                     picks.append(shot.getPick(traceID)) | ||||
|                     diffs.append(diffsDic[shot][traceID]) | ||||
| 
 | ||||
|         labelm = 'manual picks' | ||||
|         labela = 'automatic picks' | ||||
| 
 | ||||
|         fig = plt.figure() | ||||
|         ax = fig.add_subplot(111) | ||||
| 
 | ||||
|         sc_a = ax.scatter(dists, picks, c='0.5', s=10, edgecolors='none', | ||||
|                           label=labela, alpha=0.3) | ||||
|         sc = ax.scatter(dists, mpicks, c=diffs, s=5, edgecolors='none', | ||||
|                         label=labelm) | ||||
|         cbar = plt.colorbar(sc, fraction=0.05) | ||||
|         cbar.set_label(labelm) | ||||
|         ax.set_xlabel('Distance [m]') | ||||
|         ax.set_ylabel('Time [s]') | ||||
|         ax.text(0.5, 0.95, 'Plot of all MANUAL picks', transform=ax.transAxes, | ||||
|                 horizontalalignment='center') | ||||
|         plt.legend() | ||||
| 
 | ||||
|     def plotHist(self, nbins=20, ax=None): | ||||
|         ''' | ||||
|         Plot a histogram of the difference between automatic and manual picks. | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         plt.interactive(True) | ||||
|         diffs = [] | ||||
|         if ax == None: | ||||
|             fig = plt.figure() | ||||
|             ax = fig.add_subplot(111) | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) == 1 and shot.getManualPickFlag( | ||||
|                         traceID) == 1: | ||||
|                     diffs.append(self.getDiffsFromManual()[shot][traceID]) | ||||
|         hist = plt.hist(diffs, nbins, histtype='step', normed=True, | ||||
|                         stacked=True) | ||||
|         plt.title( | ||||
|             'Histogram of the differences between automatic and manual pick') | ||||
|         plt.xlabel('Difference in time (auto - manual) [s]') | ||||
|         return diffs | ||||
| 
 | ||||
|     def pickAllShots(self, vmin=333, vmax=5500, folm=0.6, HosAic='hos', | ||||
|                      aicwindow=(15, 0), cores = 1): | ||||
|         ''' | ||||
|         Automatically pick all traces of all shots of the survey. | ||||
| 
 | ||||
|         :param: vmin, vmax, minimum (maximum) permitted apparent velocity on direct path between src and rec | ||||
|         :type: real | ||||
| 
 | ||||
|         :param: folm, fraction of local maximum for HOS pick (0.6 = 60% of the highest maximum) | ||||
|         :type: real | ||||
| 
 | ||||
|         :param: HosAic, pick with hos only ('hos') or use AIC ('aic') | ||||
|         :type: string | ||||
| 
 | ||||
|         :param: aicwindow, window around the initial pick to search for local AIC min (samples) | ||||
|         :type: tuple | ||||
|         ''' | ||||
|         from datetime import datetime | ||||
|         starttime = datetime.now() | ||||
|         count = 0 | ||||
|         tpicksum = starttime - starttime | ||||
| 
 | ||||
|         shotlist = [] | ||||
| 
 | ||||
|         print('pickAllShots: Setting pick parameters...') | ||||
|         for shot in self.data.values(): | ||||
|             tstartpick = datetime.now() | ||||
|             shot.setVmin(vmin) | ||||
|             shot.setVmax(vmax) | ||||
|             count += 1 | ||||
|             shot.setPickParameters(folm = folm, method = HosAic, aicwindow = aicwindow) | ||||
|             shotlist.append(shot) | ||||
| 
 | ||||
|         print('pickAllShots: Starting to pick...') | ||||
|         if cores > 1: | ||||
|             print('Picking parallel on %s cores.'%cores) | ||||
|             picks = worker(picker, shotlist, cores) | ||||
|         elif cores == 1: | ||||
|             print('Picking serial on one core.') | ||||
|             picks = [] | ||||
|             for shot in shotlist: | ||||
|                 picks.append(picker(shot)) | ||||
|         else: | ||||
|             raise ValueError('cores must be >= 1') | ||||
|         print('Done!') | ||||
| 
 | ||||
|         for shot in picks: | ||||
|             for item in shot: | ||||
|                 shotnumber, traceID, pick = item | ||||
|                 self.getShotForShotnumber(shotnumber).setPick(traceID, pick) | ||||
|              | ||||
|             # tpicksum += (datetime.now() - tstartpick); | ||||
|             # tpick = tpicksum / count | ||||
|             # tremain = (tpick * (len(self.getShotDict()) - count)) | ||||
|             # tend = datetime.now() + tremain | ||||
|             # progress = float(count) / float(len(self.getShotDict())) * 100 | ||||
|             # self._update_progress(shot.getShotname(), tend, progress) | ||||
|          | ||||
|         self.filterSNR() | ||||
|         self.setEarllate() | ||||
| 
 | ||||
|         print('\npickAllShots: Finished\n') | ||||
|         self.picked = True | ||||
|         ntraces = self.countAllTraces() | ||||
|         pickedtraces = self.countAllPickedTraces() | ||||
|         print('Picked %s / %s traces (%d %%)\n' | ||||
|               % (pickedtraces, ntraces, | ||||
|                  float(pickedtraces) / float(ntraces) * 100.)) | ||||
| 
 | ||||
|     def filterSNR(self): | ||||
|         print('Starting filterSNR...') | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 shot.setSNR(traceID) | ||||
|                 # if shot.getSNR(traceID)[0] < snrthreshold: | ||||
|                 if shot.getPick(traceID) <= 0: | ||||
|                     shot.removePick(traceID) | ||||
|                 if shot.getSNR(traceID)[0] < shot.getSNRthreshold(traceID): | ||||
|                     shot.removePick(traceID) | ||||
| 
 | ||||
|     def setEarllate(self): | ||||
|         print('Starting setEarllate...') | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 # set epp and lpp if SNR > 1 (else earllatepicker cant set values) | ||||
|                 if shot.getSNR(traceID)[0] > 1: | ||||
|                     shot.setEarllatepick(traceID) | ||||
| 
 | ||||
|     def cleanBySPE(self, maxSPE): | ||||
|         ''' | ||||
|         Sets all picks as invalid if they exceed a certain value of the symmetric pick error. | ||||
|         ''' | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) == 1: | ||||
|                     if shot.getSymmetricPickError(traceID) > maxSPE: | ||||
|                         shot.setPickFlag(traceID, 0) | ||||
| 
 | ||||
|     def plotSPE(self): | ||||
|         ''' | ||||
|         Plots the symmetric pick error sorted by magnitude. | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         spe = [] | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) == 1: | ||||
|                     spe.append(shot.getSymmetricPickError(traceID)) | ||||
|         spe.sort() | ||||
|         plt.plot(spe, label='SPE') | ||||
|         plt.ylabel('Symmetric Pickerror') | ||||
|         plt.legend() | ||||
| 
 | ||||
|     def recover(self): | ||||
|         ''' | ||||
|         Recovers all manually removed picks. Still regards SNR threshold. | ||||
|         ''' | ||||
|         print('Recovering survey...') | ||||
|         numpicks = 0 | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) == 0: | ||||
|                     shot.setPickFlag(traceID, 1) | ||||
|                     if shot.getSNR(traceID)[0] < shot.getSNRthreshold(traceID): | ||||
|                         shot.removePick(traceID) | ||||
|                     else: | ||||
|                         numpicks += 1 | ||||
|         print('Recovered %d picks' % numpicks) | ||||
| 
 | ||||
|     def setArtificialPick(self, traceID, pick): | ||||
|         ''' | ||||
|         Sets an artificial pick for a certain receiver (traceID) for all shots. | ||||
|         ''' | ||||
|         for shot in self.data.values(): | ||||
|             shot.setPick(traceID, pick) | ||||
|             shot.setPickwindow(traceID, shot.getCut()) | ||||
| 
 | ||||
|     def countAllTraces(self): | ||||
|         ''' | ||||
|         Returns the number of traces in total. | ||||
|         ''' | ||||
|         numtraces = 0 | ||||
|         for shot in self.getShotlist(): | ||||
|             for rec in self.getReceiverlist(): | ||||
|                 numtraces += 1 | ||||
| 
 | ||||
|         return numtraces | ||||
| 
 | ||||
|     def getShotlist(self): | ||||
|         ''' | ||||
|         Returns a list of all shotnumbers contained in the set Sourcefile. | ||||
|         ''' | ||||
|         if self._recfile == None and self._sourcefile == None: | ||||
|             if self.seisarray == None: | ||||
|                 raise RuntimeError('No SeisArray defined. No source or receiver file given.') | ||||
|             return self.seisarray.getSourceCoordinates().keys() | ||||
| 
 | ||||
|         filename = self.getSourcefile() | ||||
|         srcfile = open(filename, 'r') | ||||
|         shotlist = [] | ||||
|         for line in srcfile.readlines(): | ||||
|             line = line.split() | ||||
|             shotlist.append(int(line[0])) | ||||
| 
 | ||||
|         return shotlist | ||||
| 
 | ||||
|     def getReceiverlist(self): | ||||
|         ''' | ||||
|         Returns a list of all trace IDs contained in the set Receiverfile. | ||||
|         ''' | ||||
|         if self._recfile == None and self._sourcefile == None: | ||||
|             if self.seisarray == None: | ||||
|                 raise RuntimeError('No SeisArray defined. No source or receiver file given.') | ||||
|             return self.seisarray.getReceiverCoordinates().keys() | ||||
| 
 | ||||
|         filename = self.getReceiverfile() | ||||
|         recfile = open(filename, 'r') | ||||
|         reclist = [] | ||||
|         for line in recfile.readlines(): | ||||
|             line = line.split() | ||||
|             reclist.append(int(line[0])) | ||||
| 
 | ||||
|         return reclist | ||||
| 
 | ||||
|     def getShotDict(self): | ||||
|         return self.data | ||||
| 
 | ||||
|     def getShot(self, shotnumber): | ||||
|         return self.data[shotnumber] | ||||
| 
 | ||||
|     def getSourcefile(self): | ||||
|         return self._sourcefile | ||||
| 
 | ||||
|     def getReceiverfile(self): | ||||
|         return self._recfile | ||||
| 
 | ||||
|     def getPath(self): | ||||
|         return self._obsdir | ||||
| 
 | ||||
|     def getStats(self): | ||||
|         ''' | ||||
|         Generates and returns a dictionary containing statistical information | ||||
|         of the survey. | ||||
|          | ||||
|         Key: shotnumber | ||||
|         ''' | ||||
|         info_dict = {} | ||||
|         for shot in self.data.values(): | ||||
|             pickedTraces = 0 | ||||
|             snrlist = [] | ||||
|             dist = [] | ||||
|             numtraces = len(shot.getTraceIDlist()) | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 snrlist.append(shot.getSNR(traceID)[0]) | ||||
|                 dist.append(shot.getDistance(traceID)) | ||||
|                 if shot.getPickFlag(traceID) is not 0: | ||||
|                     pickedTraces += 1 | ||||
|             info_dict[shot.getShotnumber()] = {'numtraces': numtraces, | ||||
|                                                'picked traces': [pickedTraces, | ||||
|                                                                  '%2.2f %%' % ( | ||||
|                                                                  float( | ||||
|                                                                      pickedTraces) / | ||||
|                                                                  float( | ||||
|                                                                      numtraces) * 100)], | ||||
|                                                'mean SNR': np.mean(snrlist), | ||||
|                                                'mean distance': np.mean(dist)} | ||||
| 
 | ||||
|         return info_dict | ||||
| 
 | ||||
|     def getShotForShotnumber(self, shotnumber): | ||||
|         ''' | ||||
|         Returns Seismicshot [object] of a certain shotnumber if possible. | ||||
|         ''' | ||||
|         for shot in self.data.values(): | ||||
|             if shot.getShotnumber() == shotnumber: | ||||
|                 return shot | ||||
| 
 | ||||
|     def exportFMTOMO(self, directory='FMTOMO_export', sourcefile='input_sf.in', | ||||
|                      ttFileExtension='.tt'): | ||||
|         ''' | ||||
|         Exports all picks into a directory as travel time files readable by FMTOMO obsdata. | ||||
|         ''' | ||||
| 
 | ||||
|         def getAngle(distance): | ||||
|             PI = np.pi | ||||
|             R = 6371. | ||||
|             angle = distance * 180 / (PI * R) | ||||
|             return angle | ||||
| 
 | ||||
|         count = 0 | ||||
|         fmtomo_factor = 1000  # transforming [m/s] -> [km/s] | ||||
|         LatAll = [] | ||||
|         LonAll = [] | ||||
|         DepthAll = [] | ||||
|         srcfile = open(directory + '/' + sourcefile, 'w') | ||||
|         srcfile.writelines('%10s\n' % len(self.data))  # number of sources | ||||
|         for shotnumber in self.getShotlist(): | ||||
|             shot = self.getShotForShotnumber(shotnumber) | ||||
|             ttfilename = str( | ||||
|                 shotnumber) + ttFileExtension  # filename of travel time file for this shot | ||||
|             (x, y, z) = shot.getSrcLoc()  # getSrcLoc returns (x, y, z) | ||||
|             srcfile.writelines('%10s %10s %10s\n' % ( | ||||
|             getAngle(y), getAngle(x), (-1) * z))  # transform to lat, lon, depth | ||||
|             LatAll.append(getAngle(y)) | ||||
|             LonAll.append(getAngle(x)) | ||||
|             DepthAll.append((-1) * z) | ||||
|             srcfile.writelines('%10s\n' % 1) | ||||
|             srcfile.writelines('%10s %10s %10s\n' % (1, 1, ttfilename)) | ||||
|             ttfile = open(directory + '/' + ttfilename, 'w') | ||||
|             traceIDlist = shot.getTraceIDlist() | ||||
|             traceIDlist.sort() | ||||
|             ttfile.writelines(str(self.countPickedTraces(shot)) + '\n') | ||||
|             for traceID in traceIDlist: | ||||
|                 if shot.getPickFlag(traceID) is not 0: | ||||
|                     pick = shot.getPick(traceID) * fmtomo_factor | ||||
|                     delta = shot.getSymmetricPickError(traceID) * fmtomo_factor | ||||
|                     (x, y, z) = shot.getRecLoc(traceID) | ||||
|                     ttfile.writelines('%20s %20s %20s %10s %10s\n' % ( | ||||
|                     getAngle(y), getAngle(x), (-1) * z, pick, delta)) | ||||
|                     LatAll.append(getAngle(y)) | ||||
|                     LonAll.append(getAngle(x)) | ||||
|                     DepthAll.append((-1) * z) | ||||
|                     count += 1 | ||||
|             ttfile.close() | ||||
|         srcfile.close() | ||||
|         msg = 'Wrote output for {0} traces\n' \ | ||||
|               'WARNING: output generated for FMTOMO-obsdata. Obsdata seems ' \ | ||||
|               'to take Lat, Lon, Depth and creates output for FMTOMO as ' \ | ||||
|               'Depth, Lat, Lon\nDimensions of the seismic Array, ' \ | ||||
|               'transformed for FMTOMO, are Depth({1}, {2}), Lat({3}, {4}), ' \ | ||||
|               'Lon({5}, {6})'.format(count, | ||||
|                                      min(DepthAll), | ||||
|                                      max(DepthAll), | ||||
|                                      min(LatAll), | ||||
|                                      max(LatAll), | ||||
|                                      min(LonAll), | ||||
|                                      max(LonAll)) | ||||
|         print(msg) | ||||
| 
 | ||||
|     def countPickedTraces(self, shot): | ||||
|         ''' | ||||
|         Counts all picked traces of a shot (type Seismicshot). | ||||
|         ''' | ||||
|         count = 0 | ||||
|         for traceID in shot.getTraceIDlist(): | ||||
|             if shot.getPickFlag(traceID) is not 0: | ||||
|                 count += 1 | ||||
|         return count | ||||
| 
 | ||||
|     def countAllPickedTraces(self): | ||||
|         ''' | ||||
|         Counts all picked traces of the survey. | ||||
|         ''' | ||||
|         count = 0 | ||||
|         if not self.picked: | ||||
|             return count | ||||
| 
 | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if shot.getPickFlag(traceID) is not 0: | ||||
|                     count += 1 | ||||
|         return count | ||||
| 
 | ||||
|     def plotAllShots(self, rows=3, columns=4, mode='3d'): | ||||
|         ''' | ||||
|         Plots all shots as Matrices with the color corresponding to the traveltime for each receiver. | ||||
|         IMPORTANT NOTE: Topography (z - coordinate) is not considered in the diagrams! | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         from mpl_toolkits.mplot3d import Axes3D | ||||
|         plt.interactive(True) | ||||
| 
 | ||||
|         fig = plt.figure() | ||||
|         ax = fig.add_subplot(111) | ||||
| 
 | ||||
|         figPerSubplot = columns * rows | ||||
| 
 | ||||
|         index = 1 | ||||
| 
 | ||||
|         for shotnumber in self.getShotlist(): | ||||
|             if index <= figPerSubplot: | ||||
|                 ax = fig.add_subplot(rows, columns, index) | ||||
|                 if mode == '3d': | ||||
|                     self.getShot(shotnumber).matshow(ax=ax, colorbar=False, | ||||
|                                                      annotations=True, | ||||
|                                                      legend=False) | ||||
|                 elif mode == '2d': | ||||
|                     self.getShot(shotnumber).plot2dttc(ax) | ||||
|                     self.getShot(shotnumber).plotmanual2dttc(ax) | ||||
|                 index += 1 | ||||
|             if index > figPerSubplot: | ||||
|                 fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0, | ||||
|                                     hspace=0) | ||||
|                 fig = plt.figure() | ||||
|                 index = 1 | ||||
| 
 | ||||
|         fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=0, | ||||
|                             hspace=0) | ||||
| 
 | ||||
|     def plotAllPicks(self, plotRemoved=False, colorByVal='log10SNR', ax=None, | ||||
|                      cbar=None, refreshPlot=False): | ||||
|         ''' | ||||
|         Plots all picks over the distance between source and receiver. Returns (ax, region). | ||||
|         Picks can be checked and removed by using region class (pylot.core.active.surveyPlotTools.regions) | ||||
| 
 | ||||
|         :param: plotRemoved, if True plots traces that were picked but removed from the survey (flag = 0) | ||||
|         :type: logical | ||||
| 
 | ||||
|         :param: colorByVal, can be "log10SNR", "pickerror", or "spe" | ||||
|         :type: str | ||||
| 
 | ||||
|         Examples: | ||||
| 
 | ||||
|         regions.chooseRectangles(): | ||||
|          - lets the user choose several rectangular regions in the plot | ||||
| 
 | ||||
|         regions.plotTracesInRegions(): | ||||
|          - creates plots (shot.plot_traces) for all traces in the active regions (i.e. chosen by e.g. chooseRectangles) | ||||
| 
 | ||||
|         regions.setActiveRegionsForDeletion(): | ||||
|          - highlights all shots in a the active regions for deletion | ||||
| 
 | ||||
|         regions.deleteMarkedPicks(): | ||||
|          - deletes the picks (pick flag set to 0) for all shots set for deletion | ||||
| 
 | ||||
|         regions.deselectSelection(number): | ||||
|          - deselects the region of number = number | ||||
| 
 | ||||
|         ''' | ||||
| 
 | ||||
|         import matplotlib.pyplot as plt | ||||
|         plt.interactive(True) | ||||
|         from pylot.core.active.surveyPlotTools import regions | ||||
| 
 | ||||
|         dist, pick, snrlog, pickerror, spe = self.preparePlotAllPicks(plotRemoved) | ||||
|          | ||||
|         color = {'log10SNR': snrlog, | ||||
|                  'pickerror': pickerror, | ||||
|                  'spe': spe} | ||||
|         self.color = color | ||||
|         if refreshPlot is False: | ||||
|             ax, cbar, sc = self.createPlot(dist, pick, color[colorByVal], | ||||
|                                        label='%s' % colorByVal) | ||||
|             region = regions(ax, cbar, self) | ||||
|             ax.legend() | ||||
|             return (ax, region) | ||||
|         if refreshPlot is True: | ||||
|             ax, cbar, sc = self.createPlot(dist, pick, color[colorByVal], | ||||
|                                        label='%s' % colorByVal, ax=ax, | ||||
|                                        cbar=cbar) | ||||
|             ax.legend() | ||||
|             return ax | ||||
| 
 | ||||
|     def preparePlotAllPicks(self, plotRemoved = False): | ||||
|         dist = [] | ||||
|         pick = [] | ||||
|         snrlog = [] | ||||
|         pickerror = [] | ||||
|         spe = [] | ||||
| 
 | ||||
|         for shot in self.data.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 if plotRemoved == False: | ||||
|                     if shot.getPickFlag( | ||||
|                             traceID) is not 0 or plotRemoved == True: | ||||
|                         dist.append(shot.getDistance(traceID)) | ||||
|                         pick.append(shot.getPick(traceID)) | ||||
|                         snrlog.append(math.log10(shot.getSNR(traceID)[0])) | ||||
|                         pickerror.append(shot.getPickError(traceID)) | ||||
|                         spe.append(shot.getSymmetricPickError(traceID)) | ||||
| 
 | ||||
|         return dist, pick, snrlog, pickerror, spe | ||||
| 
 | ||||
|                              | ||||
|     def createPlot(self, dist, pick, inkByVal, label, ax=None, cbar=None): | ||||
|         ''' | ||||
|         Used by plotAllPicks. | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         #plt.interactive(True) | ||||
|         cm = plt.cm.jet | ||||
|         if ax is None: | ||||
|             print('Generating new plot...') | ||||
|             fig = plt.figure() | ||||
|             ax = fig.add_subplot(111) | ||||
|             sc = ax.scatter(dist, pick, cmap=cm, c=inkByVal, s=5, | ||||
|                             edgecolors='none', label=label) | ||||
|             cbar = fig.colorbar(sc, fraction=0.05) | ||||
|             cbar.set_label(label) | ||||
|             ax.set_xlabel('Distance [m]') | ||||
|             ax.set_ylabel('Time [s]') | ||||
|             ax.text(0.5, 0.95, 'Plot of all picks', transform=ax.transAxes, | ||||
|                     horizontalalignment='center') | ||||
|         else: | ||||
|             sc = ax.scatter(dist, pick, cmap=cm, c=inkByVal, s=5, | ||||
|                             edgecolors='none', label=label) | ||||
|             if cbar is not None: | ||||
|                 cbar.ax.clear() | ||||
|                 cbar = ax.figure.colorbar(sc, cax=cbar.ax) | ||||
|                 cbar.set_label(label) | ||||
|             ax.set_xlabel('Distance [m]') | ||||
|             ax.set_ylabel('Time [s]') | ||||
|             ax.text(0.5, 0.95, 'Plot of all picks', transform=ax.transAxes, | ||||
|                     horizontalalignment='center') | ||||
|         return ax, cbar, sc | ||||
|      | ||||
|     def _update_progress(self, shotname, tend, progress): | ||||
|         sys.stdout.write( | ||||
|             'Working on shot %s. ETC is %02d:%02d:%02d [%2.2f %%]\r' % ( | ||||
|             shotname, | ||||
|             tend.hour, | ||||
|             tend.minute, | ||||
|             tend.second, | ||||
|             progress)) | ||||
|         sys.stdout.flush() | ||||
| 
 | ||||
|     def saveSurvey(self, filename='survey.pickle'): | ||||
|         ''' | ||||
|         Save Survey object to a file.  | ||||
|         Can be loaded by using Survey.from_pickle(filename). | ||||
|         ''' | ||||
|         import cPickle | ||||
|         cleanUp(self) | ||||
|         outfile = open(filename, 'wb') | ||||
| 
 | ||||
|         cPickle.dump(self, outfile, -1) | ||||
|         print('saved Survey to file %s' % (filename)) | ||||
| 
 | ||||
|     @staticmethod | ||||
|     def from_pickle(filename): | ||||
|         import cPickle | ||||
|         infile = open(filename, 'rb') | ||||
|         survey = cPickle.load(infile) | ||||
|         print('Loaded %s'%filename) | ||||
|         return survey  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,2 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| __author__ = 'marcel' | ||||
| @ -1,391 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'asp3d_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_MainWindow(object): | ||||
|     def setupUi(self, MainWindow): | ||||
|         MainWindow.setObjectName("MainWindow") | ||||
|         MainWindow.setEnabled(True) | ||||
|         MainWindow.resize(1280, 1024) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) | ||||
|         MainWindow.setSizePolicy(sizePolicy) | ||||
|         MainWindow.setMinimumSize(QtCore.QSize(800, 600)) | ||||
|         MainWindow.setMaximumSize(QtCore.QSize(250000, 350000)) | ||||
|         MainWindow.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | ||||
|         icon = QtGui.QIcon() | ||||
|         icon.addPixmap(QtGui.QPixmap("../asp3d_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||||
|         MainWindow.setWindowIcon(icon) | ||||
|         self.centralwidget = QtGui.QWidget(MainWindow) | ||||
|         self.centralwidget.setObjectName("centralwidget") | ||||
|         self.gridLayout = QtGui.QGridLayout(self.centralwidget) | ||||
|         self.gridLayout.setObjectName("gridLayout") | ||||
|         self.formLayout = QtGui.QFormLayout() | ||||
|         self.formLayout.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint) | ||||
|         self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) | ||||
|         self.formLayout.setObjectName("formLayout") | ||||
|         self.verticalLayout_5 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_5.setSizeConstraint(QtGui.QLayout.SetMinimumSize) | ||||
|         self.verticalLayout_5.setObjectName("verticalLayout_5") | ||||
|         self.verticalLayout = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.label_2 = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_2.setSizePolicy(sizePolicy) | ||||
|         font = QtGui.QFont() | ||||
|         font.setFamily("Sans Serif") | ||||
|         font.setPointSize(10) | ||||
|         font.setWeight(75) | ||||
|         font.setBold(True) | ||||
|         self.label_2.setFont(font) | ||||
|         self.label_2.setAlignment(QtCore.Qt.AlignCenter) | ||||
|         self.label_2.setObjectName("label_2") | ||||
|         self.verticalLayout.addWidget(self.label_2) | ||||
|         self.horizontalLayout_2 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_2.setObjectName("horizontalLayout_2") | ||||
|         self.seisarray_active = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.seisarray_active.sizePolicy().hasHeightForWidth()) | ||||
|         self.seisarray_active.setSizePolicy(sizePolicy) | ||||
|         self.seisarray_active.setMaximumSize(QtCore.QSize(20, 20)) | ||||
|         self.seisarray_active.setMidLineWidth(0) | ||||
|         self.seisarray_active.setText("") | ||||
|         self.seisarray_active.setObjectName("seisarray_active") | ||||
|         self.horizontalLayout_2.addWidget(self.seisarray_active) | ||||
|         self.label_5 = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_5.setSizePolicy(sizePolicy) | ||||
|         self.label_5.setObjectName("label_5") | ||||
|         self.horizontalLayout_2.addWidget(self.label_5) | ||||
|         self.seisarray_on_survey_active = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.seisarray_on_survey_active.sizePolicy().hasHeightForWidth()) | ||||
|         self.seisarray_on_survey_active.setSizePolicy(sizePolicy) | ||||
|         self.seisarray_on_survey_active.setMaximumSize(QtCore.QSize(20, 20)) | ||||
|         self.seisarray_on_survey_active.setMidLineWidth(0) | ||||
|         self.seisarray_on_survey_active.setText("") | ||||
|         self.seisarray_on_survey_active.setObjectName("seisarray_on_survey_active") | ||||
|         self.horizontalLayout_2.addWidget(self.seisarray_on_survey_active) | ||||
|         self.label_6 = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_6.setSizePolicy(sizePolicy) | ||||
|         self.label_6.setObjectName("label_6") | ||||
|         self.horizontalLayout_2.addWidget(self.label_6) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout_2) | ||||
|         self.textBox_seisarray = QtGui.QTextEdit(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.textBox_seisarray.sizePolicy().hasHeightForWidth()) | ||||
|         self.textBox_seisarray.setSizePolicy(sizePolicy) | ||||
|         self.textBox_seisarray.setObjectName("textBox_seisarray") | ||||
|         self.verticalLayout.addWidget(self.textBox_seisarray) | ||||
|         self.verticalLayout_5.addLayout(self.verticalLayout) | ||||
|         self.line = QtGui.QFrame(self.centralwidget) | ||||
|         self.line.setMinimumSize(QtCore.QSize(0, 5)) | ||||
|         self.line.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line.setObjectName("line") | ||||
|         self.verticalLayout_5.addWidget(self.line) | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.label_3 = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_3.setSizePolicy(sizePolicy) | ||||
|         font = QtGui.QFont() | ||||
|         font.setFamily("Sans Serif") | ||||
|         font.setPointSize(10) | ||||
|         font.setWeight(75) | ||||
|         font.setBold(True) | ||||
|         self.label_3.setFont(font) | ||||
|         self.label_3.setAlignment(QtCore.Qt.AlignCenter) | ||||
|         self.label_3.setObjectName("label_3") | ||||
|         self.verticalLayout_2.addWidget(self.label_3) | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.survey_active = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.survey_active.sizePolicy().hasHeightForWidth()) | ||||
|         self.survey_active.setSizePolicy(sizePolicy) | ||||
|         self.survey_active.setMaximumSize(QtCore.QSize(20, 20)) | ||||
|         self.survey_active.setMidLineWidth(0) | ||||
|         self.survey_active.setText("") | ||||
|         self.survey_active.setObjectName("survey_active") | ||||
|         self.horizontalLayout.addWidget(self.survey_active) | ||||
|         self.label_4 = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_4.setSizePolicy(sizePolicy) | ||||
|         self.label_4.setObjectName("label_4") | ||||
|         self.horizontalLayout.addWidget(self.label_4) | ||||
|         self.picked_active = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.picked_active.sizePolicy().hasHeightForWidth()) | ||||
|         self.picked_active.setSizePolicy(sizePolicy) | ||||
|         self.picked_active.setMaximumSize(QtCore.QSize(20, 20)) | ||||
|         self.picked_active.setMidLineWidth(0) | ||||
|         self.picked_active.setText("") | ||||
|         self.picked_active.setObjectName("picked_active") | ||||
|         self.horizontalLayout.addWidget(self.picked_active) | ||||
|         self.label = QtGui.QLabel(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) | ||||
|         self.label.setSizePolicy(sizePolicy) | ||||
|         self.label.setObjectName("label") | ||||
|         self.horizontalLayout.addWidget(self.label) | ||||
|         self.verticalLayout_2.addLayout(self.horizontalLayout) | ||||
|         self.textBox_survey = QtGui.QTextEdit(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.textBox_survey.sizePolicy().hasHeightForWidth()) | ||||
|         self.textBox_survey.setSizePolicy(sizePolicy) | ||||
|         self.textBox_survey.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse) | ||||
|         self.textBox_survey.setObjectName("textBox_survey") | ||||
|         self.verticalLayout_2.addWidget(self.textBox_survey) | ||||
|         self.verticalLayout_5.addLayout(self.verticalLayout_2) | ||||
|         self.verticalLayout_3 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_3.setObjectName("verticalLayout_3") | ||||
|         self.verticalLayout_4 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_4.setObjectName("verticalLayout_4") | ||||
|         self.progressBar = QtGui.QProgressBar(self.centralwidget) | ||||
|         self.progressBar.setEnabled(True) | ||||
|         self.progressBar.setProperty("value", 0) | ||||
|         self.progressBar.setTextVisible(True) | ||||
|         self.progressBar.setObjectName("progressBar") | ||||
|         self.verticalLayout_4.addWidget(self.progressBar) | ||||
|         self.verticalLayout_3.addLayout(self.verticalLayout_4) | ||||
|         self.verticalLayout_5.addLayout(self.verticalLayout_3) | ||||
|         self.formLayout.setLayout(0, QtGui.QFormLayout.LabelRole, self.verticalLayout_5) | ||||
|         self.verticalLayout_right = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_right.setSizeConstraint(QtGui.QLayout.SetMaximumSize) | ||||
|         self.verticalLayout_right.setObjectName("verticalLayout_right") | ||||
|         self.horizontalLayout_tr = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_tr.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint) | ||||
|         self.horizontalLayout_tr.setObjectName("horizontalLayout_tr") | ||||
|         self.verticalLayout_tr1 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_tr1.setObjectName("verticalLayout_tr1") | ||||
|         self.horizontalLayout_tr.addLayout(self.verticalLayout_tr1) | ||||
|         self.verticalLayout_right.addLayout(self.horizontalLayout_tr) | ||||
|         self.line_4 = QtGui.QFrame(self.centralwidget) | ||||
|         self.line_4.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line_4.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_4.setObjectName("line_4") | ||||
|         self.verticalLayout_right.addWidget(self.line_4) | ||||
|         self.horizontalLayout_3 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_3.setObjectName("horizontalLayout_3") | ||||
|         self.verticalLayout_6 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_6.setObjectName("verticalLayout_6") | ||||
|         self.label_11 = QtGui.QLabel(self.centralwidget) | ||||
|         self.label_11.setObjectName("label_11") | ||||
|         self.verticalLayout_6.addWidget(self.label_11) | ||||
|         self.comboBox_stats = QtGui.QComboBox(self.centralwidget) | ||||
|         self.comboBox_stats.setEnabled(False) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(3) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.comboBox_stats.sizePolicy().hasHeightForWidth()) | ||||
|         self.comboBox_stats.setSizePolicy(sizePolicy) | ||||
|         self.comboBox_stats.setMinimumSize(QtCore.QSize(450, 0)) | ||||
|         self.comboBox_stats.setObjectName("comboBox_stats") | ||||
|         self.verticalLayout_6.addWidget(self.comboBox_stats) | ||||
|         self.horizontalLayout_3.addLayout(self.verticalLayout_6) | ||||
|         self.line_5 = QtGui.QFrame(self.centralwidget) | ||||
|         self.line_5.setFrameShape(QtGui.QFrame.VLine) | ||||
|         self.line_5.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_5.setObjectName("line_5") | ||||
|         self.horizontalLayout_3.addWidget(self.line_5) | ||||
|         self.verticalLayout_9 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_9.setObjectName("verticalLayout_9") | ||||
|         self.label_10 = QtGui.QLabel(self.centralwidget) | ||||
|         self.label_10.setObjectName("label_10") | ||||
|         self.verticalLayout_9.addWidget(self.label_10) | ||||
|         self.horizontalLayout_4 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_4.setObjectName("horizontalLayout_4") | ||||
|         self.shot_left = QtGui.QPushButton(self.centralwidget) | ||||
|         self.shot_left.setMaximumSize(QtCore.QSize(25, 16777215)) | ||||
|         self.shot_left.setObjectName("shot_left") | ||||
|         self.horizontalLayout_4.addWidget(self.shot_left) | ||||
|         self.comboBox_shots = QtGui.QComboBox(self.centralwidget) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(1) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.comboBox_shots.sizePolicy().hasHeightForWidth()) | ||||
|         self.comboBox_shots.setSizePolicy(sizePolicy) | ||||
|         self.comboBox_shots.setMinimumSize(QtCore.QSize(120, 0)) | ||||
|         self.comboBox_shots.setMaximumSize(QtCore.QSize(100, 16777215)) | ||||
|         self.comboBox_shots.setObjectName("comboBox_shots") | ||||
|         self.horizontalLayout_4.addWidget(self.comboBox_shots) | ||||
|         self.shot_right = QtGui.QPushButton(self.centralwidget) | ||||
|         self.shot_right.setMaximumSize(QtCore.QSize(25, 16777215)) | ||||
|         self.shot_right.setObjectName("shot_right") | ||||
|         self.horizontalLayout_4.addWidget(self.shot_right) | ||||
|         self.plot_shot = QtGui.QPushButton(self.centralwidget) | ||||
|         self.plot_shot.setMaximumSize(QtCore.QSize(80, 16777215)) | ||||
|         self.plot_shot.setObjectName("plot_shot") | ||||
|         self.horizontalLayout_4.addWidget(self.plot_shot) | ||||
|         self.verticalLayout_9.addLayout(self.horizontalLayout_4) | ||||
|         self.horizontalLayout_3.addLayout(self.verticalLayout_9) | ||||
|         self.verticalLayout_right.addLayout(self.horizontalLayout_3) | ||||
|         self.horizontalLayout_br = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_br.setObjectName("horizontalLayout_br") | ||||
|         self.verticalLayout_br1 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_br1.setObjectName("verticalLayout_br1") | ||||
|         self.horizontalLayout_br.addLayout(self.verticalLayout_br1) | ||||
|         self.verticalLayout_br2 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_br2.setObjectName("verticalLayout_br2") | ||||
|         self.horizontalLayout_br.addLayout(self.verticalLayout_br2) | ||||
|         self.verticalLayout_right.addLayout(self.horizontalLayout_br) | ||||
|         self.formLayout.setLayout(0, QtGui.QFormLayout.FieldRole, self.verticalLayout_right) | ||||
|         self.gridLayout.addLayout(self.formLayout, 0, 0, 1, 1) | ||||
|         MainWindow.setCentralWidget(self.centralwidget) | ||||
|         self.menubar = QtGui.QMenuBar(MainWindow) | ||||
|         self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 23)) | ||||
|         self.menubar.setObjectName("menubar") | ||||
|         self.menuFile = QtGui.QMenu(self.menubar) | ||||
|         self.menuFile.setObjectName("menuFile") | ||||
|         self.menuSeismic_Array = QtGui.QMenu(self.menubar) | ||||
|         self.menuSeismic_Array.setObjectName("menuSeismic_Array") | ||||
|         self.menuSurvey = QtGui.QMenu(self.menubar) | ||||
|         self.menuSurvey.setObjectName("menuSurvey") | ||||
|         self.menuPicking = QtGui.QMenu(self.menubar) | ||||
|         self.menuPicking.setObjectName("menuPicking") | ||||
|         self.menuSimulation = QtGui.QMenu(self.menubar) | ||||
|         self.menuSimulation.setObjectName("menuSimulation") | ||||
|         self.menuTools = QtGui.QMenu(self.menubar) | ||||
|         self.menuTools.setObjectName("menuTools") | ||||
|         self.menuView = QtGui.QMenu(self.menubar) | ||||
|         self.menuView.setObjectName("menuView") | ||||
|         MainWindow.setMenuBar(self.menubar) | ||||
|         self.statusbar = QtGui.QStatusBar(MainWindow) | ||||
|         self.statusbar.setObjectName("statusbar") | ||||
|         MainWindow.setStatusBar(self.statusbar) | ||||
|         self.actionLoad_Seismic_Array = QtGui.QAction(MainWindow) | ||||
|         self.actionLoad_Seismic_Array.setCheckable(False) | ||||
|         self.actionLoad_Seismic_Array.setObjectName("actionLoad_Seismic_Array") | ||||
|         self.actionSave_Seismic_Array = QtGui.QAction(MainWindow) | ||||
|         self.actionSave_Seismic_Array.setObjectName("actionSave_Seismic_Array") | ||||
|         self.actionLoad_Survey = QtGui.QAction(MainWindow) | ||||
|         self.actionLoad_Survey.setObjectName("actionLoad_Survey") | ||||
|         self.actionSave_Survey = QtGui.QAction(MainWindow) | ||||
|         self.actionSave_Survey.setObjectName("actionSave_Survey") | ||||
|         self.actionExit = QtGui.QAction(MainWindow) | ||||
|         self.actionExit.setObjectName("actionExit") | ||||
|         self.actionGenerate_new_Seismic_Array = QtGui.QAction(MainWindow) | ||||
|         self.actionGenerate_new_Seismic_Array.setObjectName("actionGenerate_new_Seismic_Array") | ||||
|         self.actionInterpolate_Receivers = QtGui.QAction(MainWindow) | ||||
|         self.actionInterpolate_Receivers.setObjectName("actionInterpolate_Receivers") | ||||
|         self.actionConnect_to_Survey = QtGui.QAction(MainWindow) | ||||
|         self.actionConnect_to_Survey.setObjectName("actionConnect_to_Survey") | ||||
|         self.actionGenerate_new_Survey = QtGui.QAction(MainWindow) | ||||
|         self.actionGenerate_new_Survey.setObjectName("actionGenerate_new_Survey") | ||||
|         self.actionAutomatic_Picking = QtGui.QAction(MainWindow) | ||||
|         self.actionAutomatic_Picking.setObjectName("actionAutomatic_Picking") | ||||
|         self.actionPostprocessing = QtGui.QAction(MainWindow) | ||||
|         self.actionPostprocessing.setObjectName("actionPostprocessing") | ||||
|         self.actionStart_FMTOMO_Simulation = QtGui.QAction(MainWindow) | ||||
|         self.actionStart_FMTOMO_Simulation.setObjectName("actionStart_FMTOMO_Simulation") | ||||
|         self.actionVTK_Visualization = QtGui.QAction(MainWindow) | ||||
|         self.actionVTK_Visualization.setObjectName("actionVTK_Visualization") | ||||
|         self.actionSeismic_Array = QtGui.QAction(MainWindow) | ||||
|         self.actionSeismic_Array.setEnabled(False) | ||||
|         self.actionSeismic_Array.setObjectName("actionSeismic_Array") | ||||
|         self.actionFullscreen = QtGui.QAction(MainWindow) | ||||
|         self.actionFullscreen.setCheckable(True) | ||||
|         self.actionFullscreen.setObjectName("actionFullscreen") | ||||
|         self.menuFile.addSeparator() | ||||
|         self.menuFile.addAction(self.actionExit) | ||||
|         self.menuSeismic_Array.addAction(self.actionGenerate_new_Seismic_Array) | ||||
|         self.menuSeismic_Array.addAction(self.actionLoad_Seismic_Array) | ||||
|         self.menuSeismic_Array.addAction(self.actionSave_Seismic_Array) | ||||
|         self.menuSeismic_Array.addSeparator() | ||||
|         self.menuSeismic_Array.addAction(self.actionInterpolate_Receivers) | ||||
|         self.menuSeismic_Array.addAction(self.actionConnect_to_Survey) | ||||
|         self.menuSurvey.addAction(self.actionGenerate_new_Survey) | ||||
|         self.menuSurvey.addAction(self.actionLoad_Survey) | ||||
|         self.menuSurvey.addAction(self.actionSave_Survey) | ||||
|         self.menuPicking.addAction(self.actionAutomatic_Picking) | ||||
|         self.menuPicking.addAction(self.actionPostprocessing) | ||||
|         self.menuSimulation.addAction(self.actionStart_FMTOMO_Simulation) | ||||
|         self.menuTools.addAction(self.actionVTK_Visualization) | ||||
|         self.menuView.addAction(self.actionFullscreen) | ||||
|         self.menubar.addAction(self.menuFile.menuAction()) | ||||
|         self.menubar.addAction(self.menuSurvey.menuAction()) | ||||
|         self.menubar.addAction(self.menuSeismic_Array.menuAction()) | ||||
|         self.menubar.addAction(self.menuPicking.menuAction()) | ||||
|         self.menubar.addAction(self.menuSimulation.menuAction()) | ||||
|         self.menubar.addAction(self.menuTools.menuAction()) | ||||
|         self.menubar.addAction(self.menuView.menuAction()) | ||||
| 
 | ||||
|         self.retranslateUi(MainWindow) | ||||
|         QtCore.QMetaObject.connectSlotsByName(MainWindow) | ||||
| 
 | ||||
|     def retranslateUi(self, MainWindow): | ||||
|         MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "ActiveSeismoPick 3D", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_5.setText(QtGui.QApplication.translate("MainWindow", "active", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_6.setText(QtGui.QApplication.translate("MainWindow", "connected to Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_4.setText(QtGui.QApplication.translate("MainWindow", "active", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("MainWindow", "picked", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_11.setText(QtGui.QApplication.translate("MainWindow", "Plot Receiver and Shots of the Array colored by:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_10.setText(QtGui.QApplication.translate("MainWindow", "Plot a single Shot:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.shot_left.setText(QtGui.QApplication.translate("MainWindow", "<", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.shot_right.setText(QtGui.QApplication.translate("MainWindow", ">", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.plot_shot.setText(QtGui.QApplication.translate("MainWindow", "Plot", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuSeismic_Array.setTitle(QtGui.QApplication.translate("MainWindow", "Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuSurvey.setTitle(QtGui.QApplication.translate("MainWindow", "Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuPicking.setTitle(QtGui.QApplication.translate("MainWindow", "Picking", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuSimulation.setTitle(QtGui.QApplication.translate("MainWindow", "Inversion", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuTools.setTitle(QtGui.QApplication.translate("MainWindow", "Tools", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.menuView.setTitle(QtGui.QApplication.translate("MainWindow", "View", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionLoad_Seismic_Array.setText(QtGui.QApplication.translate("MainWindow", "Load Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionSave_Seismic_Array.setText(QtGui.QApplication.translate("MainWindow", "Save Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionLoad_Survey.setText(QtGui.QApplication.translate("MainWindow", "Load Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionSave_Survey.setText(QtGui.QApplication.translate("MainWindow", "Save Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionGenerate_new_Seismic_Array.setText(QtGui.QApplication.translate("MainWindow", "Generate new Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionInterpolate_Receivers.setText(QtGui.QApplication.translate("MainWindow", "Interpolate Receivers", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionConnect_to_Survey.setText(QtGui.QApplication.translate("MainWindow", "Connect to Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionGenerate_new_Survey.setText(QtGui.QApplication.translate("MainWindow", "Generate new Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionAutomatic_Picking.setText(QtGui.QApplication.translate("MainWindow", "Automatic Picking", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionPostprocessing.setText(QtGui.QApplication.translate("MainWindow", "Postprocessing", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionStart_FMTOMO_Simulation.setText(QtGui.QApplication.translate("MainWindow", "Start FMTOMO Simulation", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionVTK_Visualization.setText(QtGui.QApplication.translate("MainWindow", "VTK Visualization", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionSeismic_Array.setText(QtGui.QApplication.translate("MainWindow", "Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.actionFullscreen.setText(QtGui.QApplication.translate("MainWindow", "Fullscreen", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,306 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'fmtomo_parameters_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_fmtomo_parameters(object): | ||||
|     def setupUi(self, fmtomo_parameters): | ||||
|         fmtomo_parameters.setObjectName("fmtomo_parameters") | ||||
|         fmtomo_parameters.resize(400, 440) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(fmtomo_parameters.sizePolicy().hasHeightForWidth()) | ||||
|         fmtomo_parameters.setSizePolicy(sizePolicy) | ||||
|         fmtomo_parameters.setMinimumSize(QtCore.QSize(400, 440)) | ||||
|         fmtomo_parameters.setMaximumSize(QtCore.QSize(320000, 520000)) | ||||
|         icon = QtGui.QIcon() | ||||
|         icon.addPixmap(QtGui.QPixmap("../asp3d_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||||
|         fmtomo_parameters.setWindowIcon(icon) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout(fmtomo_parameters) | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.horizontalLayout_4 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_4.setObjectName("horizontalLayout_4") | ||||
|         self.label_17 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_17.setObjectName("label_17") | ||||
|         self.horizontalLayout_4.addWidget(self.label_17) | ||||
|         self.fmtomo_dir = QtGui.QLineEdit(fmtomo_parameters) | ||||
|         self.fmtomo_dir.setObjectName("fmtomo_dir") | ||||
|         self.horizontalLayout_4.addWidget(self.fmtomo_dir) | ||||
|         self.browse_tomodir = QtGui.QPushButton(fmtomo_parameters) | ||||
|         self.browse_tomodir.setObjectName("browse_tomodir") | ||||
|         self.horizontalLayout_4.addWidget(self.browse_tomodir) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout_4) | ||||
|         self.line_5 = QtGui.QFrame(fmtomo_parameters) | ||||
|         self.line_5.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line_5.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_5.setObjectName("line_5") | ||||
|         self.verticalLayout.addWidget(self.line_5) | ||||
|         self.horizontalLayout_2 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_2.setObjectName("horizontalLayout_2") | ||||
|         self.label_14 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_14.setObjectName("label_14") | ||||
|         self.horizontalLayout_2.addWidget(self.label_14) | ||||
|         self.nproc = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.nproc.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.nproc.setMinimum(1) | ||||
|         self.nproc.setMaximum(10000) | ||||
|         self.nproc.setObjectName("nproc") | ||||
|         self.horizontalLayout_2.addWidget(self.nproc) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout_2) | ||||
|         self.gridLayout_3 = QtGui.QGridLayout() | ||||
|         self.gridLayout_3.setObjectName("gridLayout_3") | ||||
|         self.nIter = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.nIter.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.nIter.setProperty("value", 1) | ||||
|         self.nIter.setObjectName("nIter") | ||||
|         self.gridLayout_3.addWidget(self.nIter, 0, 1, 1, 1) | ||||
|         self.label = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label.setObjectName("label") | ||||
|         self.gridLayout_3.addWidget(self.label, 0, 0, 1, 1) | ||||
|         self.verticalLayout.addLayout(self.gridLayout_3) | ||||
|         self.line_4 = QtGui.QFrame(fmtomo_parameters) | ||||
|         self.line_4.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line_4.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_4.setObjectName("line_4") | ||||
|         self.verticalLayout.addWidget(self.line_4) | ||||
|         self.label_18 = QtGui.QLabel(fmtomo_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_18.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_18.setSizePolicy(sizePolicy) | ||||
|         self.label_18.setObjectName("label_18") | ||||
|         self.verticalLayout.addWidget(self.label_18) | ||||
|         self.gridLayout_2 = QtGui.QGridLayout() | ||||
|         self.gridLayout_2.setObjectName("gridLayout_2") | ||||
|         self.label_3 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_3.setObjectName("label_3") | ||||
|         self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) | ||||
|         self.bbot = QtGui.QLineEdit(fmtomo_parameters) | ||||
|         self.bbot.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.bbot.setObjectName("bbot") | ||||
|         self.gridLayout_2.addWidget(self.bbot, 1, 1, 1, 1) | ||||
|         self.label_11 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_11.setObjectName("label_11") | ||||
|         self.gridLayout_2.addWidget(self.label_11, 1, 2, 1, 1) | ||||
|         self.label_2 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_2.setObjectName("label_2") | ||||
|         self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) | ||||
|         self.btop = QtGui.QLineEdit(fmtomo_parameters) | ||||
|         self.btop.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.btop.setObjectName("btop") | ||||
|         self.gridLayout_2.addWidget(self.btop, 0, 1, 1, 1) | ||||
|         self.label_10 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_10.setObjectName("label_10") | ||||
|         self.gridLayout_2.addWidget(self.label_10, 0, 2, 1, 1) | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.label_13 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_13.setObjectName("label_13") | ||||
|         self.horizontalLayout.addWidget(self.label_13) | ||||
|         self.cushion = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.cushion.setMinimum(2) | ||||
|         self.cushion.setMaximum(100) | ||||
|         self.cushion.setProperty("value", 10) | ||||
|         self.cushion.setObjectName("cushion") | ||||
|         self.horizontalLayout.addWidget(self.cushion) | ||||
|         self.label_12 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_12.setObjectName("label_12") | ||||
|         self.horizontalLayout.addWidget(self.label_12) | ||||
|         self.gridLayout_2.addLayout(self.horizontalLayout, 0, 3, 1, 1) | ||||
|         self.verticalLayout.addLayout(self.gridLayout_2) | ||||
|         self.line = QtGui.QFrame(fmtomo_parameters) | ||||
|         self.line.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line.setObjectName("line") | ||||
|         self.verticalLayout.addWidget(self.line) | ||||
|         self.gridLayout = QtGui.QGridLayout() | ||||
|         self.gridLayout.setObjectName("gridLayout") | ||||
|         self.label_4 = QtGui.QLabel(fmtomo_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_4.setSizePolicy(sizePolicy) | ||||
|         self.label_4.setObjectName("label_4") | ||||
|         self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1) | ||||
|         self.label_5 = QtGui.QLabel(fmtomo_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_5.setSizePolicy(sizePolicy) | ||||
|         self.label_5.setLayoutDirection(QtCore.Qt.LeftToRight) | ||||
|         self.label_5.setAlignment(QtCore.Qt.AlignCenter) | ||||
|         self.label_5.setObjectName("label_5") | ||||
|         self.gridLayout.addWidget(self.label_5, 0, 1, 1, 1) | ||||
|         self.label_6 = QtGui.QLabel(fmtomo_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_6.setSizePolicy(sizePolicy) | ||||
|         self.label_6.setLayoutDirection(QtCore.Qt.LeftToRight) | ||||
|         self.label_6.setAlignment(QtCore.Qt.AlignCenter) | ||||
|         self.label_6.setObjectName("label_6") | ||||
|         self.gridLayout.addWidget(self.label_6, 0, 2, 1, 1) | ||||
|         self.label_7 = QtGui.QLabel(fmtomo_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_7.setSizePolicy(sizePolicy) | ||||
|         self.label_7.setLayoutDirection(QtCore.Qt.LeftToRight) | ||||
|         self.label_7.setAlignment(QtCore.Qt.AlignCenter) | ||||
|         self.label_7.setObjectName("label_7") | ||||
|         self.gridLayout.addWidget(self.label_7, 0, 3, 1, 1) | ||||
|         self.label_9 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_9.setObjectName("label_9") | ||||
|         self.gridLayout.addWidget(self.label_9, 2, 0, 1, 1) | ||||
|         self.pgrid_x = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.pgrid_x.setMinimum(2) | ||||
|         self.pgrid_x.setMaximum(10000) | ||||
|         self.pgrid_x.setProperty("value", 100) | ||||
|         self.pgrid_x.setObjectName("pgrid_x") | ||||
|         self.gridLayout.addWidget(self.pgrid_x, 1, 1, 1, 1) | ||||
|         self.pgrid_y = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.pgrid_y.setMinimum(2) | ||||
|         self.pgrid_y.setMaximum(10000) | ||||
|         self.pgrid_y.setProperty("value", 100) | ||||
|         self.pgrid_y.setObjectName("pgrid_y") | ||||
|         self.gridLayout.addWidget(self.pgrid_y, 1, 2, 1, 1) | ||||
|         self.pgrid_z = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.pgrid_z.setMinimum(2) | ||||
|         self.pgrid_z.setMaximum(10000) | ||||
|         self.pgrid_z.setProperty("value", 120) | ||||
|         self.pgrid_z.setObjectName("pgrid_z") | ||||
|         self.gridLayout.addWidget(self.pgrid_z, 1, 3, 1, 1) | ||||
|         self.label_8 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_8.setObjectName("label_8") | ||||
|         self.gridLayout.addWidget(self.label_8, 1, 0, 1, 1) | ||||
|         self.invgrid_x = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.invgrid_x.setMinimum(2) | ||||
|         self.invgrid_x.setMaximum(10000) | ||||
|         self.invgrid_x.setProperty("value", 60) | ||||
|         self.invgrid_x.setObjectName("invgrid_x") | ||||
|         self.gridLayout.addWidget(self.invgrid_x, 2, 1, 1, 1) | ||||
|         self.invgrid_y = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.invgrid_y.setMinimum(2) | ||||
|         self.invgrid_y.setMaximum(10000) | ||||
|         self.invgrid_y.setProperty("value", 60) | ||||
|         self.invgrid_y.setObjectName("invgrid_y") | ||||
|         self.gridLayout.addWidget(self.invgrid_y, 2, 2, 1, 1) | ||||
|         self.invgrid_z = QtGui.QSpinBox(fmtomo_parameters) | ||||
|         self.invgrid_z.setMinimum(2) | ||||
|         self.invgrid_z.setMaximum(10000) | ||||
|         self.invgrid_z.setProperty("value", 80) | ||||
|         self.invgrid_z.setObjectName("invgrid_z") | ||||
|         self.gridLayout.addWidget(self.invgrid_z, 2, 3, 1, 1) | ||||
|         self.verticalLayout.addLayout(self.gridLayout) | ||||
|         self.line_2 = QtGui.QFrame(fmtomo_parameters) | ||||
|         self.line_2.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line_2.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_2.setObjectName("line_2") | ||||
|         self.verticalLayout.addWidget(self.line_2) | ||||
|         self.line_3 = QtGui.QFrame(fmtomo_parameters) | ||||
|         self.line_3.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line_3.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_3.setObjectName("line_3") | ||||
|         self.verticalLayout.addWidget(self.line_3) | ||||
|         self.gridLayout_4 = QtGui.QGridLayout() | ||||
|         self.gridLayout_4.setObjectName("gridLayout_4") | ||||
|         self.label_15 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_15.setObjectName("label_15") | ||||
|         self.gridLayout_4.addWidget(self.label_15, 0, 0, 1, 1) | ||||
|         self.customgrid = QtGui.QLineEdit(fmtomo_parameters) | ||||
|         self.customgrid.setObjectName("customgrid") | ||||
|         self.gridLayout_4.addWidget(self.customgrid, 0, 1, 1, 1) | ||||
|         self.browse_customgrid = QtGui.QPushButton(fmtomo_parameters) | ||||
|         self.browse_customgrid.setObjectName("browse_customgrid") | ||||
|         self.gridLayout_4.addWidget(self.browse_customgrid, 0, 2, 1, 1) | ||||
|         self.label_16 = QtGui.QLabel(fmtomo_parameters) | ||||
|         self.label_16.setObjectName("label_16") | ||||
|         self.gridLayout_4.addWidget(self.label_16, 1, 0, 1, 1) | ||||
|         self.simuldir = QtGui.QLineEdit(fmtomo_parameters) | ||||
|         self.simuldir.setObjectName("simuldir") | ||||
|         self.gridLayout_4.addWidget(self.simuldir, 1, 1, 1, 1) | ||||
|         self.browse_simuldir = QtGui.QPushButton(fmtomo_parameters) | ||||
|         self.browse_simuldir.setObjectName("browse_simuldir") | ||||
|         self.gridLayout_4.addWidget(self.browse_simuldir, 1, 2, 1, 1) | ||||
|         self.verticalLayout.addLayout(self.gridLayout_4) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(fmtomo_parameters) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(fmtomo_parameters) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), fmtomo_parameters.accept) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), fmtomo_parameters.reject) | ||||
|         QtCore.QMetaObject.connectSlotsByName(fmtomo_parameters) | ||||
| 
 | ||||
|     def retranslateUi(self, fmtomo_parameters): | ||||
|         fmtomo_parameters.setWindowTitle(QtGui.QApplication.translate("fmtomo_parameters", "Choose FMTOMO parameters", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_17.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Directory containing a clean FMTOMO installation.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_17.setText(QtGui.QApplication.translate("fmtomo_parameters", "FMTOMO\n" | ||||
| "installation [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.browse_tomodir.setText(QtGui.QApplication.translate("fmtomo_parameters", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_14.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Number of processes spawned for parallel forward simulation.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_14.setText(QtGui.QApplication.translate("fmtomo_parameters", "Number of processes [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Number of inversion iterations.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("fmtomo_parameters", "Iterations [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_18.setText(QtGui.QApplication.translate("fmtomo_parameters", "Grid definitions from seismic Array:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Bottom boundary of the model.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setText(QtGui.QApplication.translate("fmtomo_parameters", "Bottom boundary [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.bbot.setText(QtGui.QApplication.translate("fmtomo_parameters", "-50", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_11.setText(QtGui.QApplication.translate("fmtomo_parameters", "m", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Top boundary of the model (must be greater than highest source or receiver position).\n" | ||||
| "Too low values will cause error.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setText(QtGui.QApplication.translate("fmtomo_parameters", "Top boundary [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.btop.setText(QtGui.QApplication.translate("fmtomo_parameters", "5", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_10.setText(QtGui.QApplication.translate("fmtomo_parameters", "m", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_13.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Extension of the model around the maximum values of the receiver grid (X and Y).\n" | ||||
| "Too low values will cause error.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_13.setText(QtGui.QApplication.translate("fmtomo_parameters", "Cushion factor [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_12.setText(QtGui.QApplication.translate("fmtomo_parameters", "%", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_4.setText(QtGui.QApplication.translate("fmtomo_parameters", "Number of Points", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_5.setText(QtGui.QApplication.translate("fmtomo_parameters", "X", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_6.setText(QtGui.QApplication.translate("fmtomo_parameters", "Y", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_7.setText(QtGui.QApplication.translate("fmtomo_parameters", "Z", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_9.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Number of inversion grid (velocity grid) points in X, Y, Z.\n" | ||||
| "Must be lower than for propagation grid.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_9.setText(QtGui.QApplication.translate("fmtomo_parameters", "Inversion Grid [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_8.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Number of points for forward simulation in X, Y, Z.\n" | ||||
| "Must be higher than number of inversion grid points.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_8.setText(QtGui.QApplication.translate("fmtomo_parameters", "Propagation Grid [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_15.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Specifiy simple input velocity file from which linear gradients will be evaluated.</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">First gradient: Surface velocity: 0.5 km/s rising to 1.0 km/s at a depth of 5 m below the surface.</p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Second gradient: Continuous change to another gradient from 1.0 km/s to 4.0 km/s at 60 m depth below the surface.</p>\n" | ||||
| "<p align=\"justify\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p align=\"justify\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">0        0.5</p>\n" | ||||
| "<p align=\"justify\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">-5       1.0</p>\n" | ||||
| "<p align=\"justify\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">-5       1.0</p>\n" | ||||
| "<p align=\"justify\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">-60     4.0</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_15.setText(QtGui.QApplication.translate("fmtomo_parameters", "Custom velocity\n" | ||||
| "grid (earthmodel) [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.browse_customgrid.setText(QtGui.QApplication.translate("fmtomo_parameters", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_16.setToolTip(QtGui.QApplication.translate("fmtomo_parameters", "Specifiy directory for FMTOMO simulation.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_16.setText(QtGui.QApplication.translate("fmtomo_parameters", "Simulation\n" | ||||
| "Directory  [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.browse_simuldir.setText(QtGui.QApplication.translate("fmtomo_parameters", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,175 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'generate_seisarray_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_generate_seisarray(object): | ||||
|     def setupUi(self, generate_seisarray): | ||||
|         generate_seisarray.setObjectName("generate_seisarray") | ||||
|         generate_seisarray.resize(403, 221) | ||||
|         generate_seisarray.setMinimumSize(QtCore.QSize(400, 220)) | ||||
|         icon = QtGui.QIcon() | ||||
|         icon.addPixmap(QtGui.QPixmap("../asp3d_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||||
|         generate_seisarray.setWindowIcon(icon) | ||||
|         self.verticalLayout_5 = QtGui.QVBoxLayout(generate_seisarray) | ||||
|         self.verticalLayout_5.setObjectName("verticalLayout_5") | ||||
|         self.verticalLayout = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.verticalLayout_4 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_4.setObjectName("verticalLayout_4") | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.label_rec = QtGui.QLabel(generate_seisarray) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_rec.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_rec.setSizePolicy(sizePolicy) | ||||
|         self.label_rec.setToolTip("") | ||||
|         self.label_rec.setObjectName("label_rec") | ||||
|         self.horizontalLayout.addWidget(self.label_rec) | ||||
|         spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | ||||
|         self.horizontalLayout.addItem(spacerItem) | ||||
|         self.radioButton_normal = QtGui.QRadioButton(generate_seisarray) | ||||
|         self.radioButton_normal.setChecked(True) | ||||
|         self.radioButton_normal.setObjectName("radioButton_normal") | ||||
|         self.horizontalLayout.addWidget(self.radioButton_normal) | ||||
|         self.radioButton_interpolatable = QtGui.QRadioButton(generate_seisarray) | ||||
|         self.radioButton_interpolatable.setObjectName("radioButton_interpolatable") | ||||
|         self.horizontalLayout.addWidget(self.radioButton_interpolatable) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout) | ||||
|         self.horizontalLayout_4 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_4.setObjectName("horizontalLayout_4") | ||||
|         self.lineEdit_rec = QtGui.QLineEdit(generate_seisarray) | ||||
|         self.lineEdit_rec.setObjectName("lineEdit_rec") | ||||
|         self.horizontalLayout_4.addWidget(self.lineEdit_rec) | ||||
|         self.pushButton_rec = QtGui.QPushButton(generate_seisarray) | ||||
|         self.pushButton_rec.setObjectName("pushButton_rec") | ||||
|         self.horizontalLayout_4.addWidget(self.pushButton_rec) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout_4) | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_4) | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.label_src = QtGui.QLabel(generate_seisarray) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_src.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_src.setSizePolicy(sizePolicy) | ||||
|         self.label_src.setObjectName("label_src") | ||||
|         self.verticalLayout_2.addWidget(self.label_src) | ||||
|         self.horizontalLayout_5 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_5.setObjectName("horizontalLayout_5") | ||||
|         self.lineEdit_src = QtGui.QLineEdit(generate_seisarray) | ||||
|         self.lineEdit_src.setObjectName("lineEdit_src") | ||||
|         self.horizontalLayout_5.addWidget(self.lineEdit_src) | ||||
|         self.pushButton_src = QtGui.QPushButton(generate_seisarray) | ||||
|         self.pushButton_src.setObjectName("pushButton_src") | ||||
|         self.horizontalLayout_5.addWidget(self.pushButton_src) | ||||
|         self.verticalLayout_2.addLayout(self.horizontalLayout_5) | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_2) | ||||
|         self.verticalLayout_3 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_3.setObjectName("verticalLayout_3") | ||||
|         self.label_obs = QtGui.QLabel(generate_seisarray) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_obs.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_obs.setSizePolicy(sizePolicy) | ||||
|         self.label_obs.setObjectName("label_obs") | ||||
|         self.verticalLayout_3.addWidget(self.label_obs) | ||||
|         self.horizontalLayout_6 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_6.setObjectName("horizontalLayout_6") | ||||
|         self.lineEdit_pts = QtGui.QLineEdit(generate_seisarray) | ||||
|         self.lineEdit_pts.setObjectName("lineEdit_pts") | ||||
|         self.horizontalLayout_6.addWidget(self.lineEdit_pts) | ||||
|         self.pushButton_obs = QtGui.QPushButton(generate_seisarray) | ||||
|         self.pushButton_obs.setObjectName("pushButton_obs") | ||||
|         self.horizontalLayout_6.addWidget(self.pushButton_obs) | ||||
|         self.verticalLayout_3.addLayout(self.horizontalLayout_6) | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_3) | ||||
|         self.verticalLayout_5.addLayout(self.verticalLayout) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(generate_seisarray) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout_5.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(generate_seisarray) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), generate_seisarray.reject) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), generate_seisarray.accept) | ||||
|         QtCore.QMetaObject.connectSlotsByName(generate_seisarray) | ||||
| 
 | ||||
|     def retranslateUi(self, generate_seisarray): | ||||
|         generate_seisarray.setWindowTitle(QtGui.QApplication.translate("generate_seisarray", "Generate new Seismic Array", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_rec.setText(QtGui.QApplication.translate("generate_seisarray", "Measured Receivers", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_normal.setToolTip(QtGui.QApplication.translate("generate_seisarray", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load <span style=\" font-weight:600;\">normal </span>measured receiver input file. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[trace ID (int)]  [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Geophone with the trace ID 50 and the coordinates (10.5 [m], 20.4 [m], 30.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">50  10.5  20.4  30.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_normal.setText(QtGui.QApplication.translate("generate_seisarray", "normal [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_interpolatable.setToolTip(QtGui.QApplication.translate("generate_seisarray", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load<span style=\" font-weight:600;\"> </span>measured receiver input file that can be <span style=\" font-weight:600;\">interpolated</span>. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[trace ID (int)] [receiver line ID (int)] [number of the geophone on receiver line (int)]  [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Third geophone on the second receiver line with the trace ID 50 and the coordinates (10.5 [m], 20.4 [m], 30.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">50  2  3  10.5  20.4  30.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_interpolatable.setText(QtGui.QApplication.translate("generate_seisarray", "interpolation [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_rec.setText(QtGui.QApplication.translate("generate_seisarray", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_src.setToolTip(QtGui.QApplication.translate("generate_seisarray", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load measured sources input file to improve interpolation precision. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[source ID (int)] [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shot number 100 with the coordinates (12.3 [m], 100.5 [m], 20.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100  12.3  100.5  20.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_src.setText(QtGui.QApplication.translate("generate_seisarray", "Measured Sources (optional) [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_src.setText(QtGui.QApplication.translate("generate_seisarray", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs.setToolTip(QtGui.QApplication.translate("generate_seisarray", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load measured points input file to improve interpolation precision. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[point ID (int)] [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Point number 100 with the coordinates (12.3 [m], 100.5 [m], 20.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100  12.3  100.5  20.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs.setText(QtGui.QApplication.translate("generate_seisarray", "Additional measured points (optional) [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_obs.setText(QtGui.QApplication.translate("generate_seisarray", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,151 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'generate_survey_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_generate_survey(object): | ||||
|     def setupUi(self, generate_survey): | ||||
|         generate_survey.setObjectName("generate_survey") | ||||
|         generate_survey.resize(382, 220) | ||||
|         icon = QtGui.QIcon() | ||||
|         icon.addPixmap(QtGui.QPixmap("../asp3d_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||||
|         generate_survey.setWindowIcon(icon) | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout(generate_survey) | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.gridLayout = QtGui.QGridLayout() | ||||
|         self.gridLayout.setObjectName("gridLayout") | ||||
|         self.lineEdit_rec = QtGui.QLineEdit(generate_survey) | ||||
|         self.lineEdit_rec.setObjectName("lineEdit_rec") | ||||
|         self.gridLayout.addWidget(self.lineEdit_rec, 0, 1, 1, 1) | ||||
|         self.pushButton_rec = QtGui.QPushButton(generate_survey) | ||||
|         self.pushButton_rec.setObjectName("pushButton_rec") | ||||
|         self.gridLayout.addWidget(self.pushButton_rec, 0, 2, 1, 1) | ||||
|         self.label_rec = QtGui.QLabel(generate_survey) | ||||
|         self.label_rec.setObjectName("label_rec") | ||||
|         self.gridLayout.addWidget(self.label_rec, 0, 0, 1, 1) | ||||
|         self.lineEdit_obs = QtGui.QLineEdit(generate_survey) | ||||
|         self.lineEdit_obs.setObjectName("lineEdit_obs") | ||||
|         self.gridLayout.addWidget(self.lineEdit_obs, 2, 1, 1, 1) | ||||
|         self.label_obs = QtGui.QLabel(generate_survey) | ||||
|         self.label_obs.setObjectName("label_obs") | ||||
|         self.gridLayout.addWidget(self.label_obs, 2, 0, 1, 1) | ||||
|         self.pushButton_obs = QtGui.QPushButton(generate_survey) | ||||
|         self.pushButton_obs.setObjectName("pushButton_obs") | ||||
|         self.gridLayout.addWidget(self.pushButton_obs, 2, 2, 1, 1) | ||||
|         self.label_src = QtGui.QLabel(generate_survey) | ||||
|         self.label_src.setObjectName("label_src") | ||||
|         self.gridLayout.addWidget(self.label_src, 1, 0, 1, 1) | ||||
|         self.lineEdit_src = QtGui.QLineEdit(generate_survey) | ||||
|         self.lineEdit_src.setObjectName("lineEdit_src") | ||||
|         self.gridLayout.addWidget(self.lineEdit_src, 1, 1, 1, 1) | ||||
|         self.pushButton_src = QtGui.QPushButton(generate_survey) | ||||
|         self.pushButton_src.setObjectName("pushButton_src") | ||||
|         self.gridLayout.addWidget(self.pushButton_src, 1, 2, 1, 1) | ||||
|         self.verticalLayout_2.addLayout(self.gridLayout) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.line_2 = QtGui.QFrame(generate_survey) | ||||
|         self.line_2.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line_2.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line_2.setObjectName("line_2") | ||||
|         self.verticalLayout.addWidget(self.line_2) | ||||
|         self.label = QtGui.QLabel(generate_survey) | ||||
|         self.label.setObjectName("label") | ||||
|         self.verticalLayout.addWidget(self.label) | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.fstart = QtGui.QLineEdit(generate_survey) | ||||
|         self.fstart.setObjectName("fstart") | ||||
|         self.horizontalLayout.addWidget(self.fstart) | ||||
|         self.label_obs_2 = QtGui.QLabel(generate_survey) | ||||
|         self.label_obs_2.setObjectName("label_obs_2") | ||||
|         self.horizontalLayout.addWidget(self.label_obs_2) | ||||
|         self.fend = QtGui.QLineEdit(generate_survey) | ||||
|         self.fend.setObjectName("fend") | ||||
|         self.horizontalLayout.addWidget(self.fend) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout) | ||||
|         self.verticalLayout_2.addLayout(self.verticalLayout) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(generate_survey) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout_2.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(generate_survey) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), generate_survey.accept) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), generate_survey.reject) | ||||
|         QtCore.QMetaObject.connectSlotsByName(generate_survey) | ||||
| 
 | ||||
|     def retranslateUi(self, generate_survey): | ||||
|         generate_survey.setWindowTitle(QtGui.QApplication.translate("generate_survey", "Generate new Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_rec.setText(QtGui.QApplication.translate("generate_survey", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_rec.setToolTip(QtGui.QApplication.translate("generate_survey", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load receiver input file. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[trace ID (int)] [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Trace ID 100 with the coordinates (12.3 [m], 100.5 [m], 20.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100  12.3  100.5  20.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_rec.setText(QtGui.QApplication.translate("generate_survey", "Receiver\n" | ||||
| "File [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs.setToolTip(QtGui.QApplication.translate("generate_survey", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Specifiy directory containing seismograms for each shot.</p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Currently in the format SEGY with each file named \'shotnumber*_pickle.dat\'.</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shot number 100 containing seismograms for all traces with the name:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100_pickle.dat</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs.setText(QtGui.QApplication.translate("generate_survey", "Seismogram\n" | ||||
| "Directory [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_obs.setText(QtGui.QApplication.translate("generate_survey", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_src.setToolTip(QtGui.QApplication.translate("generate_survey", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load sources input file. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[trace ID (int)] [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Source number 100 with the coordinates (12.3 [m], 100.5 [m], 20.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100  12.3  100.5  20.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_src.setText(QtGui.QApplication.translate("generate_survey", "Source\n" | ||||
| "File [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_src.setText(QtGui.QApplication.translate("generate_survey", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("generate_survey", "File structure:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs_2.setToolTip(QtGui.QApplication.translate("generate_survey", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Specifiy directory containing seismograms for each shot.</p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Currently in the format SEGY with each file named \'shotnumber*_pickle.dat\'.</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shot number 100 containing seismograms for all traces with the name:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100_pickle.dat</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs_2.setText(QtGui.QApplication.translate("generate_survey", "*Shotnumber*", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.fend.setText(QtGui.QApplication.translate("generate_survey", ".dat", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,94 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'generate_survey_layout_minimal.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_generate_survey_minimal(object): | ||||
|     def setupUi(self, generate_survey_minimal): | ||||
|         generate_survey_minimal.setObjectName("generate_survey_minimal") | ||||
|         generate_survey_minimal.resize(382, 139) | ||||
|         icon = QtGui.QIcon() | ||||
|         icon.addPixmap(QtGui.QPixmap("../asp3d_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) | ||||
|         generate_survey_minimal.setWindowIcon(icon) | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout(generate_survey_minimal) | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.gridLayout = QtGui.QGridLayout() | ||||
|         self.gridLayout.setObjectName("gridLayout") | ||||
|         self.lineEdit_obs = QtGui.QLineEdit(generate_survey_minimal) | ||||
|         self.lineEdit_obs.setObjectName("lineEdit_obs") | ||||
|         self.gridLayout.addWidget(self.lineEdit_obs, 0, 1, 1, 1) | ||||
|         self.label_obs = QtGui.QLabel(generate_survey_minimal) | ||||
|         self.label_obs.setObjectName("label_obs") | ||||
|         self.gridLayout.addWidget(self.label_obs, 0, 0, 1, 1) | ||||
|         self.pushButton_obs = QtGui.QPushButton(generate_survey_minimal) | ||||
|         self.pushButton_obs.setObjectName("pushButton_obs") | ||||
|         self.gridLayout.addWidget(self.pushButton_obs, 0, 2, 1, 1) | ||||
|         self.verticalLayout_2.addLayout(self.gridLayout) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.label = QtGui.QLabel(generate_survey_minimal) | ||||
|         self.label.setObjectName("label") | ||||
|         self.verticalLayout.addWidget(self.label) | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.fstart = QtGui.QLineEdit(generate_survey_minimal) | ||||
|         self.fstart.setObjectName("fstart") | ||||
|         self.horizontalLayout.addWidget(self.fstart) | ||||
|         self.label_obs_2 = QtGui.QLabel(generate_survey_minimal) | ||||
|         self.label_obs_2.setObjectName("label_obs_2") | ||||
|         self.horizontalLayout.addWidget(self.label_obs_2) | ||||
|         self.fend = QtGui.QLineEdit(generate_survey_minimal) | ||||
|         self.fend.setObjectName("fend") | ||||
|         self.horizontalLayout.addWidget(self.fend) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout) | ||||
|         self.verticalLayout_2.addLayout(self.verticalLayout) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(generate_survey_minimal) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout_2.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(generate_survey_minimal) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), generate_survey_minimal.accept) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), generate_survey_minimal.reject) | ||||
|         QtCore.QMetaObject.connectSlotsByName(generate_survey_minimal) | ||||
| 
 | ||||
|     def retranslateUi(self, generate_survey_minimal): | ||||
|         generate_survey_minimal.setWindowTitle(QtGui.QApplication.translate("generate_survey_minimal", "Generate new Survey", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs.setToolTip(QtGui.QApplication.translate("generate_survey_minimal", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Specifiy directory containing seismograms for each shot.</p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Currently in the format SEGY with each file named \'shotnumber*_pickle.dat\'.</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shot number 100 containing seismograms for all traces with the name:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100_pickle.dat</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs.setText(QtGui.QApplication.translate("generate_survey_minimal", "Seismogram\n" | ||||
| "Directory [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_obs.setText(QtGui.QApplication.translate("generate_survey_minimal", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("generate_survey_minimal", "File structure:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs_2.setToolTip(QtGui.QApplication.translate("generate_survey_minimal", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Specifiy directory containing seismograms for each shot.</p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Currently in the format SEGY with each file named \'shotnumber*_pickle.dat\'.</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Shot number 100 containing seismograms for all traces with the name:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">100_pickle.dat</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_obs_2.setText(QtGui.QApplication.translate("generate_survey_minimal", "*Shotnumber*", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.fend.setText(QtGui.QApplication.translate("generate_survey_minimal", ".dat", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,277 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'picking_parameters_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_picking_parameters(object): | ||||
|     def setupUi(self, picking_parameters): | ||||
|         picking_parameters.setObjectName("picking_parameters") | ||||
|         picking_parameters.resize(422, 798) | ||||
|         picking_parameters.setMinimumSize(QtCore.QSize(0, 700)) | ||||
|         self.verticalLayout_4 = QtGui.QVBoxLayout(picking_parameters) | ||||
|         self.verticalLayout_4.setObjectName("verticalLayout_4") | ||||
|         self.label_7 = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_7.setSizePolicy(sizePolicy) | ||||
|         font = QtGui.QFont() | ||||
|         font.setFamily("Sans Serif") | ||||
|         font.setWeight(75) | ||||
|         font.setBold(True) | ||||
|         self.label_7.setFont(font) | ||||
|         self.label_7.setObjectName("label_7") | ||||
|         self.verticalLayout_4.addWidget(self.label_7) | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.label = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) | ||||
|         self.label.setSizePolicy(sizePolicy) | ||||
|         self.label.setObjectName("label") | ||||
|         self.horizontalLayout.addWidget(self.label) | ||||
|         self.ncores = QtGui.QSpinBox(picking_parameters) | ||||
|         self.ncores.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.ncores.setMinimum(1) | ||||
|         self.ncores.setMaximum(10000) | ||||
|         self.ncores.setObjectName("ncores") | ||||
|         self.horizontalLayout.addWidget(self.ncores) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout) | ||||
|         self.horizontalLayout_3 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_3.setObjectName("horizontalLayout_3") | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.label_2 = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_2.setSizePolicy(sizePolicy) | ||||
|         self.label_2.setObjectName("label_2") | ||||
|         self.verticalLayout_2.addWidget(self.label_2) | ||||
|         self.lineEdit_vmin = QtGui.QLineEdit(picking_parameters) | ||||
|         self.lineEdit_vmin.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.lineEdit_vmin.setObjectName("lineEdit_vmin") | ||||
|         self.verticalLayout_2.addWidget(self.lineEdit_vmin) | ||||
|         self.horizontalLayout_3.addLayout(self.verticalLayout_2) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.label_3 = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_3.setSizePolicy(sizePolicy) | ||||
|         self.label_3.setObjectName("label_3") | ||||
|         self.verticalLayout.addWidget(self.label_3) | ||||
|         self.lineEdit_vmax = QtGui.QLineEdit(picking_parameters) | ||||
|         self.lineEdit_vmax.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.lineEdit_vmax.setObjectName("lineEdit_vmax") | ||||
|         self.verticalLayout.addWidget(self.lineEdit_vmax) | ||||
|         self.horizontalLayout_3.addLayout(self.verticalLayout) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout_3) | ||||
|         self.horizontalLayout_4 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_4.setObjectName("horizontalLayout_4") | ||||
|         self.label_4 = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_4.setSizePolicy(sizePolicy) | ||||
|         self.label_4.setObjectName("label_4") | ||||
|         self.horizontalLayout_4.addWidget(self.label_4) | ||||
|         self.horizontalLayout_2 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_2.setObjectName("horizontalLayout_2") | ||||
|         self.slider_folm = QtGui.QSlider(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.slider_folm.sizePolicy().hasHeightForWidth()) | ||||
|         self.slider_folm.setSizePolicy(sizePolicy) | ||||
|         self.slider_folm.setMinimum(1) | ||||
|         self.slider_folm.setMaximum(100) | ||||
|         self.slider_folm.setProperty("value", 60) | ||||
|         self.slider_folm.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.slider_folm.setTickPosition(QtGui.QSlider.TicksBelow) | ||||
|         self.slider_folm.setTickInterval(10) | ||||
|         self.slider_folm.setObjectName("slider_folm") | ||||
|         self.horizontalLayout_2.addWidget(self.slider_folm) | ||||
|         self.label_folm = QtGui.QLabel(picking_parameters) | ||||
|         self.label_folm.setAlignment(QtCore.Qt.AlignCenter) | ||||
|         self.label_folm.setObjectName("label_folm") | ||||
|         self.horizontalLayout_2.addWidget(self.label_folm) | ||||
|         self.horizontalLayout_4.addLayout(self.horizontalLayout_2) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout_4) | ||||
|         self.horizontalLayout_5 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_5.setObjectName("horizontalLayout_5") | ||||
|         self.label_5 = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_5.setSizePolicy(sizePolicy) | ||||
|         self.label_5.setObjectName("label_5") | ||||
|         self.horizontalLayout_5.addWidget(self.label_5) | ||||
|         self.checkBox_AIC = QtGui.QCheckBox(picking_parameters) | ||||
|         self.checkBox_AIC.setText("") | ||||
|         self.checkBox_AIC.setChecked(True) | ||||
|         self.checkBox_AIC.setObjectName("checkBox_AIC") | ||||
|         self.horizontalLayout_5.addWidget(self.checkBox_AIC) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout_5) | ||||
|         self.horizontalLayout_6 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_6.setObjectName("horizontalLayout_6") | ||||
|         self.label_6 = QtGui.QLabel(picking_parameters) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_6.setSizePolicy(sizePolicy) | ||||
|         self.label_6.setObjectName("label_6") | ||||
|         self.horizontalLayout_6.addWidget(self.label_6) | ||||
|         self.horizontalLayout_7 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_7.setObjectName("horizontalLayout_7") | ||||
|         self.lineEdit_aicleft = QtGui.QLineEdit(picking_parameters) | ||||
|         self.lineEdit_aicleft.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.lineEdit_aicleft.setObjectName("lineEdit_aicleft") | ||||
|         self.horizontalLayout_7.addWidget(self.lineEdit_aicleft) | ||||
|         self.lineEdit_aicright = QtGui.QLineEdit(picking_parameters) | ||||
|         self.lineEdit_aicright.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.lineEdit_aicright.setObjectName("lineEdit_aicright") | ||||
|         self.horizontalLayout_7.addWidget(self.lineEdit_aicright) | ||||
|         self.horizontalLayout_6.addLayout(self.horizontalLayout_7) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout_6) | ||||
|         self.verticalLayout_snr = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_snr.setObjectName("verticalLayout_snr") | ||||
|         self.line = QtGui.QFrame(picking_parameters) | ||||
|         self.line.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line.setObjectName("line") | ||||
|         self.verticalLayout_snr.addWidget(self.line) | ||||
|         self.horizontalLayout_9 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_9.setObjectName("horizontalLayout_9") | ||||
|         self.label_8 = QtGui.QLabel(picking_parameters) | ||||
|         self.label_8.setObjectName("label_8") | ||||
|         self.horizontalLayout_9.addWidget(self.label_8) | ||||
|         self.radioButton_const = QtGui.QRadioButton(picking_parameters) | ||||
|         self.radioButton_const.setChecked(True) | ||||
|         self.radioButton_const.setObjectName("radioButton_const") | ||||
|         self.horizontalLayout_9.addWidget(self.radioButton_const) | ||||
|         self.radioButton_dyn = QtGui.QRadioButton(picking_parameters) | ||||
|         self.radioButton_dyn.setObjectName("radioButton_dyn") | ||||
|         self.horizontalLayout_9.addWidget(self.radioButton_dyn) | ||||
|         self.verticalLayout_snr.addLayout(self.horizontalLayout_9) | ||||
|         self.horizontalLayout_10 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_10.setObjectName("horizontalLayout_10") | ||||
|         self.label_13 = QtGui.QLabel(picking_parameters) | ||||
|         self.label_13.setObjectName("label_13") | ||||
|         self.horizontalLayout_10.addWidget(self.label_13) | ||||
|         self.doubleSpinBox_constSNR = QtGui.QDoubleSpinBox(picking_parameters) | ||||
|         self.doubleSpinBox_constSNR.setMaximumSize(QtCore.QSize(100, 16777215)) | ||||
|         self.doubleSpinBox_constSNR.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.doubleSpinBox_constSNR.setDecimals(1) | ||||
|         self.doubleSpinBox_constSNR.setMinimum(1.0) | ||||
|         self.doubleSpinBox_constSNR.setMaximum(10000.0) | ||||
|         self.doubleSpinBox_constSNR.setSingleStep(0.1) | ||||
|         self.doubleSpinBox_constSNR.setProperty("value", 8.0) | ||||
|         self.doubleSpinBox_constSNR.setObjectName("doubleSpinBox_constSNR") | ||||
|         self.horizontalLayout_10.addWidget(self.doubleSpinBox_constSNR) | ||||
|         self.verticalLayout_snr.addLayout(self.horizontalLayout_10) | ||||
|         self.gridLayout_2 = QtGui.QGridLayout() | ||||
|         self.gridLayout_2.setObjectName("gridLayout_2") | ||||
|         self.label_9 = QtGui.QLabel(picking_parameters) | ||||
|         self.label_9.setObjectName("label_9") | ||||
|         self.gridLayout_2.addWidget(self.label_9, 1, 0, 1, 1) | ||||
|         self.label_10 = QtGui.QLabel(picking_parameters) | ||||
|         self.label_10.setObjectName("label_10") | ||||
|         self.gridLayout_2.addWidget(self.label_10, 2, 0, 1, 1) | ||||
|         self.p1 = QtGui.QDoubleSpinBox(picking_parameters) | ||||
|         self.p1.setDecimals(6) | ||||
|         self.p1.setMinimum(-100.0) | ||||
|         self.p1.setMaximum(100.0) | ||||
|         self.p1.setSingleStep(0.0001) | ||||
|         self.p1.setProperty("value", 0.004) | ||||
|         self.p1.setObjectName("p1") | ||||
|         self.gridLayout_2.addWidget(self.p1, 2, 1, 1, 1) | ||||
|         self.label_11 = QtGui.QLabel(picking_parameters) | ||||
|         self.label_11.setObjectName("label_11") | ||||
|         self.gridLayout_2.addWidget(self.label_11, 1, 2, 1, 1) | ||||
|         self.label_12 = QtGui.QLabel(picking_parameters) | ||||
|         self.label_12.setObjectName("label_12") | ||||
|         self.gridLayout_2.addWidget(self.label_12, 2, 2, 1, 1) | ||||
|         self.p2 = QtGui.QDoubleSpinBox(picking_parameters) | ||||
|         self.p2.setDecimals(6) | ||||
|         self.p2.setMinimum(-100.0) | ||||
|         self.p2.setMaximum(100.0) | ||||
|         self.p2.setSingleStep(0.001) | ||||
|         self.p2.setProperty("value", -0.0007) | ||||
|         self.p2.setObjectName("p2") | ||||
|         self.gridLayout_2.addWidget(self.p2, 2, 3, 1, 1) | ||||
|         self.shift_dist = QtGui.QSpinBox(picking_parameters) | ||||
|         self.shift_dist.setMinimum(-10000) | ||||
|         self.shift_dist.setMaximum(10000) | ||||
|         self.shift_dist.setProperty("value", 30) | ||||
|         self.shift_dist.setObjectName("shift_dist") | ||||
|         self.gridLayout_2.addWidget(self.shift_dist, 1, 1, 1, 1) | ||||
|         self.shift_snr = QtGui.QSpinBox(picking_parameters) | ||||
|         self.shift_snr.setMinimum(-10000) | ||||
|         self.shift_snr.setMaximum(10000) | ||||
|         self.shift_snr.setProperty("value", 100) | ||||
|         self.shift_snr.setObjectName("shift_snr") | ||||
|         self.gridLayout_2.addWidget(self.shift_snr, 1, 3, 1, 1) | ||||
|         self.verticalLayout_snr.addLayout(self.gridLayout_2) | ||||
|         self.verticalLayout_4.addLayout(self.verticalLayout_snr) | ||||
|         spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | ||||
|         self.verticalLayout_4.addItem(spacerItem) | ||||
|         self.vlayout_plot = QtGui.QVBoxLayout() | ||||
|         self.vlayout_plot.setObjectName("vlayout_plot") | ||||
|         self.verticalLayout_4.addLayout(self.vlayout_plot) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(picking_parameters) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout_4.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(picking_parameters) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), picking_parameters.accept) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), picking_parameters.reject) | ||||
|         QtCore.QMetaObject.connectSlotsByName(picking_parameters) | ||||
| 
 | ||||
|     def retranslateUi(self, picking_parameters): | ||||
|         picking_parameters.setWindowTitle(QtGui.QApplication.translate("picking_parameters", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_7.setText(QtGui.QApplication.translate("picking_parameters", "Choose parameters for FMTOMO simulation", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setToolTip(QtGui.QApplication.translate("picking_parameters", "Amount of CPU kernels used.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("picking_parameters", "nproc [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setToolTip(QtGui.QApplication.translate("picking_parameters", "Minimum permitted direct velocity (apparent velocity!).", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setText(QtGui.QApplication.translate("picking_parameters", "vmin [m/s] [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.lineEdit_vmin.setText(QtGui.QApplication.translate("picking_parameters", "100", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setToolTip(QtGui.QApplication.translate("picking_parameters", "Maximum permitted direct velocity (apparent velocity!).", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setText(QtGui.QApplication.translate("picking_parameters", "vmax [m/s] [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.lineEdit_vmax.setText(QtGui.QApplication.translate("picking_parameters", "5000", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_4.setToolTip(QtGui.QApplication.translate("picking_parameters", "Value between 1 and 100 % for threshold picking algorithm (Default = 60%).", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_4.setText(QtGui.QApplication.translate("picking_parameters", "Fraction of local maximum [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_folm.setText(QtGui.QApplication.translate("picking_parameters", "60 %", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_5.setToolTip(QtGui.QApplication.translate("picking_parameters", "Use additional Akaike Information Criterion for picking.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_5.setText(QtGui.QApplication.translate("picking_parameters", "AIC [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_6.setToolTip(QtGui.QApplication.translate("picking_parameters", "Samples before and after initial HOS pick.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_6.setText(QtGui.QApplication.translate("picking_parameters", "AIC window samples\n" | ||||
| "(only if AIC checked)", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.lineEdit_aicleft.setText(QtGui.QApplication.translate("picking_parameters", "15", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.lineEdit_aicright.setText(QtGui.QApplication.translate("picking_parameters", "0", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_8.setText(QtGui.QApplication.translate("picking_parameters", "SNR threshold", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_const.setText(QtGui.QApplication.translate("picking_parameters", "constant", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_dyn.setText(QtGui.QApplication.translate("picking_parameters", "dynamic (advanced)", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_13.setText(QtGui.QApplication.translate("picking_parameters", "Constant SNR threshold:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_9.setText(QtGui.QApplication.translate("picking_parameters", "Shift distance", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_10.setText(QtGui.QApplication.translate("picking_parameters", "p1", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_11.setText(QtGui.QApplication.translate("picking_parameters", "Shift SNR", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_12.setText(QtGui.QApplication.translate("picking_parameters", "p2", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,178 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'postprocessing_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_postprocessing(object): | ||||
|     def setupUi(self, postprocessing): | ||||
|         postprocessing.setObjectName("postprocessing") | ||||
|         postprocessing.resize(825, 617) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout(postprocessing) | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.horizontalLayout_2 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_2.setObjectName("horizontalLayout_2") | ||||
|         self.verticalLayout_3 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_3.setObjectName("verticalLayout_3") | ||||
|         self.label = QtGui.QLabel(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) | ||||
|         self.label.setSizePolicy(sizePolicy) | ||||
|         self.label.setMinimumSize(QtCore.QSize(0, 20)) | ||||
|         self.label.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.label.setObjectName("label") | ||||
|         self.verticalLayout_3.addWidget(self.label) | ||||
|         self.horizontalLayout_4 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_4.setObjectName("horizontalLayout_4") | ||||
|         self.pushButton_rect = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_rect.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_rect.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_rect.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_rect.setCheckable(False) | ||||
|         self.pushButton_rect.setObjectName("pushButton_rect") | ||||
|         self.buttonGroup = QtGui.QButtonGroup(postprocessing) | ||||
|         self.buttonGroup.setObjectName("buttonGroup") | ||||
|         self.buttonGroup.addButton(self.pushButton_rect) | ||||
|         self.horizontalLayout_4.addWidget(self.pushButton_rect) | ||||
|         self.pushButton_poly = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_poly.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_poly.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_poly.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_poly.setCheckable(False) | ||||
|         self.pushButton_poly.setObjectName("pushButton_poly") | ||||
|         self.buttonGroup.addButton(self.pushButton_poly) | ||||
|         self.horizontalLayout_4.addWidget(self.pushButton_poly) | ||||
|         self.pushButton_undo = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_undo.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_undo.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_undo.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_undo.setCheckable(False) | ||||
|         self.pushButton_undo.setObjectName("pushButton_undo") | ||||
|         self.horizontalLayout_4.addWidget(self.pushButton_undo) | ||||
|         self.verticalLayout_3.addLayout(self.horizontalLayout_4) | ||||
|         self.horizontalLayout_2.addLayout(self.verticalLayout_3) | ||||
|         self.line = QtGui.QFrame(postprocessing) | ||||
|         self.line.setFrameShape(QtGui.QFrame.VLine) | ||||
|         self.line.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line.setObjectName("line") | ||||
|         self.horizontalLayout_2.addWidget(self.line) | ||||
|         self.verticalLayout_4 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_4.setObjectName("verticalLayout_4") | ||||
|         self.label_3 = QtGui.QLabel(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_3.setSizePolicy(sizePolicy) | ||||
|         self.label_3.setMinimumSize(QtCore.QSize(0, 20)) | ||||
|         self.label_3.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.label_3.setObjectName("label_3") | ||||
|         self.verticalLayout_4.addWidget(self.label_3) | ||||
|         self.horizontalLayout_6 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_6.setObjectName("horizontalLayout_6") | ||||
|         self.pushButton_plot = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_plot.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_plot.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_plot.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_plot.setCheckable(False) | ||||
|         self.pushButton_plot.setDefault(False) | ||||
|         self.pushButton_plot.setFlat(False) | ||||
|         self.pushButton_plot.setObjectName("pushButton_plot") | ||||
|         self.horizontalLayout_6.addWidget(self.pushButton_plot) | ||||
|         self.pushButton_delete = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_delete.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_delete.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_delete.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_delete.setObjectName("pushButton_delete") | ||||
|         self.horizontalLayout_6.addWidget(self.pushButton_delete) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout_6) | ||||
|         self.horizontalLayout_2.addLayout(self.verticalLayout_4) | ||||
|         spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | ||||
|         self.horizontalLayout_2.addItem(spacerItem) | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.label_2 = QtGui.QLabel(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_2.setSizePolicy(sizePolicy) | ||||
|         self.label_2.setMinimumSize(QtCore.QSize(0, 20)) | ||||
|         self.label_2.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.label_2.setObjectName("label_2") | ||||
|         self.verticalLayout_2.addWidget(self.label_2) | ||||
|         self.horizontalLayout_5 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_5.setObjectName("horizontalLayout_5") | ||||
|         self.pushButton_snr = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_snr.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_snr.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_snr.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_snr.setObjectName("pushButton_snr") | ||||
|         self.horizontalLayout_5.addWidget(self.pushButton_snr) | ||||
|         self.pushButton_pe = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_pe.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_pe.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_pe.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_pe.setObjectName("pushButton_pe") | ||||
|         self.horizontalLayout_5.addWidget(self.pushButton_pe) | ||||
|         self.pushButton_spe = QtGui.QPushButton(postprocessing) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.pushButton_spe.sizePolicy().hasHeightForWidth()) | ||||
|         self.pushButton_spe.setSizePolicy(sizePolicy) | ||||
|         self.pushButton_spe.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_spe.setObjectName("pushButton_spe") | ||||
|         self.horizontalLayout_5.addWidget(self.pushButton_spe) | ||||
|         self.verticalLayout_2.addLayout(self.horizontalLayout_5) | ||||
|         self.horizontalLayout_2.addLayout(self.verticalLayout_2) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout_2) | ||||
|         self.verticalLayout_plot = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_plot.setObjectName("verticalLayout_plot") | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_plot) | ||||
| 
 | ||||
|         self.retranslateUi(postprocessing) | ||||
|         QtCore.QMetaObject.connectSlotsByName(postprocessing) | ||||
| 
 | ||||
|     def retranslateUi(self, postprocessing): | ||||
|         postprocessing.setWindowTitle(QtGui.QApplication.translate("postprocessing", "Postprocessing", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("postprocessing", "Selection", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_rect.setText(QtGui.QApplication.translate("postprocessing", "Rectangle", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_poly.setText(QtGui.QApplication.translate("postprocessing", "Polygon", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_undo.setText(QtGui.QApplication.translate("postprocessing", "Unselect", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setText(QtGui.QApplication.translate("postprocessing", "Action", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_plot.setText(QtGui.QApplication.translate("postprocessing", "Plot", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_delete.setText(QtGui.QApplication.translate("postprocessing", "Delete", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setText(QtGui.QApplication.translate("postprocessing", "Color by (refreshes plot)", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_snr.setText(QtGui.QApplication.translate("postprocessing", "SNR", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_pe.setText(QtGui.QApplication.translate("postprocessing", "PE", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_spe.setText(QtGui.QApplication.translate("postprocessing", "SPE", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,49 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'repicking_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_repicking(object): | ||||
|     def setupUi(self, repicking): | ||||
|         repicking.setObjectName("repicking") | ||||
|         repicking.resize(640, 480) | ||||
|         self.verticalLayout = QtGui.QVBoxLayout(repicking) | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.pushButton_repick = QtGui.QPushButton(repicking) | ||||
|         self.pushButton_repick.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_repick.setObjectName("pushButton_repick") | ||||
|         self.horizontalLayout.addWidget(self.pushButton_repick) | ||||
|         self.pushButton_delete = QtGui.QPushButton(repicking) | ||||
|         self.pushButton_delete.setMaximumSize(QtCore.QSize(16777215, 30)) | ||||
|         self.pushButton_delete.setObjectName("pushButton_delete") | ||||
|         self.horizontalLayout.addWidget(self.pushButton_delete) | ||||
|         spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | ||||
|         self.horizontalLayout.addItem(spacerItem) | ||||
|         self.verticalLayout.addLayout(self.horizontalLayout) | ||||
|         self.verticalLayout_plot = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_plot.setObjectName("verticalLayout_plot") | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_plot) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(repicking) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(repicking) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), repicking.accept) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), repicking.reject) | ||||
|         QtCore.QMetaObject.connectSlotsByName(repicking) | ||||
| 
 | ||||
|     def retranslateUi(self, repicking): | ||||
|         repicking.setWindowTitle(QtGui.QApplication.translate("repicking", "Repicking", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_repick.setText(QtGui.QApplication.translate("repicking", "Repick", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_delete.setText(QtGui.QApplication.translate("repicking", "Delete", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,224 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| # Form implementation generated from reading ui file 'vtk_tools_layout.ui' | ||||
| # | ||||
| # Created: Mon Aug 29 10:26:23 2016 | ||||
| #      by: pyside-uic 0.2.15 running on PySide 1.2.2 | ||||
| # | ||||
| # WARNING! All changes made in this file will be lost! | ||||
| 
 | ||||
| from PySide import QtCore, QtGui | ||||
| 
 | ||||
| class Ui_vtk_tools(object): | ||||
|     def setupUi(self, vtk_tools): | ||||
|         vtk_tools.setObjectName("vtk_tools") | ||||
|         vtk_tools.resize(422, 471) | ||||
|         self.verticalLayout_9 = QtGui.QVBoxLayout(vtk_tools) | ||||
|         self.verticalLayout_9.setObjectName("verticalLayout_9") | ||||
|         self.verticalLayout = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout.setObjectName("verticalLayout") | ||||
|         self.verticalLayout_4 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_4.setObjectName("verticalLayout_4") | ||||
|         self.horizontalLayout = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout.setObjectName("horizontalLayout") | ||||
|         self.label_rec = QtGui.QLabel(vtk_tools) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_rec.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_rec.setSizePolicy(sizePolicy) | ||||
|         font = QtGui.QFont() | ||||
|         font.setWeight(75) | ||||
|         font.setBold(True) | ||||
|         self.label_rec.setFont(font) | ||||
|         self.label_rec.setToolTip("") | ||||
|         self.label_rec.setObjectName("label_rec") | ||||
|         self.horizontalLayout.addWidget(self.label_rec) | ||||
|         spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | ||||
|         self.horizontalLayout.addItem(spacerItem) | ||||
|         self.radioButton_abs = QtGui.QRadioButton(vtk_tools) | ||||
|         self.radioButton_abs.setChecked(True) | ||||
|         self.radioButton_abs.setObjectName("radioButton_abs") | ||||
|         self.horizontalLayout.addWidget(self.radioButton_abs) | ||||
|         self.radioButton_rel = QtGui.QRadioButton(vtk_tools) | ||||
|         self.radioButton_rel.setObjectName("radioButton_rel") | ||||
|         self.horizontalLayout.addWidget(self.radioButton_rel) | ||||
|         self.verticalLayout_4.addLayout(self.horizontalLayout) | ||||
|         self.verticalLayout_6 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_6.setObjectName("verticalLayout_6") | ||||
|         self.label_3 = QtGui.QLabel(vtk_tools) | ||||
|         self.label_3.setObjectName("label_3") | ||||
|         self.verticalLayout_6.addWidget(self.label_3) | ||||
|         self.horizontalLayout_2 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_2.setObjectName("horizontalLayout_2") | ||||
|         self.lineEdit_vg = QtGui.QLineEdit(vtk_tools) | ||||
|         self.lineEdit_vg.setObjectName("lineEdit_vg") | ||||
|         self.horizontalLayout_2.addWidget(self.lineEdit_vg) | ||||
|         self.pushButton_vg = QtGui.QPushButton(vtk_tools) | ||||
|         self.pushButton_vg.setObjectName("pushButton_vg") | ||||
|         self.horizontalLayout_2.addWidget(self.pushButton_vg) | ||||
|         self.verticalLayout_6.addLayout(self.horizontalLayout_2) | ||||
|         self.verticalLayout_4.addLayout(self.verticalLayout_6) | ||||
|         self.verticalLayout_7 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_7.setObjectName("verticalLayout_7") | ||||
|         self.label_4 = QtGui.QLabel(vtk_tools) | ||||
|         self.label_4.setObjectName("label_4") | ||||
|         self.verticalLayout_7.addWidget(self.label_4) | ||||
|         self.horizontalLayout_4 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_4.setObjectName("horizontalLayout_4") | ||||
|         self.lineEdit_vgref = QtGui.QLineEdit(vtk_tools) | ||||
|         self.lineEdit_vgref.setEnabled(False) | ||||
|         self.lineEdit_vgref.setObjectName("lineEdit_vgref") | ||||
|         self.horizontalLayout_4.addWidget(self.lineEdit_vgref) | ||||
|         self.pushButton_vgref = QtGui.QPushButton(vtk_tools) | ||||
|         self.pushButton_vgref.setEnabled(False) | ||||
|         self.pushButton_vgref.setObjectName("pushButton_vgref") | ||||
|         self.horizontalLayout_4.addWidget(self.pushButton_vgref) | ||||
|         self.verticalLayout_7.addLayout(self.horizontalLayout_4) | ||||
|         self.verticalLayout_8 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_8.setObjectName("verticalLayout_8") | ||||
|         self.verticalLayout_7.addLayout(self.verticalLayout_8) | ||||
|         self.label_5 = QtGui.QLabel(vtk_tools) | ||||
|         self.label_5.setObjectName("label_5") | ||||
|         self.verticalLayout_7.addWidget(self.label_5) | ||||
|         self.horizontalLayout_3 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_3.setObjectName("horizontalLayout_3") | ||||
|         self.lineEdit_vgout = QtGui.QLineEdit(vtk_tools) | ||||
|         self.lineEdit_vgout.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) | ||||
|         self.lineEdit_vgout.setObjectName("lineEdit_vgout") | ||||
|         self.horizontalLayout_3.addWidget(self.lineEdit_vgout) | ||||
|         self.pushButton_vtkout = QtGui.QPushButton(vtk_tools) | ||||
|         self.pushButton_vtkout.setObjectName("pushButton_vtkout") | ||||
|         self.horizontalLayout_3.addWidget(self.pushButton_vtkout) | ||||
|         self.pushButton_parav = QtGui.QPushButton(vtk_tools) | ||||
|         self.pushButton_parav.setObjectName("pushButton_parav") | ||||
|         self.horizontalLayout_3.addWidget(self.pushButton_parav) | ||||
|         self.verticalLayout_7.addLayout(self.horizontalLayout_3) | ||||
|         self.start_vg = QtGui.QPushButton(vtk_tools) | ||||
|         self.start_vg.setEnabled(False) | ||||
|         self.start_vg.setObjectName("start_vg") | ||||
|         self.verticalLayout_7.addWidget(self.start_vg) | ||||
|         self.verticalLayout_4.addLayout(self.verticalLayout_7) | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_4) | ||||
|         self.verticalLayout_2 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_2.setObjectName("verticalLayout_2") | ||||
|         self.line = QtGui.QFrame(vtk_tools) | ||||
|         self.line.setFrameShape(QtGui.QFrame.HLine) | ||||
|         self.line.setFrameShadow(QtGui.QFrame.Sunken) | ||||
|         self.line.setObjectName("line") | ||||
|         self.verticalLayout_2.addWidget(self.line) | ||||
|         self.label_src = QtGui.QLabel(vtk_tools) | ||||
|         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) | ||||
|         sizePolicy.setHorizontalStretch(0) | ||||
|         sizePolicy.setVerticalStretch(0) | ||||
|         sizePolicy.setHeightForWidth(self.label_src.sizePolicy().hasHeightForWidth()) | ||||
|         self.label_src.setSizePolicy(sizePolicy) | ||||
|         font = QtGui.QFont() | ||||
|         font.setWeight(75) | ||||
|         font.setBold(True) | ||||
|         self.label_src.setFont(font) | ||||
|         self.label_src.setObjectName("label_src") | ||||
|         self.verticalLayout_2.addWidget(self.label_src) | ||||
|         self.verticalLayout_3 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_3.setObjectName("verticalLayout_3") | ||||
|         self.label = QtGui.QLabel(vtk_tools) | ||||
|         self.label.setObjectName("label") | ||||
|         self.verticalLayout_3.addWidget(self.label) | ||||
|         self.horizontalLayout_6 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_6.setObjectName("horizontalLayout_6") | ||||
|         self.lineEdit_rays = QtGui.QLineEdit(vtk_tools) | ||||
|         self.lineEdit_rays.setObjectName("lineEdit_rays") | ||||
|         self.horizontalLayout_6.addWidget(self.lineEdit_rays) | ||||
|         self.pushButton_rays = QtGui.QPushButton(vtk_tools) | ||||
|         self.pushButton_rays.setObjectName("pushButton_rays") | ||||
|         self.horizontalLayout_6.addWidget(self.pushButton_rays) | ||||
|         self.verticalLayout_3.addLayout(self.horizontalLayout_6) | ||||
|         self.verticalLayout_2.addLayout(self.verticalLayout_3) | ||||
|         self.verticalLayout_5 = QtGui.QVBoxLayout() | ||||
|         self.verticalLayout_5.setObjectName("verticalLayout_5") | ||||
|         self.label_2 = QtGui.QLabel(vtk_tools) | ||||
|         self.label_2.setObjectName("label_2") | ||||
|         self.verticalLayout_5.addWidget(self.label_2) | ||||
|         self.horizontalLayout_5 = QtGui.QHBoxLayout() | ||||
|         self.horizontalLayout_5.setObjectName("horizontalLayout_5") | ||||
|         self.lineEdit_raysout = QtGui.QLineEdit(vtk_tools) | ||||
|         self.lineEdit_raysout.setObjectName("lineEdit_raysout") | ||||
|         self.horizontalLayout_5.addWidget(self.lineEdit_raysout) | ||||
|         self.pushButton_raysout = QtGui.QPushButton(vtk_tools) | ||||
|         self.pushButton_raysout.setObjectName("pushButton_raysout") | ||||
|         self.horizontalLayout_5.addWidget(self.pushButton_raysout) | ||||
|         self.verticalLayout_5.addLayout(self.horizontalLayout_5) | ||||
|         self.start_rays = QtGui.QPushButton(vtk_tools) | ||||
|         self.start_rays.setEnabled(False) | ||||
|         self.start_rays.setObjectName("start_rays") | ||||
|         self.verticalLayout_5.addWidget(self.start_rays) | ||||
|         self.verticalLayout_2.addLayout(self.verticalLayout_5) | ||||
|         self.verticalLayout.addLayout(self.verticalLayout_2) | ||||
|         self.verticalLayout_9.addLayout(self.verticalLayout) | ||||
|         self.buttonBox = QtGui.QDialogButtonBox(vtk_tools) | ||||
|         self.buttonBox.setOrientation(QtCore.Qt.Horizontal) | ||||
|         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) | ||||
|         self.buttonBox.setObjectName("buttonBox") | ||||
|         self.verticalLayout_9.addWidget(self.buttonBox) | ||||
| 
 | ||||
|         self.retranslateUi(vtk_tools) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), vtk_tools.accept) | ||||
|         QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), vtk_tools.reject) | ||||
|         QtCore.QMetaObject.connectSlotsByName(vtk_tools) | ||||
| 
 | ||||
|     def retranslateUi(self, vtk_tools): | ||||
|         vtk_tools.setWindowTitle(QtGui.QApplication.translate("vtk_tools", "VTK tools", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_rec.setText(QtGui.QApplication.translate("vtk_tools", "Velocity grid to VTK", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_abs.setToolTip(QtGui.QApplication.translate("vtk_tools", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load <span style=\" font-weight:600;\">normal </span>measured receiver input file. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[trace ID (int)]  [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Geophone with the trace ID 50 and the coordinates (10.5 [m], 20.4 [m], 30.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">50  10.5  20.4  30.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_abs.setText(QtGui.QApplication.translate("vtk_tools", "absolute [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_rel.setToolTip(QtGui.QApplication.translate("vtk_tools", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Load<span style=\" font-weight:600;\"> </span>measured receiver input file that can be <span style=\" font-weight:600;\">interpolated</span>. The input file must be in the following format:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Containing in each line, separated by spaces:</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">[trace ID (int)] [receiver line ID (int)] [number of the geophone on receiver line (int)]  [X (float)]  [Y (float)]  [Z (float)]</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">For example:</span></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Third geophone on the second receiver line with the trace ID 50 and the coordinates (10.5 [m], 20.4 [m], 30.3 [m]).</p>\n" | ||||
| "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">50  2  3  10.5  20.4  30.3</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.radioButton_rel.setText(QtGui.QApplication.translate("vtk_tools", "relative [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_3.setText(QtGui.QApplication.translate("vtk_tools", "Browse for velocity grid file (\'vgrids.in\'):", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_vg.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_4.setText(QtGui.QApplication.translate("vtk_tools", "Browse for reference velocity grid file (\'vgridsref.in\'):", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_vgref.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_5.setText(QtGui.QApplication.translate("vtk_tools", "Output Filename:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.lineEdit_vgout.setText(QtGui.QApplication.translate("vtk_tools", "vgrids.vtk", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_vtkout.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_parav.setToolTip(QtGui.QApplication.translate("vtk_tools", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" | ||||
| "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" | ||||
| "p, li { white-space: pre-wrap; }\n" | ||||
| "</style></head><body style=\" font-family:\'Sans\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" | ||||
| "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Call Paraview (Shell command: <span style=\" font-style:italic;\">paraview</span>) for the specified output filename in the current directory.</p></body></html>", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_parav.setText(QtGui.QApplication.translate("vtk_tools", "<- Paraview", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.start_vg.setText(QtGui.QApplication.translate("vtk_tools", "Start", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_src.setToolTip(QtGui.QApplication.translate("vtk_tools", "Create VTK files from the FMTOMO output file \'rays.dat\'.\n" | ||||
| "This will generate one file of ray paths for each individual source.", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_src.setText(QtGui.QApplication.translate("vtk_tools", "Rays to VTK [?]", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label.setText(QtGui.QApplication.translate("vtk_tools", "Browse for input file (\'rays.dat\'):", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_rays.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.label_2.setText(QtGui.QApplication.translate("vtk_tools", "Specify output directory:", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.pushButton_raysout.setText(QtGui.QApplication.translate("vtk_tools", "Browse", None, QtGui.QApplication.UnicodeUTF8)) | ||||
|         self.start_rays.setText(QtGui.QApplication.translate("vtk_tools", "Start", None, QtGui.QApplication.UnicodeUTF8)) | ||||
| 
 | ||||
| @ -1,773 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| import os | ||||
| import numpy as np | ||||
| import matplotlib | ||||
| import matplotlib.pyplot as plt | ||||
| from PySide import QtCore, QtGui | ||||
| from pylot.core.active import surveyUtils, activeSeismoPick, seismicArrayPreparation, fmtomoUtils | ||||
| from generate_survey_layout import Ui_generate_survey | ||||
| from generate_survey_layout_minimal import Ui_generate_survey_minimal | ||||
| from generate_seisarray_layout import Ui_generate_seisarray | ||||
| from picking_parameters_layout import Ui_picking_parameters | ||||
| from fmtomo_parameters_layout import Ui_fmtomo_parameters | ||||
| from vtk_tools_layout import Ui_vtk_tools | ||||
| from postprocessing_layout import Ui_postprocessing | ||||
| from repicking_layout import Ui_repicking | ||||
| 
 | ||||
| from pylot.core.active.surveyPlotTools import regions | ||||
| 
 | ||||
| matplotlib.use('Qt4Agg') | ||||
| matplotlib.rcParams['backend.qt4']='PySide' | ||||
| 
 | ||||
| from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas | ||||
| from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar | ||||
| from matplotlib.figure import Figure | ||||
| 
 | ||||
| def openFile(name = 'Open'): | ||||
|     dialog = QtGui.QFileDialog() | ||||
|     dialog.setWindowTitle(name)                #not working yet | ||||
|     filename = dialog.getOpenFileName() | ||||
|     if len(filename[0]) > 0: | ||||
|         return filename[0] | ||||
| 
 | ||||
| def saveFile(name = 'Save'): | ||||
|     dialog = QtGui.QFileDialog() | ||||
|     dialog.setWindowTitle(name) | ||||
|     filename = dialog.getSaveFileName() | ||||
|     if len(filename[0]) > 0: | ||||
|         return filename[0] | ||||
| 
 | ||||
| def browseDir(name = 'Open Directory'): | ||||
|     dialog = QtGui.QFileDialog() | ||||
|     dialog.setWindowTitle(name) | ||||
|     directory = dialog.getExistingDirectory() | ||||
|     if len(directory) > 0: | ||||
|         return directory | ||||
| 
 | ||||
| def getMaxCPU(): | ||||
|     import multiprocessing | ||||
|     return multiprocessing.cpu_count() | ||||
| 
 | ||||
| def printDialogMessage(message): | ||||
|     qmb = QtGui.QMessageBox() | ||||
|     qmb.setText(message) | ||||
|     qmb.setStandardButtons(QtGui.QMessageBox.Ok) | ||||
|     qmb.setIcon(QtGui.QMessageBox.Warning) | ||||
|     qmb.exec_() | ||||
| 
 | ||||
| def continueDialogExists(name): | ||||
|     qmb = QtGui.QMessageBox() | ||||
|     qmb.setText('%s object already exists. Overwrite?'%name) | ||||
|     qmb.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | ||||
|     qmb.setIcon(QtGui.QMessageBox.Warning) | ||||
|     answer = qmb.exec_() | ||||
|     if answer == 1024: | ||||
|         return True | ||||
|     else: | ||||
|         return False | ||||
| 
 | ||||
| def continueDialogMessage(message): | ||||
|     qmb = QtGui.QMessageBox() | ||||
|     qmb.setText(message) | ||||
|     qmb.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | ||||
|     qmb.setIcon(QtGui.QMessageBox.Warning) | ||||
|     answer = qmb.exec_() | ||||
|     if answer == 1024: | ||||
|         return True | ||||
|     else: | ||||
|         return False | ||||
| 
 | ||||
| 
 | ||||
| class Gen_SeisArray(object): | ||||
|     def __init__(self, mainwindow): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.seisarray = None | ||||
|         self.srcfile = None | ||||
|         self.recfile = None | ||||
|         self.ptsfile = None | ||||
|         self.init_dialog() | ||||
|         self.start_dialog() | ||||
| 
 | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_generate_seisarray() | ||||
|         ui.setupUi(qdialog) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.connectButtons() | ||||
| 
 | ||||
|     def start_dialog(self): | ||||
|         if self.qdialog.exec_(): | ||||
|             self.refresh_selection() | ||||
|             if self.ui.radioButton_interpolatable.isChecked(): | ||||
|                 self.seisarray = seismicArrayPreparation.SeisArray(self.recfile, True) | ||||
|             elif self.ui.radioButton_normal.isChecked(): | ||||
|                 self.seisarray = seismicArrayPreparation.SeisArray(self.recfile, False) | ||||
|             if len(self.srcfile) > 0: | ||||
|                 self.seisarray.addSourceLocations(self.srcfile) | ||||
|             if len(self.ptsfile) > 0: | ||||
|                 self.seisarray.addMeasuredTopographyPoints(self.ptsfile) | ||||
|             self.executed = True | ||||
|         else: | ||||
|             self.refresh_selection() | ||||
|             self.executed = False | ||||
| 
 | ||||
|     def refresh_selection(self): | ||||
|         self.srcfile = self.ui.lineEdit_src.text() | ||||
|         self.recfile = self.ui.lineEdit_rec.text() | ||||
|         self.ptsfile = self.ui.lineEdit_pts.text() | ||||
| 
 | ||||
|     def get_seisarray(self): | ||||
|         if self.seisarray is not None: | ||||
|             return self.seisarray | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.pushButton_rec, QtCore.SIGNAL("clicked()"), self.chooseMeasuredRec) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_src, QtCore.SIGNAL("clicked()"), self.chooseMeasuredSrc) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_obs, QtCore.SIGNAL("clicked()"), self.chooseMeasuredPts) | ||||
| 
 | ||||
|     def chooseMeasuredSrc(self): | ||||
|         self.ui.lineEdit_src.setText(openFile('Open measured sources file.')) | ||||
| 
 | ||||
|     def chooseMeasuredRec(self): | ||||
|         self.ui.lineEdit_rec.setText(openFile('Open measured receivers file.')) | ||||
| 
 | ||||
|     def chooseMeasuredPts(self): | ||||
|         self.ui.lineEdit_pts.setText(openFile('Open measured points file.')) | ||||
| 
 | ||||
| 
 | ||||
| class Gen_Survey_from_SA(object): | ||||
|     def __init__(self, mainwindow, seisarray): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.seisarray = seisarray | ||||
|         self.survey = None | ||||
|         self.obsdir = None | ||||
|         self.fstart = 'shot' | ||||
|         self.fend = '.dat' | ||||
|         self.init_dialog() | ||||
|         self.start_dialog() | ||||
| 
 | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_generate_survey_minimal() | ||||
|         ui.setupUi(qdialog) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.connectButtons() | ||||
| 
 | ||||
|     def start_dialog(self): | ||||
|         if self.qdialog.exec_(): | ||||
|             self.refresh_selection() | ||||
|             self.survey = activeSeismoPick.Survey(self.obsdir, seisArray = self.seisarray, | ||||
|                                                   useDefaultParas = True, fstart = self.fstart, | ||||
|                                                   fend = self.fend) | ||||
|             self.executed = True | ||||
|         else: | ||||
|             self.refresh_selection() | ||||
|             self.executed = False | ||||
| 
 | ||||
|     def update_seisarray(self, seisarray): | ||||
|         self.seisarray = seisarray | ||||
|          | ||||
|     def refresh_selection(self): | ||||
|         self.obsdir = self.ui.lineEdit_obs.text() | ||||
|         self.fstart = self.ui.fstart.text() | ||||
|         self.fend = self.ui.fend.text() | ||||
| 
 | ||||
|     def get_survey(self): | ||||
|         return self.survey | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.pushButton_obs, QtCore.SIGNAL("clicked()"), self.chooseObsdir) | ||||
| 
 | ||||
|     def chooseObsdir(self): | ||||
|         self.ui.lineEdit_obs.setText(browseDir('Choose observation directory.')) | ||||
| 
 | ||||
| 
 | ||||
| class Gen_Survey_from_SR(object): | ||||
|     def __init__(self, mainwindow): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.survey = None | ||||
|         self.obsdir = None | ||||
|         self.srcfile = None | ||||
|         self.recfile = None | ||||
|         self.fstart = 'shot' | ||||
|         self.fend = '.dat' | ||||
|         self.init_dialog() | ||||
|         self.start_dialog() | ||||
| 
 | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_generate_survey() | ||||
|         ui.setupUi(qdialog) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.connectButtons() | ||||
| 
 | ||||
|     def start_dialog(self): | ||||
|         if self.qdialog.exec_(): | ||||
|             self.refresh_selection() | ||||
|             self.survey = activeSeismoPick.Survey(self.obsdir, self.srcfile, self.recfile, | ||||
|                                                   useDefaultParas = True, | ||||
|                                                   fstart = self.fstart, fend = self.fend) | ||||
|             self.executed = True | ||||
|         else: | ||||
|             self.refresh_selection() | ||||
|             self.executed = False | ||||
| 
 | ||||
|     def refresh_selection(self): | ||||
|         self.obsdir = self.ui.lineEdit_obs.text() | ||||
|         self.srcfile = self.ui.lineEdit_src.text() | ||||
|         self.recfile = self.ui.lineEdit_rec.text() | ||||
|         self.fstart = self.ui.fstart.text() | ||||
|         self.fend = self.ui.fend.text() | ||||
| 
 | ||||
|     def get_survey(self): | ||||
|         return self.survey | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.pushButton_obs, QtCore.SIGNAL("clicked()"), self.chooseObsdir) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_src, QtCore.SIGNAL("clicked()"), self.chooseSourcefile) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_rec, QtCore.SIGNAL("clicked()"), self.chooseRecfile) | ||||
| 
 | ||||
|     def chooseObsdir(self): | ||||
|         self.ui.lineEdit_obs.setText(browseDir('Choose observation directory.')) | ||||
| 
 | ||||
|     def chooseSourcefile(self): | ||||
|         self.ui.lineEdit_src.setText(openFile('Open sourcefile.')) | ||||
| 
 | ||||
|     def chooseRecfile(self): | ||||
|         self.ui.lineEdit_rec.setText(openFile('Open receiverfile.')) | ||||
| 
 | ||||
| 
 | ||||
| class Call_autopicker(object): | ||||
|     def __init__(self, mainwindow, survey): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.survey = survey | ||||
|         self.maxSRdist = None | ||||
|         self.dists_p = [] | ||||
|         self.snr_p = [] | ||||
|         self.lines = [] | ||||
|         self.init_dialog() | ||||
|         self.refresh_selection() | ||||
|         self.enableDynSNR(False)                 | ||||
|         self.start_dialog() | ||||
|          | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_picking_parameters() | ||||
|         ui.setupUi(qdialog) | ||||
|         ui.ncores.setMaximum(getMaxCPU()) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.initSNRplot() | ||||
|         self.connectButtons() | ||||
| 
 | ||||
|     def getMaxSRdist(self): | ||||
|         if self.maxSRdist is not None: | ||||
|             return self.maxSRdist | ||||
|         else: | ||||
|             SRdists = [] | ||||
|             for shot in self.survey.data.values(): | ||||
|                 for traceID in shot.getTraceIDlist(): | ||||
|                     SRdists.append(shot.getDistance(traceID)) | ||||
|             self.maxSRdist = max(SRdists) | ||||
|             return self.maxSRdist | ||||
| 
 | ||||
|     def update_survey(self, survey): | ||||
|         self.survey = survey | ||||
|          | ||||
|     def initSNRplot(self): | ||||
|         self.snrFig = Figure() | ||||
|         self.snrCanvas = FigureCanvas(self.snrFig) | ||||
|         self.ui.vlayout_plot.addWidget(self.snrCanvas) | ||||
|         self.snrToolbar = NavigationToolbar(self.snrCanvas, self.mainwindow) | ||||
|         self.ui.vlayout_plot.addWidget(self.snrToolbar) | ||||
| 
 | ||||
|     def prepFigure(self, refresh = True): | ||||
|         fig = self.snrFig | ||||
|         if fig.axes == []: | ||||
|             ax = fig.add_subplot(111) | ||||
|             xlim = None | ||||
|             ylim = None | ||||
|         else: | ||||
|             ax = fig.axes[0] | ||||
|             xlim = ax.get_xlim() | ||||
|             ylim = ax.get_ylim() | ||||
|         #ax.clear() | ||||
|         if not refresh: | ||||
|             self.plotPicks(ax) | ||||
|         else: | ||||
|             self.clear_lines() | ||||
| 
 | ||||
|         return fig, ax, xlim, ylim | ||||
| 
 | ||||
|     def clear_lines(self): | ||||
|         for line in self.lines: | ||||
|             line.remove() | ||||
|         self.lines = [] | ||||
|          | ||||
|     def finishFigure(self, ax, xlim, ylim): | ||||
|         ax.set_xlim(xlim) | ||||
|         ax.set_ylim(ylim) | ||||
| 
 | ||||
|     def finishNewFigure(self, ax): | ||||
|         xlim = None | ||||
|         ylim = None | ||||
|         ax.set_xlabel('Distance [m]') | ||||
|         ax.set_ylabel('SNR') | ||||
|         return xlim, ylim | ||||
|          | ||||
|     def plotPicks(self, ax): | ||||
|         if self.survey.picked: | ||||
|             if self.dists_p == [] or self.snr_p == []: | ||||
|                 for shot in self.survey.data.values(): | ||||
|                     for traceID in shot.getTraceIDlist(): | ||||
|                         self.dists_p.append(shot.getDistance(traceID)) | ||||
|                         self.snr_p.append(shot.getSNR(traceID)[0]) | ||||
| 
 | ||||
|             ax.scatter(self.dists_p, self.snr_p, s = 0.5, c='k') | ||||
|          | ||||
|     def plotConstSNR(self, refresh = True): | ||||
|         fig, ax, xlim, ylim = self.prepFigure(refresh) | ||||
|              | ||||
|         snrthreshold = float(self.ui.doubleSpinBox_constSNR.text()) | ||||
|         line = ax.hlines(snrthreshold, 0, self.getMaxSRdist(), 'b') | ||||
|         self.lines.append(line) | ||||
| 
 | ||||
|         if refresh == False: | ||||
|             xlim, ylim = self.finishNewFigure(ax) | ||||
| 
 | ||||
|         if self.survey.picked: | ||||
|             self.finishFigure(ax, xlim, ylim) | ||||
|              | ||||
|         self.snrCanvas.draw() | ||||
|              | ||||
|     def plotDynSNR(self, refresh = True): | ||||
|         fig, ax, xlim, ylim = self.prepFigure(refresh) | ||||
|         snrthresholds = [] | ||||
|         shiftSNR = float(self.ui.shift_snr.value()) | ||||
|         shiftDist = float(self.ui.shift_dist.value()) | ||||
|         p1 = float(self.ui.p1.value()) | ||||
|         p2 = float(self.ui.p2.value()) | ||||
|         dists = np.arange(0, self.getMaxSRdist() + 1, 1) | ||||
|          | ||||
|         for dist in dists: | ||||
|             dist += shiftDist | ||||
|             snrthresholds.append(surveyUtils.snr_fit_func(surveyUtils.get_fit_fn(p1, p2), dist, shiftSNR)) | ||||
|         self.lines = ax.plot(dists, snrthresholds, 'b') | ||||
| 
 | ||||
|         if refresh == False: | ||||
|             xlim, ylim = self.finishNewFigure(ax) | ||||
| 
 | ||||
|         if self.survey.picked: | ||||
|             self.finishFigure(ax, xlim, ylim) | ||||
|              | ||||
|         self.snrCanvas.draw() | ||||
| 
 | ||||
|     def plotSNR(self, refresh = True): | ||||
|         if self.ui.radioButton_const.isChecked(): | ||||
|             self.plotConstSNR(refresh) | ||||
|         if self.ui.radioButton_dyn.isChecked(): | ||||
|             self.plotDynSNR(refresh) | ||||
| 
 | ||||
|     def snr_toggle(self): | ||||
|         if self.ui.radioButton_const.isChecked(): | ||||
|             self.enableDynSNR(False) | ||||
|             self.enableConstSNR(True) | ||||
|         if self.ui.radioButton_dyn.isChecked(): | ||||
|             self.enableConstSNR(False) | ||||
|             self.enableDynSNR(True) | ||||
|         self.plotSNR(refresh = True) | ||||
| 
 | ||||
|     def enableDynSNR(self, bool): | ||||
|         self.ui.shift_dist.setEnabled(bool) | ||||
|         self.ui.shift_snr.setEnabled(bool) | ||||
|         self.ui.p1.setEnabled(bool) | ||||
|         self.ui.p2.setEnabled(bool) | ||||
|              | ||||
|     def enableConstSNR(self, bool): | ||||
|         self.ui.doubleSpinBox_constSNR.setEnabled(bool) | ||||
|          | ||||
|     def start_dialog(self): | ||||
|         self.plotSNR(refresh = False) | ||||
|         if self.qdialog.exec_(): | ||||
|             self.refresh_selection() | ||||
| 
 | ||||
|             if self.AIC == True: | ||||
|                 HosAic = 'aic' | ||||
|             else: | ||||
|                 HosAic = 'hos' | ||||
| 
 | ||||
|             surveyUtils.setDynamicFittedSNR(self.survey.getShotDict(), shiftdist = self.shiftDist, | ||||
|                                             shiftSNR = self.shiftSNR, p1 = self.p1, p2 = self.p2) | ||||
| 
 | ||||
|             self.survey.pickAllShots(vmin = self.vmin, vmax = self.vmax, | ||||
|                                      folm = self.folm/100., HosAic = HosAic, | ||||
|                                      aicwindow = self.aicwindow, cores = self.ncores) | ||||
|              | ||||
|             #QtGui.qApp.processEvents() # test | ||||
|             self.executed = True | ||||
|             self.clear_lines() | ||||
|         else: | ||||
|             self.refresh_selection() | ||||
|             self.executed = False | ||||
|             self.clear_lines() | ||||
| 
 | ||||
|     def refreshFolm(self): | ||||
|         self.ui.label_folm.setText('%s %%'%self.ui.slider_folm.value()) | ||||
| 
 | ||||
|     def refresh_selection(self): | ||||
|         self.ncores = int(self.ui.ncores.value()) | ||||
|         self.vmin = float(self.ui.lineEdit_vmin.text()) | ||||
|         self.vmax = float(self.ui.lineEdit_vmax.text()) | ||||
|         self.folm = float(self.ui.slider_folm.value()) | ||||
|         self.AIC = self.ui.checkBox_AIC.isChecked() | ||||
|         self.aicwindow = (int(self.ui.lineEdit_aicleft.text()), int(self.ui.lineEdit_aicright.text())) | ||||
|         self.shiftSNR = float(self.ui.shift_snr.value()) | ||||
|         self.shiftDist = float(self.ui.shift_dist.value()) | ||||
|         self.p1 = float(self.ui.p1.value()) | ||||
|         self.p2 = float(self.ui.p2.value()) | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.slider_folm, QtCore.SIGNAL("valueChanged(int)"), self.refreshFolm) | ||||
|         QtCore.QObject.connect(self.ui.shift_snr, QtCore.SIGNAL("valueChanged(int)"), self.plotSNR) | ||||
|         QtCore.QObject.connect(self.ui.shift_dist, QtCore.SIGNAL("valueChanged(int)"), self.plotSNR) | ||||
|         QtCore.QObject.connect(self.ui.p1, QtCore.SIGNAL("valueChanged(double)"), self.plotSNR) | ||||
|         QtCore.QObject.connect(self.ui.p2, QtCore.SIGNAL("valueChanged(double)"), self.plotSNR) | ||||
|         QtCore.QObject.connect(self.ui.doubleSpinBox_constSNR, QtCore.SIGNAL("valueChanged(double)"), self.plotSNR) | ||||
|         QtCore.QObject.connect(self.ui.radioButton_const, QtCore.SIGNAL("clicked()"), self.snr_toggle) | ||||
|         QtCore.QObject.connect(self.ui.radioButton_dyn, QtCore.SIGNAL("clicked()"), self.snr_toggle) | ||||
| 
 | ||||
|     def chooseObsdir(self): | ||||
|         self.ui.lineEdit_obs.setText(browseDir('Choose observation directory.')) | ||||
| 
 | ||||
|     def chooseSourcefile(self): | ||||
|         self.ui.lineEdit_src.setText(openFile('Open sourcefile.')) | ||||
| 
 | ||||
|     def chooseRecfile(self): | ||||
|         self.ui.lineEdit_rec.setText(openFile('Open receiverfile.')) | ||||
| 
 | ||||
| 
 | ||||
| class Call_FMTOMO(object): | ||||
|     def __init__(self, mainwindow, survey): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.survey = survey | ||||
|         self.init_dialog() | ||||
|         self.refresh_selection()                                         | ||||
|         self.start_dialog() | ||||
| 
 | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_fmtomo_parameters() | ||||
|         ui.setupUi(qdialog) | ||||
|         ui.nproc.setMaximum(getMaxCPU()) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.connectButtons() | ||||
|          | ||||
|     def start_dialog(self): | ||||
|         if self.qdialog.exec_(): | ||||
|             self.refresh_selection() | ||||
| 
 | ||||
|             if not os.path.isdir(self.picks_dir): | ||||
|                 err = os.mkdir(self.picks_dir) # error not handled yet | ||||
| 
 | ||||
|             self.survey.exportFMTOMO(self.picks_dir) | ||||
| 
 | ||||
|             cwd = os.getcwd() | ||||
|             interpolationMethod = 'linear' | ||||
|             os.chdir(self.simuldir) | ||||
|             if self.survey.seisarray.twoDim: | ||||
|                 interpolationMethod = 'nearest' | ||||
|             self.survey.seisarray.generateFMTOMOinputFromArray(self.propgrid, self.vgrid, (self.bbot, self.btop), | ||||
|                                                                self.cushionfactor/100., interpolationMethod, | ||||
|                                                                customgrid = self.customgrid, writeVTK = True) | ||||
|             os.chdir(cwd) | ||||
| 
 | ||||
|             tomo = fmtomoUtils.Tomo3d(self.fmtomo_dir, self.simuldir) | ||||
|             tomo.runTOMO3D(self.nproc, self.nIter) | ||||
| 
 | ||||
|             self.executed = True | ||||
|         else: | ||||
|             self.refresh_selection() | ||||
|             self.executed = False | ||||
| 
 | ||||
|     def update_survey(self, survey): | ||||
|         self.survey = survey | ||||
|          | ||||
|     def refresh_selection(self): | ||||
|         self.fmtomo_dir = self.ui.fmtomo_dir.text() | ||||
|         self.nIter = int(self.ui.nIter.value()) | ||||
|         self.nproc = int(self.ui.nproc.value()) | ||||
|         self.btop = float(self.ui.btop.text()) | ||||
|         self.bbot = float(self.ui.bbot.text()) | ||||
|         self.propgrid = (int(self.ui.pgrid_x.value()), int(self.ui.pgrid_y.value()), int(self.ui.pgrid_z.value())) | ||||
|         self.vgrid = (int(self.ui.invgrid_x.value()), int(self.ui.invgrid_y.value()), int(self.ui.invgrid_z.value())) | ||||
|         self.cushionfactor = float(self.ui.cushion.value()) | ||||
|         self.customgrid = self.ui.customgrid.text() | ||||
|         self.simuldir = self.ui.simuldir.text() | ||||
|         self.picks_dir = os.path.join(self.simuldir, 'picks') | ||||
|          | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.browse_tomodir, QtCore.SIGNAL("clicked()"), self.chooseFMTOMOdir) | ||||
|         QtCore.QObject.connect(self.ui.browse_customgrid, QtCore.SIGNAL("clicked()"), self.chooseCustomgrid) | ||||
|         QtCore.QObject.connect(self.ui.browse_simuldir, QtCore.SIGNAL("clicked()"), self.chooseSimuldir) | ||||
| 
 | ||||
|     def chooseFMTOMOdir(self): | ||||
|         self.ui.fmtomo_dir.setText(browseDir()) | ||||
| 
 | ||||
|     def chooseCustomgrid(self): | ||||
|         self.ui.customgrid.setText(openFile()) | ||||
| 
 | ||||
|     def chooseSimuldir(self): | ||||
|         self.ui.simuldir.setText(browseDir()) | ||||
| 
 | ||||
| 
 | ||||
| class Call_VTK_dialog(object): | ||||
|     def __init__(self, mainwindow): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.init_dialog() | ||||
|         self.refresh_selection()                                         | ||||
|         self.start_dialog() | ||||
| 
 | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_vtk_tools() | ||||
|         ui.setupUi(qdialog) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.connectButtons() | ||||
|          | ||||
|     def start_dialog(self): | ||||
|         self.qdialog.exec_() | ||||
|         self.refresh_selection() | ||||
| 
 | ||||
|     def refresh_selection(self): | ||||
|         self.vg = self.ui.lineEdit_vg.text() | ||||
|         self.vgout = self.ui.lineEdit_vgout.text() | ||||
|         self.rays = self.ui.lineEdit_rays.text() | ||||
|         self.raysout = self.ui.lineEdit_raysout.text() | ||||
|          | ||||
|     def checkVgStartButton(self): | ||||
|         ui = self.ui | ||||
|         if ui.radioButton_rel.isChecked(): | ||||
|             if ui.lineEdit_vg.text() != '' and ui.lineEdit_vgref.text() != '': | ||||
|                 ui.start_vg.setEnabled(True) | ||||
|             else: | ||||
|                 ui.start_vg.setEnabled(False) | ||||
|         if ui.radioButton_abs.isChecked(): | ||||
|             if ui.lineEdit_vg.text() != '': | ||||
|                 ui.start_vg.setEnabled(True) | ||||
|             else: | ||||
|                 ui.start_vg.setEnabled(False)                 | ||||
| 
 | ||||
|     def checkRaysStartButton(self): | ||||
|         ui = self.ui | ||||
|         if ui.lineEdit_rays.text() != '' and ui.lineEdit_raysout.text() != '': | ||||
|             ui.start_rays.setEnabled(True) | ||||
|         else: | ||||
|             ui.start_rays.setEnabled(False) | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.pushButton_vg, QtCore.SIGNAL("clicked()"), self.chooseVgrid) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_vgref, QtCore.SIGNAL("clicked()"), self.chooseVgridref) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_rays, QtCore.SIGNAL("clicked()"), self.chooseRaysIn) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_raysout, QtCore.SIGNAL("clicked()"), self.chooseRaysOutDir) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_vtkout, QtCore.SIGNAL("clicked()"), self.newFileVTK) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_parav, QtCore.SIGNAL("clicked()"), self.openFileParaview) | ||||
|         QtCore.QObject.connect(self.ui.start_vg, QtCore.SIGNAL("clicked()"), self.startvgvtk) | ||||
|         QtCore.QObject.connect(self.ui.start_rays, QtCore.SIGNAL("clicked()"), self.startraysvtk) | ||||
|         QtCore.QObject.connect(self.ui.radioButton_rel, QtCore.SIGNAL("clicked()"), self.activateVgref) | ||||
|         QtCore.QObject.connect(self.ui.radioButton_abs, QtCore.SIGNAL("clicked()"), self.deactivateVgref) | ||||
| 
 | ||||
|     def openFileParaview(self): | ||||
|         os.system('paraview %s &'%self.ui.lineEdit_vgout.text()) | ||||
| 
 | ||||
|     def activateVgref(self): | ||||
|         self.ui.lineEdit_vgref.setEnabled(True) | ||||
|         self.ui.pushButton_vgref.setEnabled(True) | ||||
| 
 | ||||
|     def deactivateVgref(self): | ||||
|         self.ui.lineEdit_vgref.setEnabled(False) | ||||
|         self.ui.pushButton_vgref.setEnabled(False) | ||||
| 
 | ||||
|     def chooseVgrid(self): | ||||
|         self.ui.lineEdit_vg.setText(openFile()) | ||||
|         self.checkVgStartButton() | ||||
| 
 | ||||
|     def chooseVgridref(self): | ||||
|         self.ui.lineEdit_vgref.setText(openFile()) | ||||
|         self.checkVgStartButton() | ||||
| 
 | ||||
|     def chooseRaysIn(self): | ||||
|         self.ui.lineEdit_rays.setText(openFile()) | ||||
|         self.checkRaysStartButton() | ||||
| 
 | ||||
|     def chooseRaysOutDir(self): | ||||
|         self.ui.lineEdit_raysout.setText(browseDir()) | ||||
|         self.checkRaysStartButton() | ||||
| 
 | ||||
|     def startvgvtk(self): | ||||
|         ui = self.ui | ||||
|         if ui.lineEdit_vgout.text() == '': | ||||
|             return             | ||||
|         if ui.radioButton_abs.isChecked(): | ||||
|             fmtomoUtils.vgrids2VTK(inputfile = ui.lineEdit_vg.text(), | ||||
|                                    outputfile = ui.lineEdit_vgout.text(), | ||||
|                                    absOrRel='abs') | ||||
|         elif ui.radioButton_rel.isChecked(): | ||||
|             fmtomoUtils.vgrids2VTK(inputfile = ui.lineEdit_vg.text(), | ||||
|                                    outputfile = ui.lineEdit_vgout.text(), | ||||
|                                    absOrRel='rel', | ||||
|                                    inputfileref = ui.lineEdit_vgref.text()) | ||||
| 
 | ||||
|     def startraysvtk(self): | ||||
|         ui = self.ui | ||||
|         fmtomoUtils.rays2VTK(ui.lineEdit_rays.text(), ui.lineEdit_raysout.text()) | ||||
| 
 | ||||
|     def newFileVTK(self): | ||||
|         self.ui.lineEdit_vgout.setText(saveFile()) | ||||
| 
 | ||||
| class Postprocessing(object): | ||||
|     def __init__(self, mainwindow, survey): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.survey = survey | ||||
|         self.init_widget() | ||||
|         self.start_widget() | ||||
|         self.inkByVal = 'snrlog' | ||||
|          | ||||
|     def init_widget(self): | ||||
|         qwidget = QtGui.QWidget()# | ||||
|         ui = Ui_postprocessing() | ||||
|         ui.setupUi(qwidget) | ||||
|         self.ui = ui | ||||
|         self.qwidget = qwidget | ||||
|         self.initPlot() | ||||
|         self.newPlot() | ||||
|         self.connectButtons() | ||||
|         self.region = regions(self.ax, self.cbar, self.survey, qt_interface = True) | ||||
|          | ||||
|     def start_widget(self): | ||||
|         self.qwidget.show() | ||||
| 
 | ||||
|     def initPlot(self): | ||||
|         self.figure = Figure() | ||||
|         self.canvas = FigureCanvas(self.figure) | ||||
|         self.ui.verticalLayout_plot.addWidget(self.canvas) | ||||
|         self.toolbar = NavigationToolbar(self.canvas, self.mainwindow) | ||||
|         self.ui.verticalLayout_plot.addWidget(self.toolbar) | ||||
|          | ||||
|     def newPlot(self): | ||||
|         ax = self.figure.add_subplot(111) | ||||
|         dists, picks, snrlog, pe, spe = self.survey.preparePlotAllPicks(plotRemoved = False) | ||||
|         self.dists = dists | ||||
|         self.picks = picks | ||||
|         self.inkDict = {'snrlog': snrlog, | ||||
|                         'pe': pe, | ||||
|                         'spe': spe} | ||||
|                     | ||||
|         ax, cbar, sc = self.survey.createPlot(dists, picks, snrlog, 'log10(SNR)', ax = ax, cbar = None) | ||||
|         self.cbar = self.figure.colorbar(sc, ax = ax, fraction=0.05) | ||||
|         self.ax = ax | ||||
|         self.draw() | ||||
| 
 | ||||
|     def refreshPlot(self): | ||||
|         self.ax.clear() | ||||
|         ax = self.ax | ||||
|         ax, cbar, sc = self.survey.createPlot(self.dists, self.picks, self.inkDict[self.inkByVal], | ||||
|                                               self.inkByVal, ax = ax, cbar = self.cbar) | ||||
|         #self.cbar = self.figure.colorbar(sc, fraction=0.05) | ||||
|         self.draw() | ||||
|          | ||||
|     def update_survey(self, survey): | ||||
|         self.survey = survey | ||||
|          | ||||
|     def get_survey(self): | ||||
|         return self.survey | ||||
| 
 | ||||
|     def draw(self): | ||||
|         self.canvas.draw() | ||||
|          | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.pushButton_rect, QtCore.SIGNAL("clicked()"), self.chooseRect) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_poly, QtCore.SIGNAL("clicked()"), self.choosePoly) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_plot, QtCore.SIGNAL("clicked()"), self.plotPicks) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_delete, QtCore.SIGNAL("clicked()"), self.deleteSelected) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_undo, QtCore.SIGNAL("clicked()"), self.undoSelection) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_snr, QtCore.SIGNAL("clicked()"), self.refrSNR) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_pe, QtCore.SIGNAL("clicked()"), self.refrPE) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_spe, QtCore.SIGNAL("clicked()"), self.refrSPE) | ||||
| 
 | ||||
|     def chooseRect(self): | ||||
|         self.region.chooseRectangles() | ||||
| 
 | ||||
|     def choosePoly(self): | ||||
|         self.region.choosePolygon() | ||||
| 
 | ||||
|     def disconnectRect(self): | ||||
|         self.region.disconnectRect() | ||||
| 
 | ||||
|     def disconnectPoly(self): | ||||
|         self.region.disconnectPoly() | ||||
| 
 | ||||
|     def plotPicks(self): | ||||
|         self.region.plotTracesInActiveRegions() | ||||
| 
 | ||||
|     def deleteSelected(self): | ||||
|         self.region.setAllActiveRegionsForDeletion() | ||||
|         message = 'Are you sure you want to delete all marked picks?' | ||||
|         if continueDialogMessage(message): | ||||
|             self.region.deleteAllMarkedPicks() | ||||
|         else: | ||||
|             self.region.refreshFigure() | ||||
| 
 | ||||
|     def undoSelection(self): | ||||
|         self.region.deselectLastSelection() | ||||
|          | ||||
|     def refrSNR(self): | ||||
|         self.region.refreshLog10SNR() | ||||
| 
 | ||||
|     def refrPE(self): | ||||
|         self.region.refreshPickerror() | ||||
| 
 | ||||
|     def refrSPE(self): | ||||
|         self.region.refreshSPE() | ||||
| 
 | ||||
| 
 | ||||
| class Repicking(object): | ||||
|     def __init__(self, mainwindow, region, shot, traceID): | ||||
|         self.mainwindow = mainwindow | ||||
|         self.region = region | ||||
|         self.shot = shot | ||||
|         self.traceID = traceID | ||||
|         self.init_dialog() | ||||
|         self.start_dialog() | ||||
| 
 | ||||
|     def init_dialog(self): | ||||
|         qdialog = QtGui.QDialog(self.mainwindow) | ||||
|         ui = Ui_repicking() | ||||
|         ui.setupUi(qdialog) | ||||
|         self.ui = ui | ||||
|         self.qdialog = qdialog | ||||
|         self.connectButtons() | ||||
|          | ||||
|     def start_dialog(self): | ||||
|         self.qdialog.exec_() | ||||
| 
 | ||||
|     def connectButtons(self): | ||||
|         QtCore.QObject.connect(self.ui.pushButton_repick, QtCore.SIGNAL("clicked()"), self.repick) | ||||
|         QtCore.QObject.connect(self.ui.pushButton_delete, QtCore.SIGNAL("clicked()"), self.delete) | ||||
| 
 | ||||
|     def initPlot(self): | ||||
|         self.figure = Figure() | ||||
|         self.canvas = FigureCanvas(self.figure) | ||||
|         self.ui.verticalLayout_plot.addWidget(self.canvas) | ||||
|         self.toolbar = NavigationToolbar(self.canvas, self.mainwindow) | ||||
|         self.ui.verticalLayout_plot.addWidget(self.toolbar) | ||||
|          | ||||
|     def plot(self): | ||||
|         self.shot.plot_traces(self.traceID, figure = self.figure, buttons = False) | ||||
|         self.ax = ax | ||||
|         self.draw() | ||||
| @ -1,129 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| import sys | ||||
| import os | ||||
| from obspy import read | ||||
| from obspy import Stream | ||||
| from obspy import Trace | ||||
| from datetime import datetime | ||||
| import numpy as np | ||||
| 
 | ||||
| from pylot.core.active import surveyUtils | ||||
| from pylot.core.active import seismicshot | ||||
| from pylot.core.active import activeSeismoPick | ||||
| from pylot.core.active import fmtomoUtils | ||||
| from pylot.core.active import seismicArrayPreparation | ||||
| # reload(seismicshot) | ||||
| # reload(surveyUtils) | ||||
| # reload(activeSeismoPick) | ||||
| 
 | ||||
| ##################################################################################### | ||||
| # parameter definitions:############################################################# | ||||
| cutwindow = (0, 0.15)              # cut out a part of the trace [seconds] | ||||
| tmovwind = 0.1                     # size of the moving window | ||||
| windowsize = (30, 0)               # windowsize for AIC picker (indices around HOS picks [time/sampling rate] !!!) | ||||
| folm = 0.6                         # fraction of local maximum for threshold picker | ||||
| tsignal = 0.03 | ||||
| tgap = 0.0007 | ||||
| 
 | ||||
| nproc = 1 | ||||
| 
 | ||||
| vmin = 333 | ||||
| vmax = 5500 | ||||
| 
 | ||||
| HosAic = 'aic' # can be 'hos' or 'aic' | ||||
| 
 | ||||
| rockeskyll = False | ||||
| GZB = True | ||||
| bb1 = False | ||||
| 
 | ||||
| # Simulation parameters ############################################################# | ||||
| simulation = True | ||||
| 
 | ||||
| niter = 4 | ||||
| 
 | ||||
| bottomBoundary = -50.0 | ||||
| topBoundary = 5.0 | ||||
| nPointsPropgrid = (100, 100, 100) | ||||
| nPointsVgrid = (30, 30, 30) | ||||
| cushionfactor = 0.1 | ||||
| interpolationMethod = 'linear' | ||||
| mygrid = '../mygrid.in' | ||||
|                     | ||||
| cwd = os.getcwd() | ||||
| simuldir = 'fmtomo_simulation' | ||||
| pickdir = 'picks' | ||||
| fmtomopath = '/rscratch/minos22/marcel/flachseismik/fmtomo/GZB_clean/' | ||||
| ###################################################################################### | ||||
| ###################################################################################### | ||||
| if rockeskyll == True: | ||||
|     receiverfile = "Geophone_interpoliert_rockes" | ||||
|     sourcefile = "Schusspunkte_rockes" | ||||
|     obsdir = "/rscratch/minos22/marcel/flachseismik/rockeskyll_200615_270615/" | ||||
|     filename = 'survey_rockes.pickle' | ||||
| elif GZB == True: | ||||
|     receiverfile = "Geophone_interpoliert_GZB" | ||||
|     sourcefile = "Schusspunkte_GZB" | ||||
|     #sourcefile = "Schusspunkte_GZB_1shot" | ||||
|     obsdir = "/rscratch/minos22/marcel/flachseismik/GZB_26_06_15_01/" | ||||
|     filename = 'survey_GZB.pickle' | ||||
| elif bb1 == True: | ||||
|     receiverfile = "Geophone_Marcel"  | ||||
|     sourcefile = "Schusspunkte_Marcel" | ||||
|     obsdir = "/rscratch/minos22/marcel/flachseismik/bachelor_bausenberg/" | ||||
|     filename = 'survey_bb1.pickle' | ||||
| ###################################################################################### | ||||
| 
 | ||||
| starttime = datetime.now() | ||||
| 
 | ||||
| print('\n--------------------Starting Script at %s -------------------\n' %starttime.time()) | ||||
| print('directory: %s\nsourcefile: %s\nreceiverfile: %s\nsurvey output filename: %s\n' %(obsdir, sourcefile, receiverfile, filename)) | ||||
| if HosAic == 'aic': print('picking with AIC\n') | ||||
| if HosAic == 'hos': print('picking with HOS\n') | ||||
| 
 | ||||
| survey = activeSeismoPick.Survey(obsdir, os.path.join(obsdir, sourcefile), | ||||
|                                  os.path.join(obsdir, receiverfile), useDefaultParas = False) | ||||
| survey.setParametersForAllShots(cutwindow, tmovwind, tsignal, tgap) | ||||
| surveyUtils.setDynamicFittedSNR(survey.getShotDict()) | ||||
| #surveyUtils.setConstantSNR(survey.getShotDict(), 0) | ||||
| survey.setArtificialPick(0, 0) # artificial pick at source origin | ||||
| print('\nDone after %s seconds!\n------------------------------------------------------------------------------\n' % (datetime.now() - starttime).seconds) | ||||
| survey.pickAllShots(vmin, vmax, folm, HosAic, windowsize, cores = nproc) | ||||
| survey.cleanBySPE(maxSPE = 0.0075) | ||||
| survey.saveSurvey(filename) | ||||
| print('\n--- Finished picking ---') | ||||
| print'Elapsed time:', datetime.now()-starttime | ||||
| 
 | ||||
| 
 | ||||
| ###################################################################################### | ||||
| if simulation == False: | ||||
|     sys.exit() | ||||
| 
 | ||||
| survey = activeSeismoPick.Survey.from_pickle(filename) | ||||
| 
 | ||||
| if not os.path.isdir(os.path.join(cwd, simuldir)): | ||||
|     err = os.mkdir(os.path.join(cwd, simuldir)) | ||||
| 
 | ||||
| picks = os.path.join(simuldir, pickdir) | ||||
| 
 | ||||
| if not os.path.isdir(os.path.join(cwd, picks)): | ||||
|     err2 = os.mkdir(os.path.join(cwd, picks)) | ||||
| 
 | ||||
| survey.exportFMTOMO(picks) | ||||
| 
 | ||||
| ####### hard coded | ||||
| os.chdir(simuldir) | ||||
| survey.loadArray(obsdir, 'Geophone_eingemessen_GZB', 'Schusspunkte_GZB') | ||||
| survey.seisArray.generateFMTOMOinputFromArray(nPointsPropgrid, nPointsVgrid, | ||||
|                                               (bottomBoundary, topBoundary), cushionfactor, | ||||
|                                               interpolationMethod, customgrid = mygrid, | ||||
|                                               writeVTK = False) | ||||
| 
 | ||||
| os.chdir(cwd) | ||||
| ####### test | ||||
| 
 | ||||
| tomo = fmtomoUtils.Tomo3d(fmtomopath, simuldir) | ||||
| tomo.runTOMO3D(nproc, niter) | ||||
| 
 | ||||
| print('\n--- Finished script ---') | ||||
| print'Elapsed time:', datetime.now()-starttime | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,957 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| import os | ||||
| import numpy as np | ||||
| from obspy.core import read | ||||
| from obspy import Stream | ||||
| from obspy import Trace | ||||
| from pylot.core.pick.charfuns import HOScf | ||||
| from pylot.core.pick.charfuns import AICcf | ||||
| from pylot.core.pick.utils import getSNR | ||||
| from pylot.core.pick.utils import earllatepicker | ||||
| import matplotlib.pyplot as plt | ||||
| import warnings | ||||
| import copy_reg | ||||
| import types | ||||
| from pylot.core.util.utils import worker, _pickle_method | ||||
| 
 | ||||
| copy_reg.pickle(types.MethodType, _pickle_method) | ||||
| 
 | ||||
| plt.interactive('True') | ||||
| 
 | ||||
| class SeismicShot(object): | ||||
|     ''' | ||||
|     SuperClass for a seismic shot object. | ||||
|     ''' | ||||
|     def __init__(self, obsfile): | ||||
|         ''' | ||||
|         Initialize seismic shot object giving an inputfile. | ||||
| 
 | ||||
|         :param: obsfile, ((!SEG2/SEGY!)) file readable by obspy | ||||
|         :type: string | ||||
|         ''' | ||||
|         self.traces = read(obsfile) | ||||
|         self.renameChannelIDs() | ||||
|         # self.recCoordlist = None | ||||
|         # self.srcCoordlist = None | ||||
|         self.traceIDs = None | ||||
|         self.picks = {} | ||||
|         self.pwindow = {} | ||||
|         self.manualpicks = {} | ||||
|         self.snr = {} | ||||
|         self.snrthreshold = {} | ||||
|         self.timeArray = {} | ||||
|         self.traces4plot = {} | ||||
|         self.paras = {} | ||||
|         self.paras['shotname'] = obsfile | ||||
|         self.folm = None | ||||
| 
 | ||||
|     def renameChannelIDs(self): | ||||
|         for trace in self.traces: | ||||
|             if trace.stats._format == 'SEG2': | ||||
|                 trace.stats.channel = int(trace.stats.seg2['CHANNEL_NUMBER']) | ||||
| 
 | ||||
|     def removeEmptyTraces(self): | ||||
|         traceIDs = [] | ||||
|         removed = [] | ||||
|         traceIDs = self.getReceiverCoords().keys() | ||||
| 
 | ||||
|         for trace in self.traces: | ||||
|             try: | ||||
|                 traceIDs.index(int(trace.stats.channel)) | ||||
|             except: | ||||
|                 self.traces.remove(trace) | ||||
|                 removed.append(int(trace.stats.channel)) | ||||
| 
 | ||||
|         if len(removed) > 0: | ||||
|             return removed | ||||
| 
 | ||||
|     def removeTrace(self, traceID): | ||||
|         for trace in self.traces: | ||||
|             if traceID == trace.stats.channel: | ||||
|                 self.traces.remove(trace) | ||||
| 
 | ||||
|     def updateTraceList(self): | ||||
|         ''' | ||||
|         Looks for empty traces, returns a list of deleted traceIDs. | ||||
|         ''' | ||||
|         traceIDs = [] | ||||
|         for traceID in self.getTraceIDlist(): | ||||
|             if traceID not in self.getStreamTraceIDs(): | ||||
|                 self.traceIDs.remove(traceID) | ||||
|                 traceIDs.append(traceID) | ||||
|         return traceIDs | ||||
| 
 | ||||
|     def setParameters(self, name, value): | ||||
|         self.paras[name] = value | ||||
| 
 | ||||
|     def setVmin(self, vmin): | ||||
|         self.setParameters('vmin', vmin) | ||||
| 
 | ||||
|     def setVmax(self, vmax): | ||||
|         self.setParameters('vmax', vmax) | ||||
| 
 | ||||
|     def setCut(self, cut): | ||||
|         self.setParameters('cut', cut) | ||||
| 
 | ||||
|     def setTmovwind(self, tmovwind): | ||||
|         self.setParameters('tmovwind', tmovwind) | ||||
| 
 | ||||
|     def setOrder(self, order): | ||||
|         self.setParameters('order', order) | ||||
| 
 | ||||
|     def setTsignal(self, tsignal): | ||||
|         self.setParameters('tsignal', tsignal) | ||||
| 
 | ||||
|     def setTgap(self, tgap): | ||||
|         self.setParameters('tgap', tgap) | ||||
| 
 | ||||
|     def setShotnumber(self, shotnumber): | ||||
|         self.setParameters('shotnumber', shotnumber) | ||||
| 
 | ||||
|     def setReceiverCoords(self, receiver): | ||||
|         self.setParameters('receiverLoc', receiver) | ||||
| 
 | ||||
|     def setSourceCoords(self, source): | ||||
|         self.setParameters('sourceLoc', source) | ||||
| 
 | ||||
|     def setMethod(self, method): | ||||
|         self.setParameters('method', method) | ||||
| 
 | ||||
|     def setAicwindow(self, aicwindow): | ||||
|         self.setParameters('aicwindow', aicwindow) | ||||
| 
 | ||||
|     def setFolm(self, folm): | ||||
|         self.setParameters('folm', folm) | ||||
| 
 | ||||
|     def setDynPickwindow(self, traceID, cutdist = 5.): | ||||
|         distance = self.getDistance(traceID)  # receive distance | ||||
|          | ||||
|         vmin = self.getVmin() | ||||
|         vmax = self.getVmax() | ||||
| 
 | ||||
|         pickwin_used = self.getCut() | ||||
|         cutwindow = self.getCut() | ||||
|          | ||||
|         # for higher distances use a linear vmin/vmax to cut out late/early regions with high noise | ||||
|         if distance > cutdist: | ||||
|             pwleft = distance / vmax | ||||
|             pwright = distance / vmin | ||||
|             if pwright > cutwindow[1]: | ||||
|                 pwright = cutwindow[1] | ||||
|             pickwin_used = (pwleft, pwright) | ||||
| 
 | ||||
|         self.setPickwindow(traceID, pickwin_used) | ||||
| 
 | ||||
|     def getMethod(self): | ||||
|         return self.paras['method'] | ||||
| 
 | ||||
|     def getAicwindow(self): | ||||
|         return self.paras['aicwindow'] | ||||
| 
 | ||||
|     def getFolm(self): | ||||
|         return self.paras['folm'] | ||||
| 
 | ||||
|     def getParas(self): | ||||
|         return self.paras | ||||
| 
 | ||||
|     def getShotnumber(self): | ||||
|         return self.paras['shotnumber'] | ||||
| 
 | ||||
|     def getSourceCoords(self): | ||||
|         return self.paras['sourceLoc'] | ||||
| 
 | ||||
|     def getReceiverCoords(self): | ||||
|         return self.paras['receiverLoc'] | ||||
| 
 | ||||
|     def getCut(self): | ||||
|         return self.paras['cut'] | ||||
| 
 | ||||
|     def getTmovwind(self): | ||||
|         return self.paras['tmovwind'] | ||||
| 
 | ||||
|     def getOrder(self): | ||||
|         return self.paras['order'] | ||||
| 
 | ||||
|     def getTsignal(self): | ||||
|         return self.paras['tsignal'] | ||||
| 
 | ||||
|     def getTgap(self): | ||||
|         return self.paras['tgap'] | ||||
| 
 | ||||
|     def getShotnumber(self): | ||||
|         return self.paras['shotnumber'] | ||||
| 
 | ||||
|     def getVmin(self): | ||||
|         return self.paras['vmin'] | ||||
| 
 | ||||
|     def getVmax(self): | ||||
|         return self.paras['vmax'] | ||||
| 
 | ||||
|     def getManualPick(self, traceID): | ||||
|         if not self.getManualPickFlag(traceID) == 0: | ||||
|             return self.manualpicks[traceID]['mpp'] | ||||
| 
 | ||||
|     def getManualEarliest(self, traceID): | ||||
|         return self.manualpicks[traceID]['epp'] | ||||
| 
 | ||||
|     def getManualLatest(self, traceID): | ||||
|         return self.manualpicks[traceID]['lpp'] | ||||
| 
 | ||||
|     def getPick(self, traceID, returnRemoved=False): | ||||
|         if not self.getPickFlag(traceID) == 0: | ||||
|             return self.picks[traceID]['mpp'] | ||||
|         if returnRemoved == True: | ||||
|             return self.picks[traceID]['mpp'] | ||||
| 
 | ||||
|     def getPickIncludeRemoved(self, traceID): | ||||
|         return self.getPick(traceID, returnRemoved=True) | ||||
| 
 | ||||
|     def getEarliest(self, traceID): | ||||
|         return self.picks[traceID]['epp'] | ||||
| 
 | ||||
|     def getLatest(self, traceID): | ||||
|         return self.picks[traceID]['lpp'] | ||||
| 
 | ||||
|     def getSymmetricPickError(self, traceID): | ||||
|         pickerror = self.picks[traceID]['spe'] | ||||
|         if np.isnan(pickerror) == True: | ||||
|             print "SPE is NaN for shot %s, traceID %s" % (self.getShotnumber(), traceID) | ||||
|         return pickerror | ||||
| 
 | ||||
|     def getPickError(self, traceID): | ||||
|         pickerror = abs(self.getEarliest(traceID) - self.getLatest(traceID)) / 2 | ||||
|         if np.isnan(pickerror) == True: | ||||
|             print("PE is NaN for shot %s, traceID %s" % (self.getShotnumber(), traceID)) | ||||
|         return pickerror | ||||
| 
 | ||||
|     def getStreamTraceIDs(self): | ||||
|         traceIDs = [] | ||||
|         for trace in self.traces: | ||||
|             traceIDs.append(int(trace.stats.channel)) | ||||
|         return traceIDs | ||||
| 
 | ||||
|     def getTraceIDlist(self): | ||||
|         ''' | ||||
|         Returns a list containing the traceIDs. | ||||
|         ''' | ||||
|         traceIDs = [] | ||||
|         if self.traceIDs == None: | ||||
|             traceIDs = self.getReceiverCoords().keys() | ||||
|             self.traceIDs = traceIDs | ||||
|         return self.traceIDs | ||||
| 
 | ||||
|     def getPickwindow(self, traceID): | ||||
|         try: | ||||
|             self.pwindow[traceID] | ||||
|         except KeyError as e: | ||||
|             print('no pickwindow for trace %s, set to %s' % (traceID, self.getCut())) | ||||
|             self.setPickwindow(traceID, self.getCut()) | ||||
|         return self.pwindow[traceID] | ||||
| 
 | ||||
|     def getSNR(self, traceID): | ||||
|         return self.snr[traceID] | ||||
| 
 | ||||
|     def getSNRthreshold(self, traceID): | ||||
|         return self.snrthreshold[traceID] | ||||
| 
 | ||||
|     # def getRecCoordlist(self): | ||||
|     #     if self.recCoordlist is None: | ||||
|     #         coordlist = open(self.getRecfile(), 'r').readlines() | ||||
|     #         # print 'Reading receiver coordinates from %s' %(self.getRecfile()) | ||||
|     #         self.recCoordlist = coordlist | ||||
|     #     return self.recCoordlist | ||||
| 
 | ||||
|     # def getSrcCoordlist(self): | ||||
|     #     if self.srcCoordlist is None: | ||||
|     #         coordlist = open(self.getSourcefile(), 'r').readlines() | ||||
|     #         # print 'Reading shot coordinates from %s' %(self.getSourcefile()) | ||||
|     #         self.srcCoordlist = coordlist | ||||
|     #     return self.srcCoordlist | ||||
| 
 | ||||
|     def getTimeArray(self, traceID): | ||||
|         return self.timeArray[traceID] | ||||
| 
 | ||||
|     def getHOScf(self, traceID): | ||||
|         ''' | ||||
|         Returns the higher order statistics characteristic function for a trace using pylot. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
| 
 | ||||
|         :param: cut, cut out a part of the trace (t_start, t_end) [s] | ||||
|         :type: tuple | ||||
| 
 | ||||
|         :param: t2, size of the moving window [s] | ||||
|         :type: float | ||||
| 
 | ||||
|         :param: order, order of the characteristic function | ||||
|         :type: int | ||||
|         ''' | ||||
|         return HOScf(self.getSingleStream(traceID), self.getCut(), | ||||
|                      self.getTmovwind(), self.getOrder(), stealthMode=True) | ||||
| 
 | ||||
|     def getAICcf(self, traceID): | ||||
|         ''' | ||||
|         Returns the Akaike criterion for a trace using pylot and the higher order statistics characteristic function. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
| 
 | ||||
|         :param: cut, cut out a part of the trace (t_start, t_end) [s] | ||||
|         :type: tuple | ||||
| 
 | ||||
|         :param: t2, size of the moving window [s] | ||||
|         :type: float | ||||
| 
 | ||||
|         :param: order, order of the characteristic function | ||||
|         :type: int | ||||
|         ''' | ||||
| 
 | ||||
|         st_cf = Stream() | ||||
|         tr_cf = Trace() | ||||
|         tr_cf.data = self.getHOScf(traceID).getCF() | ||||
|         st_cf += tr_cf | ||||
|         return AICcf(st_cf, self.getCut(), self.getTmovwind(), stealthMode=True) | ||||
| 
 | ||||
|     def getSingleStream(self, traceID):  ########## SEG2 / SEGY ? ########## | ||||
|         ''' | ||||
|         Returns a Stream with only one trace (instead of just one trace) because it is needed for pylot. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
|         ''' | ||||
|         # traces = [trace for trace in self.traces if int(trace.stats.seg2['CHANNEL_NUMBER']) == traceID] | ||||
|         traces = [trace for trace in self.traces if int(trace.stats.channel) == traceID] | ||||
|         if len(traces) == 1: | ||||
|             return Stream(traces) | ||||
|         self.setPick(traceID, None) | ||||
|         warnings.warn('ambigious or empty traceID: %s' % traceID) | ||||
| 
 | ||||
|     def setPickParameters(self, folm, method = 'hos', aicwindow = (10, 0)): | ||||
|         self.setFolm(folm) | ||||
|         self.setMethod(method) | ||||
|         self.setAicwindow(aicwindow) | ||||
| 
 | ||||
|     # def pickParallel(self): | ||||
|     #     traceIDs = self.getTraceIDlist() | ||||
|     #     picks = [] | ||||
|     #     #picks = worker(self.pickTrace, traceIDs) | ||||
| 
 | ||||
|     #     # for traceID, pick in picks: | ||||
|     #     #     self.setPick(traceID, pick) | ||||
| 
 | ||||
|     #     for traceID in traceIDs: | ||||
|     #         trID, pick = self.pickTrace(traceID) | ||||
|     #         picks.append([trID, pick]) | ||||
|     #         #self.setPick(traceID, pick) | ||||
|     #     return picks | ||||
| 
 | ||||
|     def pickTrace(self, traceID): | ||||
|         ''' | ||||
|         Intitiate picking for a trace. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
| 
 | ||||
|         :param: cutwindow (equals HOScf 'cut' variable) | ||||
|         :type: tuple | ||||
| 
 | ||||
|         :param: t2 (equals HOScf t2 variable) | ||||
|         :type: float | ||||
| 
 | ||||
|         :param: order (equals HOScf 'order' variable) | ||||
|         :type: int | ||||
| 
 | ||||
|         :param: windowsize, window around the returned HOS picktime, to search for the AIC minumum | ||||
|         :type: 'tuple' | ||||
| 
 | ||||
|         :param: folm, fraction of local maximumm | ||||
|         :type: 'real' | ||||
| 
 | ||||
|         :param: HosAic, get hos or aic pick (can be 'hos'(default) or 'aic') | ||||
|         :type: 'string' | ||||
|         ''' | ||||
|         self.setDynPickwindow(traceID) | ||||
|          | ||||
|         hoscf = self.getHOScf(traceID)  ### determination of both, HOS and AIC (need to change threshold-picker) ### | ||||
|         aiccf = self.getAICcf(traceID) | ||||
| 
 | ||||
|         self.timeArray[traceID] = hoscf.getTimeArray() | ||||
|         aiccftime, hoscftime = self.threshold(hoscf, aiccf, self.getAicwindow(), self.getPickwindow(traceID), self.getFolm()) | ||||
|         setHosAic = {'hos': hoscftime, | ||||
|                      'aic': aiccftime} | ||||
| 
 | ||||
|         if aiccftime < self.getPickwindow(traceID)[0] and 'aic' in self.getMethod(): | ||||
|             return 0 | ||||
| 
 | ||||
|         return setHosAic[self.getMethod()] | ||||
| 
 | ||||
|     def setEarllatepick(self, traceID, nfac=1.5): | ||||
|         tgap = self.getTgap() | ||||
|         tsignal = self.getTsignal() | ||||
|         tnoise = self.getPickIncludeRemoved(traceID) - tgap | ||||
| 
 | ||||
|         (self.picks[traceID]['epp'], | ||||
|          self.picks[traceID]['lpp'], | ||||
|          self.picks[traceID]['spe']) = earllatepicker(self.getSingleStream(traceID), | ||||
|                                                       nfac, (tnoise, tgap, tsignal), | ||||
|                                                       self.getPickIncludeRemoved(traceID), | ||||
|                                                       stealth_mode=True) | ||||
| 
 | ||||
|     def threshold(self, hoscf, aiccf, windowsize, pickwindow, folm): | ||||
|         ''' | ||||
|         Threshold picker, using the local maximum in a pickwindow to find the time at | ||||
|         which a fraction of the local maximum is reached for the first time. | ||||
| 
 | ||||
|         :param: hoscf, Higher Order Statistics Characteristic Function | ||||
|         :type: 'Characteristic Function' | ||||
| 
 | ||||
|         :param: aiccf, Characteristic Function after Akaike | ||||
|         :type: 'Characteristic Function' | ||||
| 
 | ||||
|         :param: windowsize, window around the returned HOS picktime, to search for the AIC minumum | ||||
|         :type: 'tuple' | ||||
| 
 | ||||
|         :param: pickwindow [seconds] | ||||
|         :type: 'tuple' | ||||
| 
 | ||||
|         :param: cutwindow [seconds], cut a part of the trace as in Characteristic Function | ||||
|         :type: 'tuple' | ||||
| 
 | ||||
|         :param: folm, fraction of local maximum | ||||
|         :type: 'real' | ||||
|         ''' | ||||
|         hoscflist = list(hoscf.getCF()) | ||||
|         leftb = int(pickwindow[0] / self.getCut()[1] * len(hoscflist)) | ||||
|         rightb = int(pickwindow[1] / self.getCut()[1] * len(hoscflist)) | ||||
| 
 | ||||
|         threshold = folm * (max(hoscflist[leftb: rightb]) - min(hoscflist[leftb: rightb])) + min( | ||||
|             hoscflist[leftb: rightb])  # combination of local maximum and threshold | ||||
| 
 | ||||
|         m = leftb | ||||
| 
 | ||||
|         while hoscflist[m] < threshold: | ||||
|             m += 1 | ||||
| 
 | ||||
|         hoscftime = list(hoscf.getTimeArray())[m] | ||||
| 
 | ||||
|         lb = max(0, m - windowsize[0])  # if window exceeds t = 0 | ||||
|         aiccfcut = list(aiccf.getCF())[lb: m + windowsize[1]] | ||||
|         if len(aiccfcut) > 0: | ||||
|             n = aiccfcut.index(min(aiccfcut)) | ||||
|         else: | ||||
|             n = 0 | ||||
| 
 | ||||
|         m = lb + n | ||||
| 
 | ||||
|         aiccftime = list(hoscf.getTimeArray())[m] | ||||
| 
 | ||||
|         return aiccftime, hoscftime | ||||
| 
 | ||||
|     def getDistance(self, traceID): | ||||
|         ''' | ||||
|         Returns the distance of the receiver with the ID == traceID to the source location (shot location). | ||||
|         Uses getSrcLoc and getRecLoc. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
|         ''' | ||||
|         shotX, shotY, shotZ = self.getSrcLoc() | ||||
|         recX, recY, recZ = self.getRecLoc(traceID) | ||||
|         dist = np.sqrt((shotX - recX) ** 2 + (shotY - recY) ** 2 + (shotZ - recZ) ** 2) | ||||
| 
 | ||||
|         if np.isnan(dist) == True: | ||||
|             raise ValueError("Distance is NaN for traceID %s" % traceID) | ||||
| 
 | ||||
|         return dist | ||||
| 
 | ||||
|     def getRecLoc(self, traceID):  ########## input FILENAME ########## | ||||
|         ''' | ||||
|         Returns the location (x, y, z) of the receiver with the ID == traceID. | ||||
|         RECEIVEIVER FILE MUST BE SET FIRST, TO BE IMPROVED. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
|         ''' | ||||
|         if traceID == 0:  # artificial traceID 0 with pick at t = 0 | ||||
|             return self.getSrcLoc() | ||||
| 
 | ||||
|         return self.getReceiverCoords()[traceID] | ||||
| 
 | ||||
|         raise ValueError("traceID %s not found" % traceID) | ||||
| 
 | ||||
|     def getSrcLoc(self):  ########## input FILENAME ########## | ||||
|         ''' | ||||
|         Returns the location (x, y, z) of the shot. | ||||
|         SOURCE FILE MUST BE SET FIRST, TO BE IMPROVED. | ||||
|         ''' | ||||
|         return self.getSourceCoords() | ||||
| 
 | ||||
|     def getTraceIDs4Dist(self, distance=0, | ||||
|                          distancebin=(0, 0)):  ########## nur fuer 2D benutzt, 'distance bins' ########## | ||||
|         ''' | ||||
|         Returns the traceID(s) for a certain distance between source and receiver. | ||||
|         Used for 2D Tomography. TO BE IMPROVED. | ||||
| 
 | ||||
|         :param: distance | ||||
|         :type: real | ||||
| 
 | ||||
|         :param: distancebin | ||||
|         :type: tuple | ||||
|         ''' | ||||
| 
 | ||||
|         traceID_list = [] | ||||
|         for trace in self.traces: | ||||
|             # traceID = int(trace.stats.seg2['CHANNEL_NUMBER']) | ||||
|             traceID = int(trace.stats.channel) | ||||
|             if distance != 0: | ||||
|                 if self.getDistance(traceID) == distance: | ||||
|                     traceID_list.append(traceID) | ||||
|             if distancebin[0] >= 0 and distancebin[1] > 0: | ||||
|                 if distancebin[0] < self.getDistance(traceID) < distancebin[1]: | ||||
|                     traceID_list.append(traceID) | ||||
| 
 | ||||
|         if len(traceID_list) > 0: | ||||
|             return traceID_list | ||||
| 
 | ||||
|     def setManualPicksFromFile(self, directory='picks'): | ||||
|         ''' | ||||
|         Read manual picks from *.pck file. | ||||
|         The * must be identical with the shotnumber. | ||||
|         ''' | ||||
|         if directory[-1] == '/': | ||||
|             filename = directory + str(self.getShotnumber()) + '.pck' | ||||
|         else: | ||||
|             filename = directory + '/' + str(self.getShotnumber()) + '.pck' | ||||
|         infile = open(filename, 'r') | ||||
|         mpicks = infile.readlines() | ||||
|         for line in mpicks: | ||||
|             if line.split()[0] == []: | ||||
|                 continue | ||||
|             traceID, mpp, epp, lpp = line.split() | ||||
|             traceID = int(traceID) | ||||
|             if traceID in self.picks.keys(): | ||||
|                 self.manualpicks[traceID] = {'mpp': float(mpp), | ||||
|                                              'epp': float(epp), | ||||
|                                              'lpp': float(lpp)} | ||||
|             if float(mpp) <= 0: | ||||
|                 self.setManualPickFlag(traceID, 0) | ||||
|             else: | ||||
|                 self.setManualPickFlag(traceID, 1) | ||||
| 
 | ||||
|     def setPick(self, traceID, pick):  ########## siehe Kommentar ########## | ||||
|         if not traceID in self.picks.keys(): | ||||
|             self.picks[traceID] = {} | ||||
|         self.picks[traceID]['mpp'] = pick | ||||
|         self.picks[traceID]['flag'] = 1 | ||||
|         # ++++++++++++++ Block raus genommen, da Error beim 2ten Mal picken! (Ueberschreiben von erstem Pick!) | ||||
|         # if not self.picks.has_key(traceID): | ||||
|         #     self.getPick(traceID) = picks | ||||
|         # else: | ||||
|         #     raise KeyError('pick to be set more than once for traceID %s' % traceID) | ||||
| 
 | ||||
|         #    def readParameter(self, parfile): | ||||
|         #        parlist = open(parfile,'r').readlines() | ||||
| 
 | ||||
|     def removePick(self, traceID): | ||||
|         self.setPickFlag(traceID, 0) | ||||
| 
 | ||||
|     def setPickFlag(self, traceID, flag): | ||||
|         'Set flag = 0 if pick is invalid, else flag = 1' | ||||
|         self.picks[traceID]['flag'] = flag | ||||
| 
 | ||||
|     def getPickFlag(self, traceID): | ||||
|         return self.picks[traceID]['flag'] | ||||
| 
 | ||||
|     def setManualPickFlag(self, traceID, flag): | ||||
|         'Set flag = 0 if pick is invalid, else flag = 1' | ||||
|         self.manualpicks[traceID]['flag'] = flag | ||||
| 
 | ||||
|     def getManualPickFlag(self, traceID): | ||||
|         return self.manualpicks[traceID]['flag'] | ||||
| 
 | ||||
|     def setPickwindow(self, traceID, pickwindow): | ||||
|         self.pwindow[traceID] = pickwindow | ||||
| 
 | ||||
|     def setSNR(self, traceID):  ########## FORCED HOS PICK ########## | ||||
|         ''' | ||||
|         Gets the SNR using pylot and then sets the SNR for the traceID. | ||||
| 
 | ||||
|         :param: traceID | ||||
|         :type: int | ||||
| 
 | ||||
|         :param: (tnoise, tgap, tsignal), as used in pylot SNR | ||||
|         ''' | ||||
|         from pylot.core.pick.utils import getSNR | ||||
| 
 | ||||
|         tgap = self.getTgap() | ||||
|         tsignal = self.getTsignal() | ||||
|         tnoise = self.getPick(traceID) - tgap | ||||
| 
 | ||||
|         self.snr[traceID] = getSNR(self.getSingleStream(traceID), (tnoise, tgap, tsignal), self.getPick(traceID)) | ||||
| 
 | ||||
|     def setSNRthreshold(self, traceID, snrthreshold): | ||||
|         self.snrthreshold[traceID] = snrthreshold | ||||
| 
 | ||||
|     def getDistArray4ttcPlot(self):  ########## nur fuer 2D benoetigt ########## | ||||
|         ''' | ||||
|         Function to create a distance array for the plots. 2D only! X DIRECTION!! | ||||
|         ''' | ||||
|         distancearray = [] | ||||
| 
 | ||||
|         for traceID in self.picks.keys(): | ||||
|             if self.getRecLoc(traceID)[0] > self.getSrcLoc()[0]: | ||||
|                 distancearray.append(self.getDistance(traceID)) | ||||
|             elif self.getRecLoc(traceID)[0] <= self.getSrcLoc()[0]: | ||||
|                 distancearray.append((-1) * self.getDistance(traceID)) | ||||
| 
 | ||||
|         return distancearray | ||||
| 
 | ||||
|     def plot2dttc(self, ax=None): | ||||
|         ''' | ||||
|         Function to plot the traveltime curve for automated picks of a shot. 2d only! ATM: X DIRECTION!! | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         plt.interactive('True') | ||||
|         picks = [] | ||||
| 
 | ||||
|         for traceID in self.picks.keys(): | ||||
|             picks.append(self.getPick(traceID)) | ||||
| 
 | ||||
|         if ax is None: | ||||
|             fig = plt.figure() | ||||
|             ax = fig.add_subplot(111) | ||||
| 
 | ||||
|         # shotnumbers = [shotnumbers for (shotnumbers, shotnames) in sorted(zip(shotnumbers, shotnames))] | ||||
|         plotarray = sorted(zip(self.getDistArray4ttcPlot(), picks)) | ||||
|         x = []; | ||||
|         y = [] | ||||
|         for point in plotarray: | ||||
|             x.append(point[0]) | ||||
|             y.append(point[1]) | ||||
|         ax.plot(x, y, 'r', label="Automatic Picks") | ||||
|         ax.text(0.5, 0.9, 'shot: %s' % self.getShotnumber(), transform=ax.transAxes | ||||
|                 , horizontalalignment='center') | ||||
| 
 | ||||
|     def plotmanual2dttc(self, ax=None): | ||||
|         ''' | ||||
|         Function to plot the traveltime curve for manual picks of a shot. 2D only! | ||||
|         ''' | ||||
|         import matplotlib.pyplot as plt | ||||
|         plt.interactive('True') | ||||
|         manualpicktimesarray = [] | ||||
| 
 | ||||
|         for traceID in self.picks.keys(): | ||||
|             if not traceID in self.manualpicks.keys() or self.getManualPickFlag(traceID) == 0: | ||||
|                 manualpicktimesarray.append(None) | ||||
|             else: | ||||
|                 manualpicktimesarray.append(self.getManualPick(traceID)) | ||||
| 
 | ||||
|         if ax is None: | ||||
|             fig = plt.figure() | ||||
|             ax = fig.add_subplot(111) | ||||
| 
 | ||||
|         plotarray = sorted(zip(self.getDistArray4ttcPlot(), manualpicktimesarray)) | ||||
|         x = []; | ||||
|         y = [] | ||||
|         for point in plotarray: | ||||
|             x.append(point[0]) | ||||
|             y.append(point[1]) | ||||
|         ax.plot(x, y, 'b', label="Manual Picks") | ||||
| 
 | ||||
|     def plotTrace(self, traceID, plotSNR=True, lw=1): | ||||
|         fig = plt.figure() | ||||
|         ax = fig.add_subplot(111) | ||||
|         ax = self._drawStream(traceID, ax=ax) | ||||
| 
 | ||||
|         tgap = self.getTgap() | ||||
|         tsignal = self.getTsignal() | ||||
|         pick = self.getPick(traceID) | ||||
|         tnoise = pick - tgap | ||||
|         snr, snrdb, noiselevel = self.getSNR(traceID) | ||||
| 
 | ||||
|         ax.plot([0, tnoise], [noiselevel, noiselevel], 'm', linewidth=lw, label='noise level') | ||||
|         ax.plot([tnoise, pick], [noiselevel, noiselevel], 'g:', linewidth=lw, label='gap') | ||||
|         ax.plot([tnoise + tgap, pick + tsignal], [noiselevel * snr, noiselevel * snr], 'b', linewidth=lw, | ||||
|                 label='signal level') | ||||
|         ax.legend() | ||||
|         ax.text(0.05, 0.9, 'SNR: %s' % snr, transform=ax.transAxes) | ||||
| 
 | ||||
|     def plot_traces(self, traceID, figure = None, buttons = True): | ||||
|         from matplotlib.widgets import Button | ||||
| 
 | ||||
|         def onclick(event): | ||||
|             self.setPick(traceID, event.xdata) | ||||
|             if self.getSNR(traceID)[0] > 1: | ||||
|                 self.setEarllatepick(traceID) | ||||
|             self._drawStream(traceID, refresh=True) | ||||
|             self._drawCFs(traceID, folm, refresh=True) | ||||
|             fig.canvas.mpl_disconnect(self.traces4plot[traceID]['cid']) | ||||
|             plt.draw() | ||||
| 
 | ||||
|         def rmPick(event=None): | ||||
|             self.removePick(traceID) | ||||
|             self._drawStream(traceID, refresh=True) | ||||
|             self._drawCFs(traceID, folm, refresh=True) | ||||
|             plt.draw() | ||||
| 
 | ||||
|         def connectButton(event=None): | ||||
|             cid = fig.canvas.mpl_connect('button_press_event', onclick) | ||||
|             self.traces4plot[traceID]['cid'] = cid | ||||
| 
 | ||||
|         def cleanup(event): | ||||
|             self.traces4plot[traceID] = {} | ||||
| 
 | ||||
|         def addButtons(fig): | ||||
|             axb1 = fig.add_axes([0.15, 0.91, 0.05, 0.03]) | ||||
|             axb2 = fig.add_axes([0.22, 0.91, 0.05, 0.03]) | ||||
|             button1 = Button(axb1, 'repick', color='red', hovercolor='grey') | ||||
|             button1.on_clicked(connectButton) | ||||
|             button2 = Button(axb2, 'delete', color='green', hovercolor='grey') | ||||
|             button2.on_clicked(rmPick) | ||||
|             return axb1, axb2, button1, button2 | ||||
|              | ||||
|         folm = self.folm | ||||
| 
 | ||||
|         if figure == None: | ||||
|             fig = plt.figure() | ||||
|         else: | ||||
|             fig = figure | ||||
|              | ||||
|         ax1 = fig.add_subplot(2, 1, 1) | ||||
|         ax2 = fig.add_subplot(2, 1, 2, sharex=ax1) | ||||
| 
 | ||||
|         if buttons: | ||||
|             axb1, axb2, button1, button2 = addButtons(fig) | ||||
|         else: | ||||
|             axb1 = None | ||||
|             axb2 = None | ||||
|             button1 = None | ||||
|             button2 = None | ||||
|          | ||||
|         fig.canvas.mpl_connect('close_event', cleanup) | ||||
| 
 | ||||
|         self.traces4plot[traceID] = dict(fig=fig, ax1=ax1, ax2=ax2, axb1=axb1, axb2=axb2, button1=button1, | ||||
|                                          button2=button2, cid=None) | ||||
| 
 | ||||
|         self._drawStream(traceID) | ||||
|         self._drawCFs(traceID, folm) | ||||
| 
 | ||||
|     def _drawStream(self, traceID, refresh=False, ax=None): | ||||
|         from pylot.core.util.utils import full_range | ||||
|         from pylot.core.util.utils import prepTimeAxis | ||||
| 
 | ||||
|         stream = self.getSingleStream(traceID) | ||||
|         stime = full_range(stream)[0] | ||||
|         timeaxis = prepTimeAxis(stime, stream[0]) | ||||
|         timeaxis -= stime | ||||
| 
 | ||||
|         if ax is None: | ||||
|             ax = self.traces4plot[traceID]['ax1'] | ||||
| 
 | ||||
|         if refresh == True: | ||||
|             xlim, ylim = ax.get_xlim(), ax.get_ylim() | ||||
|         ax.clear() | ||||
|         if refresh == True: | ||||
|             ax.set_xlim(xlim) | ||||
|             ax.set_ylim(ylim) | ||||
| 
 | ||||
|         ax.set_title('Shot: %s, traceID: %s, pick: %s' | ||||
|                      % (self.getShotnumber(), traceID, self.getPick(traceID))) | ||||
|         ax.plot(timeaxis, stream[0].data, 'k', label='trace') | ||||
|         ax.plot([self.getPick(traceID), self.getPick(traceID)], | ||||
|                 [ax.get_ylim()[0], | ||||
|                  ax.get_ylim()[1]], | ||||
|                 'r', label='most likely') | ||||
|         if self.getEarliest(traceID) is not None: | ||||
|             ax.plot([self.getEarliest(traceID), self.getEarliest(traceID)], | ||||
|                     [ax.get_ylim()[0], | ||||
|                      ax.get_ylim()[1]], | ||||
|                     'g:', label='earliest') | ||||
|         if self.getLatest(traceID) is not None: | ||||
|             ax.plot([self.getLatest(traceID), self.getLatest(traceID)], | ||||
|                     [ax.get_ylim()[0], | ||||
|                      ax.get_ylim()[1]], | ||||
|                     'b:', label='latest') | ||||
| 
 | ||||
|         ax.legend() | ||||
|         return ax | ||||
| 
 | ||||
|     def _drawCFs(self, traceID, folm=None, refresh=False): | ||||
|         hoscf = self.getHOScf(traceID) | ||||
|         aiccf = self.getAICcf(traceID) | ||||
|         ax = self.traces4plot[traceID]['ax2'] | ||||
| 
 | ||||
|         if refresh == True: | ||||
|             xlim, ylim = ax.get_xlim(), ax.get_ylim() | ||||
|         ax.clear() | ||||
|         if refresh == True: | ||||
|             ax.set_xlim(xlim) | ||||
|             ax.set_ylim(ylim) | ||||
| 
 | ||||
|         ax.plot(hoscf.getTimeArray(), hoscf.getCF(), 'b', label='HOS') | ||||
|         ax.plot(hoscf.getTimeArray(), aiccf.getCF(), 'g', label='AIC') | ||||
|         ax.plot([self.getPick(traceID), self.getPick(traceID)], | ||||
|                 [ax.get_ylim()[0], | ||||
|                  ax.get_ylim()[1]], | ||||
|                 'r', label='most likely') | ||||
|         if self.getEarliest(traceID) is not None: | ||||
|             ax.plot([self.getEarliest(traceID), self.getEarliest(traceID)], | ||||
|                     [ax.get_ylim()[0], | ||||
|                      ax.get_ylim()[1]], | ||||
|                     'g:', label='earliest') | ||||
|         if self.getLatest(traceID) is not None: | ||||
|             ax.plot([self.getLatest(traceID), self.getLatest(traceID)], | ||||
|                     [ax.get_ylim()[0], | ||||
|                      ax.get_ylim()[1]], | ||||
|                     'b:', label='latest') | ||||
|         if folm is not None: | ||||
|             ax.plot([0, self.getPick(traceID)], | ||||
|                     [folm * max(hoscf.getCF()), folm * max(hoscf.getCF())], | ||||
|                     'm:', label='folm = %s' % folm) | ||||
|         ax.set_xlabel('Time [s]') | ||||
|         ax.legend() | ||||
| 
 | ||||
|     def plot3dttc(self, step=0.5, contour=False, plotpicks=False, method='linear', ax=None): | ||||
|         ''' | ||||
|         Plots a 3D 'traveltime cone' as surface plot by interpolating on a regular grid over the traveltimes, not yet regarding the vertical offset of the receivers. | ||||
| 
 | ||||
|         :param: step (optional), gives the stepsize for the interpolated grid. Default is 0.5 | ||||
|         :type: 'float' | ||||
| 
 | ||||
|         :param: contour (optional), plot contour plot instead of surface plot | ||||
|         :type: 'logical' | ||||
| 
 | ||||
|         :param: plotpicks (optional), plot the data points onto the interpolated grid | ||||
|         :type: 'logical' | ||||
| 
 | ||||
|         :param: method (optional), interpolation method; can be 'linear' (default) or 'cubic' | ||||
|         :type: 'string' | ||||
|         ''' | ||||
|         from scipy.interpolate import griddata | ||||
|         from matplotlib import cm | ||||
|         from mpl_toolkits.mplot3d import Axes3D | ||||
| 
 | ||||
|         x = [] | ||||
|         y = [] | ||||
|         z = [] | ||||
|         for traceID in self.picks.keys(): | ||||
|             if self.getPickFlag(traceID) != 0: | ||||
|                 x.append(self.getRecLoc(traceID)[0]) | ||||
|                 y.append(self.getRecLoc(traceID)[1]) | ||||
|                 z.append(self.getPick(traceID)) | ||||
| 
 | ||||
|         xaxis = np.arange(min(x) + step, max(x), step) | ||||
|         yaxis = np.arange(min(y) + step, max(y), step) | ||||
|         xgrid, ygrid = np.meshgrid(xaxis, yaxis) | ||||
|         zgrid = griddata((x, y), z, (xgrid, ygrid), method=method) | ||||
| 
 | ||||
|         if ax == None: | ||||
|             fig = plt.figure() | ||||
|             ax = plt.axes(projection='3d') | ||||
| 
 | ||||
|         xsrc, ysrc, zsrc = self.getSrcLoc() | ||||
| 
 | ||||
|         if contour == True: | ||||
|             ax.contour3D(xgrid, ygrid, zgrid, 20) | ||||
|         else: | ||||
|             ax.plot_surface(xgrid, ygrid, zgrid, linewidth=0, cmap=cm.jet, vmin=min(z), vmax=max(z)) | ||||
|         ax.plot([xsrc], [ysrc], [self.getPick(0)], 'k*', markersize=20)  # plot source location | ||||
|         ax.plot([xsrc], [ysrc], [self.getPick(0)], 'r*', markersize=15)  # plot source location | ||||
| 
 | ||||
|         if plotpicks == True: | ||||
|             ax.plot(x, y, z, 'k.') | ||||
| 
 | ||||
|     def plotttc(self, method, *args): | ||||
|         plotmethod = {'2d': self.plot2dttc, '3d': self.plot3dttc} | ||||
| 
 | ||||
|         plotmethod[method](*args) | ||||
| 
 | ||||
|     def matshow(self, ax=None, step=0.5, method='linear', plotRec=True, annotations=True, colorbar=True, legend=True): | ||||
|         ''' | ||||
|         Plots a 2D matrix of the interpolated traveltimes. This needs less performance than plot3dttc | ||||
| 
 | ||||
|         :param: step (optional), gives the stepsize for the interpolated grid. Default is 0.5 | ||||
|         :type: 'float' | ||||
| 
 | ||||
|         :param: method (optional), interpolation method; can be 'linear' (default) or 'cubic' | ||||
|         :type: 'string' | ||||
| 
 | ||||
|         :param: plotRec (optional), plot the receiver positions (colored scatter plot, should not be | ||||
|         deactivated because there might be receivers that are not inside the interpolated area) | ||||
|         :type: 'logical' | ||||
| 
 | ||||
|         :param: annotations (optional), displays traceIDs as annotations | ||||
|         :type: 'logical' | ||||
|         ''' | ||||
|         from scipy.interpolate import griddata | ||||
|         from matplotlib import cm | ||||
|         cmap = cm.jet | ||||
| 
 | ||||
|         x = []; | ||||
|         xcut = [] | ||||
|         y = []; | ||||
|         ycut = [] | ||||
|         z = []; | ||||
|         zcut = [] | ||||
| 
 | ||||
|         for traceID in self.picks.keys(): | ||||
|             if self.getPickFlag(traceID) != 0: | ||||
|                 x.append(self.getRecLoc(traceID)[0]) | ||||
|                 y.append(self.getRecLoc(traceID)[1]) | ||||
|                 z.append(self.getPick(traceID)) | ||||
|             if self.getPickFlag(traceID) == 0 and self.getPickIncludeRemoved(traceID) is not None: | ||||
|                 xcut.append(self.getRecLoc(traceID)[0]) | ||||
|                 ycut.append(self.getRecLoc(traceID)[1]) | ||||
|                 zcut.append(self.getPickIncludeRemoved(traceID)) | ||||
| 
 | ||||
|         tmin = 0.8 * min(z)  # 20% cushion for colorbar | ||||
|         tmax = 1.2 * max(z) | ||||
| 
 | ||||
|         xaxis = np.arange(min(x), max(x), step) | ||||
|         yaxis = np.arange(min(y), max(y), step) | ||||
|         xgrid, ygrid = np.meshgrid(xaxis, yaxis) | ||||
|         zgrid = griddata((x, y), z, (xgrid, ygrid), method='linear') | ||||
| 
 | ||||
|         if ax == None: | ||||
|             fig = plt.figure() | ||||
|             ax = plt.axes() | ||||
| 
 | ||||
|         count = 0 | ||||
|         ax.imshow(zgrid, extent=[min(x), max(x), min(y), max(y)], vmin=tmin, vmax=tmax, cmap=cmap, origin='lower', | ||||
|                   alpha=0.85) | ||||
|         ax.text(0.5, 0.95, 'shot: %s' % self.getShotnumber(), transform=ax.transAxes | ||||
|                 , horizontalalignment='center') | ||||
|         sc = ax.scatter(x, y, c=z, s=30, label='active traces', vmin=tmin, vmax=tmax, cmap=cmap, linewidths=1.5) | ||||
|         for xyz in zip(xcut, ycut, zcut): | ||||
|             x, y, z = xyz | ||||
|             count += 1 | ||||
|             if z > tmax: | ||||
|                 z = 'w' | ||||
|             if count == 1: | ||||
|                 label = 'inactive traces' | ||||
|             else: | ||||
|                 label = None | ||||
|             ax.scatter(x, y, c=z, s=30, edgecolor='m', label=label, vmin=tmin, vmax=tmax, cmap=cmap, linewidths=1.5) | ||||
|         if colorbar == True: | ||||
|             cbar = plt.colorbar(sc) | ||||
|             cbar.set_label('Time [s]') | ||||
| 
 | ||||
|         if legend == True: | ||||
|             ax.legend() | ||||
|         ax.set_xlabel('X') | ||||
|         ax.set_ylabel('Y') | ||||
|         ax.plot(self.getSrcLoc()[0], self.getSrcLoc()[1], '*k', markersize=15)  # plot source location | ||||
| 
 | ||||
|         if annotations == True: | ||||
|             for traceID in self.getTraceIDlist(): | ||||
|                 if self.getPickFlag(traceID) is not 0: | ||||
|                     ax.annotate(' %s' % traceID, xy=(self.getRecLoc(traceID)[0], self.getRecLoc(traceID)[1]), | ||||
|                                 fontsize='x-small', color='k') | ||||
|                 else: | ||||
|                     ax.annotate(' %s' % traceID, xy=(self.getRecLoc(traceID)[0], self.getRecLoc(traceID)[1]), | ||||
|                                 fontsize='x-small', color='r') | ||||
| 
 | ||||
|         plt.show() | ||||
| @ -1,537 +0,0 @@ | ||||
| # -*- coding: utf-8 -*- | ||||
| import matplotlib.pyplot as plt | ||||
| import math | ||||
| import numpy as np | ||||
| 
 | ||||
| plt.interactive(True) | ||||
| 
 | ||||
| 
 | ||||
| class regions(object): | ||||
|     ''' | ||||
|     A class used for manual inspection and processing of all picks for the user. | ||||
| 
 | ||||
|     Examples: | ||||
| 
 | ||||
|     regions.chooseRectangles(): | ||||
|      - lets the user choose several rectangular regions in the plot | ||||
| 
 | ||||
|     regions.plotTracesInActiveRegions(): | ||||
|      - creates plots (shot.plot_traces) for all traces in the active regions (i.e. chosen by e.g. chooseRectangles) | ||||
| 
 | ||||
|     regions.setAllActiveRegionsForDeletion(): | ||||
|      - highlights all shots in a the active regions for deletion | ||||
| 
 | ||||
|     regions.deleteAllMarkedPicks(): | ||||
|      - deletes the picks (pick flag set to 0) for all shots set for deletion | ||||
| 
 | ||||
|     regions.deselectSelection(number): | ||||
|      - deselects the region of number = number | ||||
| 
 | ||||
|     ''' | ||||
| 
 | ||||
|     def __init__(self, ax, cbar, survey, qt_interface = False): | ||||
|         self.ax = ax | ||||
|         self.cbar = cbar | ||||
|         self.cbv = 'log10SNR' | ||||
|         self._xlim0 = self.ax.get_xlim() | ||||
|         self._ylim0 = self.ax.get_ylim() | ||||
|         self._xlim = self.ax.get_xlim() | ||||
|         self._ylim = self.ax.get_ylim() | ||||
|         self.survey = survey | ||||
|         self.shot_dict = self.survey.getShotDict() | ||||
|         self._x0 = [] | ||||
|         self._y0 = [] | ||||
|         self._x1 = [] | ||||
|         self._y1 = [] | ||||
|         self._polyx = [] | ||||
|         self._polyy = [] | ||||
|         self._allpicks = None | ||||
|         self.shots_found = {} | ||||
|         self.shots_for_deletion = {} | ||||
|         self._generateList() | ||||
|         if not qt_interface: | ||||
|             self.buttons = {} | ||||
|             self._addButtons() | ||||
|         self.addTextfield() | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def _generateList(self): | ||||
|         allpicks = [] | ||||
|         for shot in self.shot_dict.values(): | ||||
|             for traceID in shot.getTraceIDlist(): | ||||
|                 allpicks.append((shot.getDistance(traceID), | ||||
|                                  shot.getPickIncludeRemoved(traceID), | ||||
|                                  shot.getShotnumber(), | ||||
|                                  traceID, | ||||
|                                  shot.getPickFlag(traceID))) | ||||
| 
 | ||||
|         allpicks.sort() | ||||
|         self._allpicks = allpicks | ||||
| 
 | ||||
|     def getShotDict(self): | ||||
|         return self.shot_dict | ||||
| 
 | ||||
|     def getShotsForDeletion(self): | ||||
|         return self.shots_for_deletion | ||||
| 
 | ||||
|     def _onselect_clicks(self, eclick, erelease): | ||||
|         '''eclick and erelease are matplotlib events at press and release''' | ||||
|         print 'region selected x0, y0 = (%3s, %3s), x1, y1 = (%3s, %3s)' % (eclick.xdata, | ||||
|                                                                             eclick.ydata, | ||||
|                                                                             erelease.xdata, | ||||
|                                                                             erelease.ydata) | ||||
|         x0 = min(eclick.xdata, erelease.xdata) | ||||
|         x1 = max(eclick.xdata, erelease.xdata) | ||||
|         y0 = min(eclick.ydata, erelease.ydata) | ||||
|         y1 = max(eclick.ydata, erelease.ydata) | ||||
| 
 | ||||
|         shots, numtraces = self.findTracesInShotDict((x0, x1), (y0, y1)) | ||||
|         self.printOutput('Found %d traces in rectangle: %s' % (numtraces, shots)) | ||||
|         key = self.getKey() | ||||
|         self.shots_found[key] = {'shots': shots, | ||||
|                                  'selection': 'rect', | ||||
|                                  'xvalues': (x0, x1), | ||||
|                                  'yvalues': (y0, y1)} | ||||
|         self.markRectangle((x0, x1), (y0, y1), key) | ||||
|         self.disconnectRect() | ||||
| 
 | ||||
|     def _onselect_verts(self, verts): | ||||
|         x = verts[0][0] | ||||
|         y = verts[0][1] | ||||
|         self._polyx.append(x) | ||||
|         self._polyy.append(y) | ||||
| 
 | ||||
|         self.drawPolyLine() | ||||
| 
 | ||||
|     def _onpress(self, event): | ||||
|         if event.button == 3: | ||||
|             self.disconnectPoly() | ||||
|             self.printOutput('Disconnected polygon selection') | ||||
| 
 | ||||
|     def addTextfield(self, xpos=0, ypos=0.95, width=1, height=0.03): | ||||
|         ''' | ||||
|         Adds an ax for text output to the plot. | ||||
|         ''' | ||||
|         self.axtext = self.ax.figure.add_axes([xpos, | ||||
|                                                ypos, | ||||
|                                                width, | ||||
|                                                height]) | ||||
|         self.axtext.xaxis.set_visible(False) | ||||
|         self.axtext.yaxis.set_visible(False) | ||||
| 
 | ||||
|     def writeInTextfield(self, text=None): | ||||
|         self.setXYlim(self.ax.get_xlim(), self.ax.get_ylim()) | ||||
|         self.axtext.clear() | ||||
|         self.axtext.text(0.01, 0.5, text, verticalalignment='center', horizontalalignment='left') | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def _addButtons(self): | ||||
|         xpos1 = 0.13 | ||||
|         xpos2 = 0.6 | ||||
|         dx = 0.06 | ||||
|         self.addButton('Rect', self.chooseRectangles, xpos=xpos1, color='white') | ||||
|         self.addButton('Poly', self.choosePolygon, xpos=xpos1 + dx, color='white') | ||||
|         self.addButton('Plot', self.plotTracesInActiveRegions, xpos=xpos1 + 2 * dx, color='yellow') | ||||
|         self.addButton('SNR', self.refreshLog10SNR, xpos=xpos1 + 3 * dx, color='cyan') | ||||
|         self.addButton('PE', self.refreshPickerror, xpos=xpos1 + 4 * dx, color='cyan') | ||||
|         self.addButton('SPE', self.refreshSPE, xpos=xpos1 + 5 * dx, color='cyan') | ||||
|         self.addButton('DesLst', self.deselectLastSelection, xpos=xpos2 + dx, color='green') | ||||
|         self.addButton('SelAll', self.setAllActiveRegionsForDeletion, xpos=xpos2 + 2 * dx) | ||||
|         self.addButton('DelAll', self.deleteAllMarkedPicks, xpos=xpos2 + 3 * dx, color='red') | ||||
| 
 | ||||
|     def addButton(self, name, action, xpos, ypos=0.91, color=None): | ||||
|         from matplotlib.widgets import Button | ||||
|         self.buttons[name] = {'ax': None, | ||||
|                               'button': None, | ||||
|                               'action': action, | ||||
|                               'xpos': xpos} | ||||
|         ax = self.ax.figure.add_axes([xpos, | ||||
|                                       ypos, | ||||
|                                       0.05, | ||||
|                                       0.03]) | ||||
|         button = Button(ax, name, color=color, hovercolor='grey') | ||||
|         button.on_clicked(action) | ||||
|         self.buttons[name]['ax'] = ax | ||||
|         self.buttons[name]['button'] = button | ||||
|         self.buttons[name]['xpos'] = xpos | ||||
| 
 | ||||
|     def getKey(self): | ||||
|         if self.shots_found.keys() == []: | ||||
|             key = 1 | ||||
|         else: | ||||
|             key = max(self.shots_found.keys()) + 1 | ||||
|         return key | ||||
| 
 | ||||
|     def drawPolyLine(self): | ||||
|         self.setXYlim(self.ax.get_xlim(), self.ax.get_ylim()) | ||||
|         x = self._polyx | ||||
|         y = self._polyy | ||||
|         if len(x) >= 2 and len(y) >= 2: | ||||
|             self.ax.plot(x[-2:], y[-2:], 'k', alpha=0.1) | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def drawLastPolyLine(self): | ||||
|         self.setXYlim(self.ax.get_xlim(), self.ax.get_ylim()) | ||||
|         x = self._polyx | ||||
|         y = self._polyy | ||||
|         if len(x) >= 2 and len(y) >= 2: | ||||
|             self.ax.plot((x[-1], x[0]), (y[-1], y[0]), 'k', alpha=0.1) | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def finishPolygon(self): | ||||
|         self.drawLastPolyLine() | ||||
|         x = self._polyx | ||||
|         y = self._polyy | ||||
|         self._polyx = []; | ||||
|         self._polyy = [] | ||||
| 
 | ||||
|         key = self.getKey() | ||||
|         self.markPolygon(x, y, key=key) | ||||
| 
 | ||||
|         shots, numtraces = self.findTracesInPoly(x, y) | ||||
|         self.shots_found[key] = {'shots': shots, | ||||
|                                  'selection': 'poly', | ||||
|                                  'xvalues': x, | ||||
|                                  'yvalues': y} | ||||
|         self.printOutput('Found %d traces in polygon: %s' % (numtraces, shots)) | ||||
| 
 | ||||
|     def printOutput(self, text): | ||||
|         print text | ||||
|         self.writeInTextfield(text) | ||||
| 
 | ||||
|     def chooseRectangles(self, event=None): | ||||
|         ''' | ||||
|         Activates matplotlib widget RectangleSelector. | ||||
|         ''' | ||||
|         from matplotlib.widgets import RectangleSelector | ||||
|         if hasattr(self, '_cidPoly'): | ||||
|             self.disconnectPoly() | ||||
|         self.printOutput('Select rectangle is active. Press and hold left mousebutton.') | ||||
|         self._cidRect = None | ||||
|         self._cidRect = self.ax.figure.canvas.mpl_connect('button_press_event', self._onpress) | ||||
|         self._rectangle = RectangleSelector(self.ax, self._onselect_clicks) | ||||
|         return self._rectangle | ||||
| 
 | ||||
|     def choosePolygon(self, event=None): | ||||
|         ''' | ||||
|         Activates matplotlib widget LassoSelector. | ||||
|         ''' | ||||
|         from matplotlib.widgets import LassoSelector | ||||
|         if hasattr(self, '_cidRect'): | ||||
|             self.disconnectRect() | ||||
|         self.printOutput('Select polygon is active. Add points with leftclick. Finish with rightclick.') | ||||
|         self._cidPoly = None | ||||
|         self._cidPoly = self.ax.figure.canvas.mpl_connect('button_press_event', self._onpress) | ||||
|         self._lasso = LassoSelector(self.ax, self._onselect_verts) | ||||
|         return self._lasso | ||||
| 
 | ||||
|     def disconnectPoly(self, event=None): | ||||
|         if not hasattr(self, '_cidPoly'): | ||||
|             self.printOutput('no poly selection found') | ||||
|             return | ||||
|         self.ax.figure.canvas.mpl_disconnect(self._cidPoly) | ||||
|         del self._cidPoly | ||||
|         self.finishPolygon() | ||||
|         self._lasso.disconnect_events() | ||||
|         print 'disconnected poly selection\n' | ||||
| 
 | ||||
|     def disconnectRect(self, event=None): | ||||
|         if not hasattr(self, '_cidRect'): | ||||
|             self.printOutput('no rectangle selection found') | ||||
|             return | ||||
|         self.ax.figure.canvas.mpl_disconnect(self._cidRect) | ||||
|         del self._cidRect | ||||
|         self._rectangle.disconnect_events() | ||||
|         print 'disconnected rectangle selection\n' | ||||
| 
 | ||||
|     def deselectLastSelection(self, event=None): | ||||
|         if self.shots_found.keys() == []: | ||||
|             self.printOutput('No selection found.') | ||||
|             return | ||||
|         key = max(self.shots_found.keys()) | ||||
|         self.deselectSelection(key) | ||||
|         self.refreshFigure() | ||||
|          | ||||
|     def deselectSelection(self, key, color='green', alpha=0.1): | ||||
|         if key not in self.shots_found.keys(): | ||||
|             self.printOutput('No selection found.') | ||||
|             return | ||||
|         if color is not None: | ||||
|             if self.shots_found[key]['selection'] == 'rect': | ||||
|                 self.markRectangle(self.shots_found[key]['xvalues'], | ||||
|                                    self.shots_found[key]['yvalues'], | ||||
|                                    key=key, color=color, alpha=alpha, | ||||
|                                    linewidth=1) | ||||
|             elif self.shots_found[key]['selection'] == 'poly': | ||||
|                 self.markPolygon(self.shots_found[key]['xvalues'], | ||||
|                                  self.shots_found[key]['yvalues'], | ||||
|                                  key=key, color=color, alpha=alpha, | ||||
|                                  linewidth=1) | ||||
|         value = self.shots_found.pop(key) | ||||
|         self.printOutput('Deselected selection number %d' % key) | ||||
| 
 | ||||
|     def findTracesInPoly(self, x, y, picks='normal', highlight=True): | ||||
|         def dotproduct(v1, v2): | ||||
|             return sum((a * b for a, b in zip(v1, v2))) | ||||
| 
 | ||||
|         def getlength(v): | ||||
|             return math.sqrt(dotproduct(v, v)) | ||||
| 
 | ||||
|         def getangle(v1, v2): | ||||
|             return np.rad2deg(math.acos(dotproduct(v1, v2) / (getlength(v1) * getlength(v2)))) | ||||
| 
 | ||||
|         def insidePoly(x, y, pickX, pickY): | ||||
|             angle = 0 | ||||
|             epsilon = 1e-07 | ||||
|             for index in range(len(x)): | ||||
|                 xval1 = x[index - 1]; | ||||
|                 yval1 = y[index - 1] | ||||
|                 xval2 = x[index]; | ||||
|                 yval2 = y[index] | ||||
|                 angle += getangle([xval1 - pickX, yval1 - pickY], [xval2 - pickX, yval2 - pickY]) | ||||
|             if 360 - epsilon <= angle <= 360 + epsilon:  ### IMPROVE THAT?? | ||||
|                 return True | ||||
| 
 | ||||
|         if len(x) == 0 or len(y) == 0: | ||||
|             self.printOutput('No polygon defined.') | ||||
|             return | ||||
| 
 | ||||
|         shots_found = {}; | ||||
|         numtraces = 0 | ||||
|         x0 = min(x); | ||||
|         x1 = max(x) | ||||
|         y0 = min(y); | ||||
|         y1 = max(y) | ||||
| 
 | ||||
|         shots, numtracesrect = self.findTracesInShotDict((x0, x1), (y0, y1), highlight=False) | ||||
|         for shotnumber in shots.keys(): | ||||
|             shot = self.shot_dict[shotnumber] | ||||
|             for traceID in shots[shotnumber]: | ||||
|                 if shot.getPickFlag(traceID) is not 0: | ||||
|                     pickX = shot.getDistance(traceID) | ||||
|                     pickY = shot.getPick(traceID) | ||||
|                     if insidePoly(x, y, pickX, pickY): | ||||
|                         if shotnumber not in shots_found.keys(): | ||||
|                             shots_found[shotnumber] = [] | ||||
|                         shots_found[shotnumber].append(traceID) | ||||
|                         if highlight == True: | ||||
|                             self.highlightPick(shot, traceID) | ||||
|                         numtraces += 1 | ||||
| 
 | ||||
|         self.drawFigure() | ||||
|         return shots_found, numtraces | ||||
| 
 | ||||
|     def findTracesInShotDict(self, (x0, x1), (y0, y1), picks='normal', highlight=True): | ||||
|         ''' | ||||
|         Returns traces corresponding to a certain area in the plot with all picks over the distances. | ||||
|         ''' | ||||
|         shots_found = {}; | ||||
|         numtraces = 0 | ||||
|         if picks == 'normal': | ||||
|             pickflag = 0 | ||||
|         elif picks == 'includeCutOut': | ||||
|             pickflag = None | ||||
| 
 | ||||
|         for line in self._allpicks: | ||||
|             dist, pick, shotnumber, traceID, flag = line | ||||
|             if flag == pickflag: continue  ### IMPROVE THAT | ||||
|             if (x0 <= dist <= x1 and y0 <= pick <= y1): | ||||
|                 if shotnumber not in shots_found.keys(): | ||||
|                     shots_found[shotnumber] = [] | ||||
|                 shots_found[shotnumber].append(traceID) | ||||
|                 if highlight == True: | ||||
|                     self.highlightPick(self.shot_dict[shotnumber], traceID) | ||||
|                 numtraces += 1 | ||||
| 
 | ||||
|         self.drawFigure() | ||||
|         return shots_found, numtraces | ||||
| 
 | ||||
|     def highlightPick(self, shot, traceID, annotations=True): | ||||
|         ''' | ||||
|         Highlights a single pick for a shot(object)/shotnumber and traceID. | ||||
|         If annotations == True: Displays shotnumber and traceID in the plot. | ||||
|         ''' | ||||
|         if type(shot) == int: | ||||
|             shot = self.survey.getShotDict()[shot] | ||||
| 
 | ||||
|         if shot.getPickFlag(traceID) is 0: | ||||
|             return | ||||
| 
 | ||||
|         self.ax.scatter(shot.getDistance(traceID), shot.getPick(traceID), s=50, marker='o', facecolors='none', | ||||
|                         edgecolors='m', alpha=1) | ||||
|         if annotations == True: | ||||
|             self.ax.annotate(s='s%s|t%s' % (shot.getShotnumber(), traceID), | ||||
|                              xy=(shot.getDistance(traceID), shot.getPick(traceID)), fontsize='xx-small') | ||||
| 
 | ||||
|     def highlightAllActiveRegions(self): | ||||
|         ''' | ||||
|         Highlights all picks in all active regions. | ||||
|         ''' | ||||
|         for key in self.shots_found.keys(): | ||||
|             for shotnumber in self.shots_found[key]['shots'].keys(): | ||||
|                 for traceID in self.shots_found[key]['shots'][shotnumber]: | ||||
|                     self.highlightPick(self.shot_dict[shotnumber], traceID) | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def plotTracesInActiveRegions(self, event=None, keys='all', maxfigures=20, qt = False): | ||||
|         ''' | ||||
|         Plots all traces in the active region or for all specified keys. | ||||
| 
 | ||||
|         :param: keys | ||||
|         :type: int or list | ||||
| 
 | ||||
|         :param: maxfigures, maximum value of figures opened | ||||
|         :type: int | ||||
|         ''' | ||||
|         if qt: | ||||
|             from pylot.core.active.gui import Repicking | ||||
|              | ||||
|         count = 0 | ||||
|         if keys == 'all': | ||||
|             keys = self.shots_found.keys() | ||||
|         elif type(keys) == int: | ||||
|             keys = [keys] | ||||
| 
 | ||||
|         if len(self.shots_found) > 0: | ||||
|             for shot in self.shot_dict.values(): | ||||
|                 for key in keys: | ||||
|                     for shotnumber in self.shots_found[key]['shots']: | ||||
|                         if shot.getShotnumber() == shotnumber: | ||||
|                             for traceID in self.shots_found[key]['shots'][shotnumber]: | ||||
|                                 count += 1 | ||||
|                                 if count > maxfigures: | ||||
|                                     print 'Maximum number of figures (%s) reached. %sth figure was not opened.' % ( | ||||
|                                     maxfigures, count) | ||||
|                                     break | ||||
|                                 shot.plot_traces(traceID) | ||||
|         else: | ||||
|             self.printOutput('No picks defined in that region(s)') | ||||
| 
 | ||||
|     def setAllActiveRegionsForDeletion(self, event=None): | ||||
|         keys = [] | ||||
|         for key in self.shots_found.keys(): | ||||
|             keys.append(key) | ||||
|         self.setRegionForDeletion(keys) | ||||
| 
 | ||||
|     def setRegionForDeletion(self, keys): | ||||
|         if type(keys) == int: | ||||
|             keys = [keys] | ||||
| 
 | ||||
|         for key in keys: | ||||
|             for shotnumber in self.shots_found[key]['shots'].keys(): | ||||
|                 if shotnumber not in self.shots_for_deletion: | ||||
|                     self.shots_for_deletion[shotnumber] = [] | ||||
|                 for traceID in self.shots_found[key]['shots'][shotnumber]: | ||||
|                     if traceID not in self.shots_for_deletion[shotnumber]: | ||||
|                         self.shots_for_deletion[shotnumber].append(traceID) | ||||
|             self.deselectSelection(key, color='red', alpha=0.2) | ||||
| 
 | ||||
|             self.deselectSelection(key, color='red', alpha=0.2) | ||||
| 
 | ||||
|         self.printOutput('Set region(s) %s for deletion' % keys) | ||||
| 
 | ||||
|     def markAllActiveRegions(self): | ||||
|         for key in self.shots_found.keys(): | ||||
|             if self.shots_found[key]['selection'] == 'rect': | ||||
|                 self.markRectangle(self.shots_found[key]['xvalues'], | ||||
|                                    self.shots_found[key]['yvalues'], key=key) | ||||
|             if self.shots_found[key]['selection'] == 'poly': | ||||
|                 self.markPolygon(self.shots_found[key]['xvalues'], | ||||
|                                  self.shots_found[key]['yvalues'], key=key) | ||||
| 
 | ||||
|     def markRectangle(self, (x0, x1), (y0, y1), key=None, color='grey', alpha=0.1, linewidth=1): | ||||
|         ''' | ||||
|         Mark a rectangular region on the axes. | ||||
|         ''' | ||||
|         from matplotlib.patches import Rectangle | ||||
|         self.ax.add_patch(Rectangle((x0, y0), x1 - x0, y1 - y0, alpha=alpha, facecolor=color, linewidth=linewidth)) | ||||
|         if key is not None: | ||||
|             self.ax.text(x0 + (x1 - x0) / 2, y0 + (y1 - y0) / 2, str(key)) | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def markPolygon(self, x, y, key=None, color='grey', alpha=0.1, linewidth=1): | ||||
|         from matplotlib.patches import Polygon | ||||
|         poly = Polygon(np.array(zip(x, y)), color=color, alpha=alpha, lw=linewidth) | ||||
|         self.ax.add_patch(poly) | ||||
|         if key is not None: | ||||
|             self.ax.text(min(x) + (max(x) - min(x)) / 2, min(y) + (max(y) - min(y)) / 2, str(key)) | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def clearShotsForDeletion(self): | ||||
|         ''' | ||||
|         Clears the list of shots marked for deletion. | ||||
|         ''' | ||||
|         self.shots_for_deletion = {} | ||||
|         print('Cleared all shots that were set for deletion.') | ||||
| 
 | ||||
|     def getShotsForDeletion(self): | ||||
|         return self.shots_for_deletion | ||||
| 
 | ||||
|     def deleteAllMarkedPicks(self, event=None): | ||||
|         ''' | ||||
|         Deletes all shots set for deletion. | ||||
|         ''' | ||||
|         if len(self.getShotsForDeletion()) is 0: | ||||
|             self.printOutput('No shots set for deletion.') | ||||
|             return | ||||
| 
 | ||||
|         for shot in self.getShotDict().values(): | ||||
|             for shotnumber in self.getShotsForDeletion(): | ||||
|                 if shot.getShotnumber() == shotnumber: | ||||
|                     for traceID in self.getShotsForDeletion()[shotnumber]: | ||||
|                         shot.removePick(traceID) | ||||
|                         print "Deleted the pick for traceID %s on shot number %s" % (traceID, shotnumber) | ||||
|         self.clearShotsForDeletion() | ||||
|         self.refreshFigure() | ||||
| 
 | ||||
|     def highlightPicksForShot(self, shot, annotations=False): | ||||
|         ''' | ||||
|         Highlight all picks for a given shot. | ||||
|         ''' | ||||
|         if type(shot) is int: | ||||
|             shot = self.survey.getShotDict()[shotnumber] | ||||
| 
 | ||||
|         for traceID in shot.getTraceIDlist(): | ||||
|             if shot.getPickFlag(traceID) is not 0: | ||||
|                 self.highlightPick(shot, traceID, annotations) | ||||
| 
 | ||||
|         self.drawFigure() | ||||
| 
 | ||||
|     def setXYlim(self, xlim, ylim): | ||||
|         self._xlim, self._ylim = xlim, ylim | ||||
| 
 | ||||
|     def refreshLog10SNR(self, event=None): | ||||
|         cbv = 'log10SNR' | ||||
|         self.cbv = cbv | ||||
|         self.refreshFigure(self, colorByVal=cbv) | ||||
| 
 | ||||
|     def refreshPickerror(self, event=None): | ||||
|         cbv = 'pickerror' | ||||
|         self.cbv = cbv | ||||
|         self.refreshFigure(self, colorByVal=cbv) | ||||
|          | ||||
|     def refreshSPE(self, event=None): | ||||
|         cbv = 'spe' | ||||
|         self.cbv = cbv | ||||
|         self.refreshFigure(self, colorByVal=cbv) | ||||
|          | ||||
|     def refreshFigure(self, event=None, colorByVal=None): | ||||
|         if colorByVal == None: | ||||
|             colorByVal = self.cbv | ||||
|         else: | ||||
|             self.cbv = colorByVal | ||||
|         self.printOutput('Refreshing figure...') | ||||
|         self.ax.clear() | ||||
|         self.ax = self.survey.plotAllPicks(ax=self.ax, cbar=self.cbar, refreshPlot=True, colorByVal=colorByVal) | ||||
|         self.setXYlim(self.ax.get_xlim(), self.ax.get_ylim()) | ||||
|         self.markAllActiveRegions() | ||||
|         self.highlightAllActiveRegions() | ||||
|         self.drawFigure() | ||||
|         self.printOutput('Done!') | ||||
| 
 | ||||
|     def drawFigure(self, resetAxes=True): | ||||
|         if resetAxes == True: | ||||
|             self.ax.set_xlim(self._xlim) | ||||
|             self.ax.set_ylim(self._ylim) | ||||
|         self.ax.figure.canvas.draw() | ||||
|          | ||||
| @ -1,293 +0,0 @@ | ||||
| from __future__ import print_function | ||||
| import numpy as np | ||||
| 
 | ||||
| def readParameters(parfile, parameter): | ||||
|     """ | ||||
| 
 | ||||
|     :param parfile: | ||||
|     :param parameter: | ||||
|     :return: | ||||
|     """ | ||||
|     from ConfigParser import ConfigParser | ||||
|     parameterConfig = ConfigParser() | ||||
|     parameterConfig.read('parfile') | ||||
| 
 | ||||
|     value = parameterConfig.get('vars', parameter).split('\t')[0] | ||||
| 
 | ||||
|     return value | ||||
| 
 | ||||
| 
 | ||||
| def fitSNR4dist(shot_dict, shiftdist=30, shiftSNR=100): | ||||
|     """ | ||||
|     Approach to fit the decreasing SNR with wave travel distance. | ||||
| 
 | ||||
|     :param shot_dict: dictionary containing Seismicshot objects (e.g. survey.getShotDict()) | ||||
|     :param shiftdist: shift compensating curve by a certain distance to the left | ||||
|     :param shiftSNR: shift compensating curve by a certain SNR value to the bottom | ||||
|     :return: | ||||
|     """ | ||||
|     import numpy as np | ||||
|     dists = [] | ||||
|     picks = [] | ||||
|     snrs = [] | ||||
|     snr_sqrt_inv = [] | ||||
|     snrthresholds = [] | ||||
|     snrBestFit = [] | ||||
|     for shot in shot_dict.values(): | ||||
|         for traceID in shot.getTraceIDlist(): | ||||
|             if shot.getSNR(traceID)[0] >= 1: | ||||
|                 dists.append(shot.getDistance(traceID)) | ||||
|                 picks.append(shot.getPickIncludeRemoved(traceID)) | ||||
|                 snrs.append(shot.getSNR(traceID)[0]) | ||||
|                 snr_sqrt_inv.append(1 / np.sqrt(shot.getSNR(traceID)[0])) | ||||
|     fit = np.polyfit(dists, snr_sqrt_inv, 1) | ||||
|     fit_fn = np.poly1d(fit) | ||||
|     for dist in dists: | ||||
|         snrBestFit.append((1 / (fit_fn(dist) ** 2))) | ||||
|         dist += shiftdist | ||||
|         snrthresholds.append((1 / (fit_fn(dist) ** 2)) - shiftSNR * np.exp(-0.05 * dist)) | ||||
|     plotFittedSNR(dists, snrthresholds, snrs, snrBestFit) | ||||
|     return fit_fn  #### ZU VERBESSERN, sollte fertige funktion wiedergeben | ||||
| 
 | ||||
| 
 | ||||
| def plotFittedSNR(dists, snrthresholds, snrs, snrBestFit): | ||||
|     """ | ||||
| 
 | ||||
|     :param dists: | ||||
|     :param snrthresholds: | ||||
|     :param snrs: | ||||
|     :param snrBestFit: | ||||
|     :return: | ||||
|     """ | ||||
|     import matplotlib.pyplot as plt | ||||
|     plt.interactive(True) | ||||
|     fig = plt.figure() | ||||
|     plt.plot(dists, snrs, 'b.', markersize=2.0, label='SNR values') | ||||
|     dists.sort() | ||||
|     snrthresholds.sort(reverse=True) | ||||
|     snrBestFit.sort(reverse=True) | ||||
|     plt.plot(dists, snrthresholds, 'r', markersize=1, label='Fitted threshold') | ||||
|     plt.plot(dists, snrBestFit, 'k', markersize=1, label='Best fitted curve') | ||||
|     plt.xlabel('Distance[m]') | ||||
|     plt.ylabel('SNR') | ||||
|     plt.legend() | ||||
| 
 | ||||
|      | ||||
| def setDynamicFittedSNR(shot_dict, shiftdist=30, shiftSNR=100, p1=0.004, p2=-0.0007): | ||||
|     """ | ||||
|     Set SNR values for a dictionary containing Seismicshots (e.g. survey.getShotDict()) | ||||
|     by parameters calulated from fitSNR4dist. | ||||
| 
 | ||||
|     :param shot_dict: | ||||
|     :type shot_dict: dict | ||||
|     :param shiftdist: | ||||
|     :type shiftdist: int | ||||
|     :param shiftSNR: | ||||
|     :type shiftSNR: int | ||||
|     :param p1: | ||||
|     :type p1: float | ||||
|     :param p2: | ||||
|     :type p2: float | ||||
|     :return: | ||||
|     """ | ||||
|     minSNR = 2.5 | ||||
|     # fit_fn = fitSNR4dist(shot_dict) | ||||
|     fit_fn = get_fit_fn(p1, p2) | ||||
|     for shot in shot_dict.values(): | ||||
|         for traceID in shot.getTraceIDlist():  ### IMPROVE | ||||
|             dist = shot.getDistance(traceID) + shiftdist | ||||
|             snrthreshold = snr_fit_func(fit_fn, dist, shiftSNR) | ||||
|             if snrthreshold < minSNR: | ||||
|                 print('WARNING: SNR threshold %s lower %s. Set SNR threshold to %s.' | ||||
|                       % (snrthreshold, minSNR, minSNR)) | ||||
|                 shot.setSNRthreshold(traceID, minSNR) | ||||
|             else: | ||||
|                 shot.setSNRthreshold(traceID, snrthreshold) | ||||
|     print("setDynamicFittedSNR: Finished setting of fitted SNR-threshold.\n" | ||||
|           "Parameters: ShiftDist = %s, ShiftSNR = %s, p1 = %s, p2 = %s" | ||||
|           %(shiftdist, shiftSNR, p1, p2)) | ||||
| 
 | ||||
| def snr_fit_func(fit_fn, dist, shiftSNR): | ||||
|     snrthreshold = (1 / (fit_fn(dist) ** 2)) - shiftSNR * np.exp(-0.05 * dist) | ||||
|     return snrthreshold | ||||
| 
 | ||||
| def get_fit_fn(p1, p2): | ||||
|     return np.poly1d([p1, p2]) | ||||
| 
 | ||||
| def setConstantSNR(shot_dict, snrthreshold=2.5): | ||||
|     """ | ||||
|     Set a constant SNR value to all Seismicshots in a dictionary (e.g. survey.getShotDict()). | ||||
| 
 | ||||
|     :param shot_dict: | ||||
|     :param snrthreshold: | ||||
|     :return: | ||||
|     """ | ||||
|     for shot in shot_dict.values(): | ||||
|         for traceID in shot.getTraceIDlist(): | ||||
|             shot.setSNRthreshold(traceID, snrthreshold) | ||||
|     print("setConstantSNR: Finished setting of SNR threshold to a constant value of %s" % snrthreshold) | ||||
| 
 | ||||
| 
 | ||||
| def findTracesInRanges(shot_dict, distancebin, pickbin): | ||||
|     ''' | ||||
|     Returns traces corresponding to a certain area in a plot with all picks over the distances. | ||||
| 
 | ||||
|     :param: shot_dict, dictionary containing all shots that are used | ||||
|     :type: dictionary | ||||
| 
 | ||||
|     :param: distancebin | ||||
|     :type: tuple, (dist1[m], dist2[m]) | ||||
| 
 | ||||
|     :param: pickbin | ||||
|     :type: tuple, (t1[s], t2[s]) | ||||
| 
 | ||||
|     ''' | ||||
|     shots_found = {} | ||||
|     for shot in shot_dict.values(): | ||||
|         if shot.getTraceIDs4Dist(distancebin=distancebin) is not None: | ||||
|             for traceID in shot.getTraceIDs4Dist(distancebin=distancebin): | ||||
|                 if pickbin[0] < shot.getPick(traceID) < pickbin[1]: | ||||
|                     if shot.getShotnumber() not in shots_found.keys(): | ||||
|                         shots_found[shot.getShotnumber()] = [] | ||||
|                     shots_found[shot.getShotnumber()].append(traceID) | ||||
| 
 | ||||
|     return shots_found | ||||
| 
 | ||||
| 
 | ||||
| def cleanUp(survey): | ||||
|     """ | ||||
|     Cleans up a Survey object by removing frontend information | ||||
|     which can not be saved in the pickle format. | ||||
|     """ | ||||
|     for shot in survey.data.values(): | ||||
|         shot.traces4plot = {} | ||||
| 
 | ||||
| def plotScatterStats4Shots(survey, variable, ax = None, twoDim = False): | ||||
|     """ | ||||
|     Statistics, scatter plot. | ||||
| 
 | ||||
|     :param survey: | ||||
|     :param variable: can be 'mean SNR', 'median SNR', 'mean SPE', 'median SPE', or 'picked traces' | ||||
|     :return: | ||||
|     """ | ||||
|     import matplotlib.pyplot as plt | ||||
|     import numpy as np | ||||
|     statsShot = {} | ||||
|     x = [] | ||||
|     y = [] | ||||
|     value = [] | ||||
|     for shot in survey.data.values(): | ||||
|         for traceID in shot.getTraceIDlist(): | ||||
|             if not shot in statsShot.keys(): | ||||
|                 statsShot[shot] = {'x': shot.getSrcLoc()[0], | ||||
|                                    'y': shot.getSrcLoc()[1], | ||||
|                                    'SNR': [], | ||||
|                                    'SPE': [], | ||||
|                                    'picked traces': 0} | ||||
| 
 | ||||
|             SNR = shot.getSNR(traceID)[0] | ||||
|             if not SNR == np.inf: | ||||
|                 statsShot[shot]['SNR'].append(SNR) | ||||
|             if shot.getPickFlag(traceID) == 1: | ||||
|                 statsShot[shot]['picked traces'] += 1 | ||||
|                 statsShot[shot]['SPE'].append(shot.getSymmetricPickError(traceID)) | ||||
| 
 | ||||
|     for shot in statsShot.keys(): | ||||
|         statsShot[shot]['mean SNR'] = np.mean(statsShot[shot]['SNR']) | ||||
|         statsShot[shot]['median SNR'] = np.median(statsShot[shot]['SNR']) | ||||
|         statsShot[shot]['mean SPE'] = np.mean(statsShot[shot]['SPE']) | ||||
|         statsShot[shot]['median SPE'] = np.median(statsShot[shot]['SPE']) | ||||
| 
 | ||||
|     for shot in statsShot.keys(): | ||||
|         x.append(statsShot[shot]['x']) | ||||
|         y.append(statsShot[shot]['y']) | ||||
|         value.append(statsShot[shot][variable]) | ||||
| 
 | ||||
|     if ax is None: | ||||
|         fig = plt.figure() | ||||
|         ax = fig.add_subplot(111) | ||||
| 
 | ||||
|     size = [] | ||||
|     for val in value: | ||||
|         size.append(100 * val / max(value)) | ||||
| 
 | ||||
|     sc = ax.scatter(x, y, s=size, c=value) | ||||
|     ax.text(0.5, 1.05,'Plot of all shots', | ||||
|             horizontalalignment='center', verticalalignment='center', | ||||
|             transform=ax.transAxes) | ||||
|     ax.set_xlabel('X [m]') | ||||
|     ax.set_ylabel('Y [m]') | ||||
|     if not twoDim: | ||||
|         ax.set_aspect('equal') | ||||
|     cbar = ax.figure.colorbar(sc) | ||||
|     cbar.set_label(variable) | ||||
| 
 | ||||
|     for shot in statsShot.keys(): | ||||
|         ax.annotate(' %s' % shot.getShotnumber(), xy=(shot.getSrcLoc()[0], shot.getSrcLoc()[1]), | ||||
|                     fontsize='x-small', color='k') | ||||
| 
 | ||||
| 
 | ||||
| def plotScatterStats4Receivers(survey, variable, ax = None, twoDim = False): | ||||
|     """ | ||||
|     Statistics, scatter plot. | ||||
| 
 | ||||
|     :param survey: | ||||
|     :param variable: can be 'mean SNR', 'median SNR', 'mean SPE', 'median SPE', or 'picked traces' | ||||
|     :return: | ||||
|     """ | ||||
|     import matplotlib.pyplot as plt | ||||
|     import numpy as np | ||||
|     statsRec = {} | ||||
|     x = [] | ||||
|     y = [] | ||||
|     value = [] | ||||
|     for shot in survey.data.values(): | ||||
|         for traceID in shot.getTraceIDlist(): | ||||
|             if not traceID in statsRec.keys(): | ||||
|                 statsRec[traceID] = {'x': shot.getRecLoc(traceID)[0], | ||||
|                                      'y': shot.getRecLoc(traceID)[1], | ||||
|                                      'SNR': [], | ||||
|                                      'SPE': [], | ||||
|                                      'picked traces': 0} | ||||
| 
 | ||||
|             SNR = shot.getSNR(traceID)[0] | ||||
|             if not SNR == np.inf: | ||||
|                 statsRec[traceID]['SNR'].append(SNR) | ||||
|             if shot.getPickFlag(traceID) == 1: | ||||
|                 statsRec[traceID]['picked traces'] += 1 | ||||
|                 statsRec[traceID]['SPE'].append(shot.getSymmetricPickError(traceID)) | ||||
| 
 | ||||
|     for traceID in statsRec.keys(): | ||||
|         statsRec[traceID]['mean SNR'] = np.mean(statsRec[traceID]['SNR']) | ||||
|         statsRec[traceID]['median SNR'] = np.median(statsRec[traceID]['SNR']) | ||||
|         statsRec[traceID]['mean SPE'] = np.mean(statsRec[traceID]['SPE']) | ||||
|         statsRec[traceID]['median SPE'] = np.median(statsRec[traceID]['SPE']) | ||||
| 
 | ||||
|     for traceID in statsRec.keys(): | ||||
|         x.append(statsRec[traceID]['x']) | ||||
|         y.append(statsRec[traceID]['y']) | ||||
|         value.append(statsRec[traceID][variable]) | ||||
| 
 | ||||
|     if ax is None: | ||||
|         fig = plt.figure() | ||||
|         ax = fig.add_subplot(111) | ||||
| 
 | ||||
|     size = [] | ||||
|     for val in value: | ||||
|         size.append(100 * val / max(value)) | ||||
| 
 | ||||
|     sc = ax.scatter(x, y, s=size, c=value) | ||||
|     ax.text(0.5, 1.05,'Plot of all receivers', | ||||
|             horizontalalignment='center', verticalalignment='center', | ||||
|             transform=ax.transAxes) | ||||
|     ax.set_xlabel('X [m]') | ||||
|     ax.set_ylabel('Y [m]') | ||||
|     if not twoDim: | ||||
|         ax.set_aspect('equal') | ||||
|     cbar = ax.figure.colorbar(sc) | ||||
|     cbar.set_label(variable) | ||||
| 
 | ||||
|     shot = survey.data.values()[0] | ||||
|     for traceID in shot.getTraceIDlist(): | ||||
|         ax.annotate(' %s' % traceID, xy=(shot.getRecLoc(traceID)[0], shot.getRecLoc(traceID)[1]), | ||||
|                     fontsize='x-small', color='k') | ||||
| @ -1,55 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| from obspy.core import read | ||||
| from obspy.signal.trigger import coincidenceTrigger | ||||
| 
 | ||||
| 
 | ||||
| class CoincidenceTimes(object): | ||||
|     def __init__(self, st, comp='Z', coinum=4, sta=1., lta=10., on=5., off=1.): | ||||
|         _type = 'recstalta' | ||||
|         self.coinclist = self.createCoincTriggerlist(data=st, trigcomp=comp, | ||||
|                                                      coinum=coinum, sta=sta, | ||||
|                                                      lta=lta, trigon=on, | ||||
|                                                      trigoff=off, type=_type) | ||||
| 
 | ||||
|     def __str__(self): | ||||
|         n = 1 | ||||
|         out = '' | ||||
|         for time in self.getCoincTimes(): | ||||
|             out += 'event no. {0}: starttime is {1}\n'.format(n, time) | ||||
|             n += 1 | ||||
|         return out | ||||
| 
 | ||||
|     def getCoincTimes(self): | ||||
|         timelist = [] | ||||
|         for info in self.getCoincList(): | ||||
|             timelist.append(info['time']) | ||||
| 
 | ||||
|         return timelist | ||||
| 
 | ||||
|     def getCoincList(self): | ||||
|         return self.coinclist | ||||
| 
 | ||||
|     def createCoincTriggerlist(self, data, trigcomp, coinum, sta, lta, | ||||
|                                trigon, trigoff, type): | ||||
|         ''' | ||||
|         uses a coincidence trigger to detect all events in the given | ||||
|         dataset | ||||
|         ''' | ||||
| 
 | ||||
|         triggerlist = coincidenceTrigger(type, trigon, trigoff, | ||||
|                                          data.select(component=trigcomp), | ||||
|                                          coinum, sta=sta, lta=lta) | ||||
|         return triggerlist | ||||
| 
 | ||||
| 
 | ||||
| def main(): | ||||
|     data = read('/data/SDS/2014/1A/ZV??/?H?.D/*.365') | ||||
|     data.filter(type='bandpass', freqmin=5., freqmax=30.) | ||||
|     coincs = CoincidenceTimes(data) | ||||
|     print(coincs) | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     main() | ||||
| @ -1,107 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| import numpy as np | ||||
| 
 | ||||
| 
 | ||||
| def crosscorrsingle(wf1, wf2, taumax): | ||||
|     ''' | ||||
|     Calculates the crosscorrelation between two waveforms with a defined maximum timedifference. | ||||
|     :param wf1: first waveformdata | ||||
|     :type wf1: list | ||||
|     :param wf2: second waveformdata | ||||
|     :type wf2: list | ||||
|     :param taumax: maximum time difference between waveforms | ||||
|     :type taumax: positive integer | ||||
|     :return: returns the crosscorrelation funktion 'c' and the lagvector 'l' | ||||
|     :rtype: c and l are lists | ||||
|     ''' | ||||
|     N = len(wf1) | ||||
|     c = np.zeros(2 * taumax - 1) | ||||
|     l = np.zeros(2 * taumax - 1) | ||||
|     for tau in range(taumax): | ||||
|         Cxyplus = 0 | ||||
|         Cxyminus = 0 | ||||
|         for n in range(N - tau): | ||||
|             Cxy1plus = wf1[n] * wf2[n + tau] | ||||
|             Cxy1minus = wf1[n + tau] * wf2[n] | ||||
|             Cxyplus = Cxyplus + Cxy1plus | ||||
|             Cxyminus = Cxyminus + Cxy1minus | ||||
| 
 | ||||
|         c[(taumax - 1) - tau] = Cxyminus | ||||
|         c[(taumax - 1) + tau] = Cxyplus | ||||
|         l[(taumax - 1) - tau] = -tau | ||||
|         l[(taumax - 1) + tau] = tau | ||||
|     return c, l | ||||
| 
 | ||||
| 
 | ||||
| def crosscorrnormcalc(weights, wfs): | ||||
|     ''' | ||||
|     crosscorrnormcalc - function that calculates the normalization for the | ||||
|     cross correlation carried out by 'wfscrosscorr' | ||||
|     :param weights: weighting factors for the single components | ||||
|     :type weights: tuple | ||||
|     :param wfs: tuple of `~numpy.array` object containing waveform data | ||||
|     :type wfs: tuple | ||||
|     :return: a floating point number yielding the by 'weights' weighted energy | ||||
|     of the waveforms in 'wfs' | ||||
|     :rtype: float | ||||
|     ''' | ||||
| 
 | ||||
|     # check if the parameters are of the right type | ||||
|     if not isinstance(weights, tuple): | ||||
|         raise TypeError("type of 'weight' should be 'tuple', but is {0}".format( | ||||
|             type(weights))) | ||||
|     if not isinstance(wfs, tuple): | ||||
|         raise TypeError( | ||||
|             "type of parameter 'wfs' should be 'tuple', but is {0}".format( | ||||
|                 type(wfs))) | ||||
|     sqrsumwfs = 0. | ||||
|     for n, wf in enumerate(wfs): | ||||
|         sqrsumwf = np.sum(weights[n] ** 2. * wf ** 2.) | ||||
|         sqrsumwfs += sqrsumwf | ||||
|     return np.sqrt(sqrsumwfs) | ||||
| 
 | ||||
| 
 | ||||
| def wfscrosscorr(weights, wfs, taumax): | ||||
|     ''' | ||||
|     wfscrosscorr - function that calculates successive cross-correlations from a set of waveforms stored in a matrix | ||||
| 
 | ||||
|         base formula is: | ||||
|             C(i)=SUM[p=1:nComponent](eP(p)*(SUM[n=1:N]APp(x,n)*APp(y,n+i)))/(SQRT(SUM[p=1:nComponent]eP(p)^2*(SUM[n=1:N](APp(x,n)^2)))*SQRT(SUM[p=1:nComponent]eP(p)^2*(SUM[n=1:N]APp(y,n)^2))) | ||||
|                 whereas | ||||
|                     nComponent is the number of components | ||||
|                     N is the number of samples | ||||
|                     i is the lag-index | ||||
| 
 | ||||
|     input: | ||||
|         APp		rowvectors containing the waveforms of each component p for which the cross-correlation is calculated | ||||
|         tPp		rowvectros containing times | ||||
|         eP		vector containing the weighting factors for the components (maxsize = [1x3]) | ||||
| 
 | ||||
|     output: | ||||
|         C		cross-correlation function | ||||
|         L		lag-vector | ||||
| 
 | ||||
|     author(s): | ||||
| 
 | ||||
|     SWB 26.01.2010 as arranged with Thomas Meier and Monika Bischoff | ||||
| 
 | ||||
|     :param weights: weighting factors for the single components | ||||
|     :type weights: tuple | ||||
|     :param wfs: tuple of `~numpy.array` object containing waveform data | ||||
|     :type wfs: tuple | ||||
|     :param taumax: maximum time difference | ||||
|     :type taumax: positive integer | ||||
|     :return: returns cross correlation function normalized by the waveform energy | ||||
|     ''' | ||||
| 
 | ||||
|     ccnorm = 0. | ||||
|     ccnorm = crosscorrnormcalc(weights, wfs[0]) | ||||
|     ccnorm *= crosscorrnormcalc(weights, wfs[1]) | ||||
| 
 | ||||
|     c = 0. | ||||
|     for n in range(len(wfs)): | ||||
|         cc, l = crosscorrsingle(wfs[0][n], wfs[1][n], taumax) | ||||
|         c += cc | ||||
|     return c / ccnorm, l | ||||
| @ -1,50 +0,0 @@ | ||||
| #!/usr/bin/env python | ||||
| # -*- coding: utf-8 -*- | ||||
| 
 | ||||
| from obspy.signal.trigger import recursive_sta_lta, trigger_onset | ||||
| 
 | ||||
| 
 | ||||
| def createSingleTriggerlist(st, station='ZV01', trigcomp='Z', stalta=(1, 10), | ||||
|                             trigonoff=(6, 1)): | ||||
|     ''' | ||||
|     uses a single-station trigger to create a triggerlist for this station | ||||
|     :param st: obspy stream | ||||
|     :type  st: | ||||
|     :param station: station name to get triggers for  (optional, default = ZV01) | ||||
|     :type  station: str | ||||
|     :param trigcomp: (optional, default = Z) | ||||
|     :type  trigcomp: str | ||||
|     :param stalta: (optional, default = (1,10)) | ||||
|     :type  stalta: tuple | ||||
|     :param trigonoff: (optional, default = (6,1)) | ||||
|     :type  trigonoff: tuple | ||||
|     :return: list of triggtimes | ||||
|     :rtype: list | ||||
|     ''' | ||||
|     tr = st.copy().select(component=trigcomp, station=station)[0] | ||||
|     df = tr.stats.sampling_rate | ||||
| 
 | ||||
|     cft = recursive_sta_lta(tr.data, int(stalta[0] * df), int(stalta[1] * df)) | ||||
|     triggers = trigger_onset(cft, trigonoff[0], trigonoff[1]) | ||||
|     trigg = [] | ||||
|     for time in triggers: | ||||
|         trigg.append(tr.stats.starttime + time[0] / df) | ||||
|     return trigg | ||||
| 
 | ||||
| 
 | ||||
| def createSubCoincTriggerlist(trig, station='ZV01'): | ||||
|     ''' | ||||
|     makes a triggerlist with the events, that are triggered by the | ||||
|     coincidence trigger and are seen at the demanded station | ||||
|     :param trig: list containing triggers from coincidence trigger | ||||
|     :type trig: list | ||||
|     :param station: station name to get triggers for (optional, default = ZV01) | ||||
|     :type station: str | ||||
|     :return: list of triggertimes | ||||
|     :rtype: list | ||||
|     ''' | ||||
|     trigg = [] | ||||
|     for tri in trig: | ||||
|         if station in tri['stations']: | ||||
|             trigg.append(tri['time']) | ||||
|     return trigg | ||||
| @ -17,7 +17,6 @@ from pylot.core.pick.charfuns import CharacteristicFunction | ||||
| from pylot.core.pick.charfuns import HOScf, AICcf, ARZcf, ARHcf, AR3Ccf | ||||
| from pylot.core.pick.utils import checksignallength, checkZ4S, earllatepicker, \ | ||||
|     getSNR, fmpicker, checkPonsets, wadaticheck | ||||
| from pylot.core.util.dataprocessing import restitute_data | ||||
| from pylot.core.util.utils import getPatternLine | ||||
| from pylot.core.io.data import Data | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user