Exemplo n.º 1
0
    def __init__(self):
        super(NoiseFrame, self).__init__()
        self.setupUi(self)

        self.setWindowTitle('Seismic Ambient Noise')
        self.setWindowIcon(pqg.QIcon(':\icons\map-icon.png'))

        # Settings dialog
        self.settings_dialog = SettingsDialogNoise(self)

        # Parameters settings
        self.parameters = ParametersSettings()

        # Create tabs and add them to tabWidget
        # TODO: sharing parameters and settings this way. Should they be shared?
        # Or they are only specific to EGFFrame?
        self.egf_frame = EGFFrame(self.parameters, self.settings_dialog)
        self.ft_frame = FrequencyTimeFrame()
        self.tabWidget.addTab(self.egf_frame, 'EGFs')
        self.tabWidget.addTab(self.ft_frame, 'Frequency Time Analysis')

        # Help Documentation
        self.help = HelpDoc()

        # Actions
        self.actionSet_Parameters.triggered.connect(
            self.open_parameters_settings)
        self.actionOpen_Settings.triggered.connect(self.settings_dialog.show)

        # Shortcuts
        self.shortcut_open = pw.QShortcut(pqg.QKeySequence('Ctrl+L'), self)
        self.shortcut_open.activated.connect(self.open_parameters_settings)
Exemplo n.º 2
0
    def __init__(self):

        super(TimeFrequencyFrame, self).__init__()
        self.setupUi(self)
        self.__stations_dir = None
        self.__metadata_manager = None
        self.inventory = {}
        self._stations_info = {}
        self.tr1 = []
        self.tr2 = []
        self.canvas_plot1 = MatplotlibCanvas(self.widget_plot_up, nrows=2)
        # self.canvas_plot1.set_xlabel(1, "Time (s)")
        # self.canvas_plot1.set_ylabel(0, "Amplitude ")
        # self.canvas_plot1.set_ylabel(1, "Frequency (Hz)")
        self.canvas_plot2 = MatplotlibCanvas(self.widget_plot_down, nrows=2)
        # self.canvas_plot2.set_xlabel(1, "Time (s)")
        # self.canvas_plot2.set_ylabel(0, "Amplitude ")
        # self.canvas_plot2.set_ylabel(1, "Frequency (Hz)")
        # Binding
        self.canvas_plot1.mpl_connect('key_press_event', self.key_pressed)
        self.canvas_plot2.mpl_connect('key_press_event', self.key_pressed)
        self.root_path_bind = BindPyqtObject(self.rootPathForm,
                                             self.onChange_root_path)
        self.dataless_path_bind = BindPyqtObject(self.datalessPathForm)
        self.metadata_path_bind = BindPyqtObject(self.datalessPathForm,
                                                 self.onChange_metadata_path)
        # Add file selector to the widget
        self.file_selector = FilesView(
            self.root_path_bind.value,
            parent=self.fileSelectorWidget,
            on_change_file_callback=lambda file_path: self.onChange_file(
                file_path))
        # Binds
        self.selectDirBtn.clicked.connect(
            lambda: self.on_click_select_directory(self.root_path_bind))
        self.datalessBtn.clicked.connect(
            lambda: self.on_click_select_file(self.dataless_path_bind))
        # Action Buttons
        self.actionSettings.triggered.connect(
            lambda: self.open_parameters_settings())
        self.actionOpen_Help.triggered.connect(lambda: self.open_help())
        self.actionOpen_Spectral_Analysis.triggered.connect(
            self.time_frequency_advance)
        self.plotBtn.clicked.connect(self.plot_seismogram)
        self.stationsBtn.clicked.connect(self.stations_info)

        # help Documentation
        self.help = HelpDoc()

        # Parameters settings
        self.parameters = ParametersSettings()
Exemplo n.º 3
0
    def __init__(self):
        super(MTIFrame, self).__init__()
        self.setupUi(self)

        #super(MTIFrame, self).__init__()
        self.setupUi(self)
        self.__stations_dir = None
        self.__metadata_manager = None
        self.inventory = {}
        self._stations_info = {}
        self.stream = None
        # Binding
        self.root_path_bind = BindPyqtObject(self.rootPathForm)
        #self.dataless_path_bind = BindPyqtObject(self.datalessPathForm)
        self.metadata_path_bind = BindPyqtObject(self.datalessPathForm,
                                                 self.onChange_metadata_path)
        self.earth_path_bind = BindPyqtObject(self.earth_modelPathForm)

        # Binds
        self.selectDirBtn.clicked.connect(
            lambda: self.on_click_select_directory(self.root_path_bind))
        self.datalessBtn.clicked.connect(
            lambda: self.on_click_select_metadata_file(self.metadata_path_bind
                                                       ))
        self.earthmodelBtn.clicked.connect(
            lambda: self.on_click_select_file(self.earth_path_bind))

        # Action Buttons
        self.actionSettings.triggered.connect(
            lambda: self.open_parameters_settings())
        self.plotBtn.clicked.connect(self.plot_seismograms)
        self.actionSettings.triggered.connect(
            lambda: self.open_parameters_settings())
        self.actionWrite.triggered.connect(self.write)
        self.actionEarth_Model.triggered.connect(
            lambda: self.open_earth_model())
        self.actionFrom_File.triggered.connect(
            lambda: self.load_event_from_isolapath())
        self.actionOpen_Help.triggered.connect(lambda: self.open_help())
        self.stationsBtn.clicked.connect(self.stationsInfo)
        self.run_inversionBtn.clicked.connect(lambda: self.run_inversion())
        self.stations_mapBtn.clicked.connect(lambda: self.plot_map_stations())
        self.plot_solutionBtn.clicked.connect(lambda: self.plot_solution())
        #self.earthmodelBtn.clicked.connect(self.read_earth_model)
        # Parameters settings
        self.parameters = ParametersSettings()
        self.earth_model = CrustalModelParametersFrame()
        # help Documentation

        self.help = HelpDoc()
Exemplo n.º 4
0
 def __init__(self):
     self.main_frame = None
     self.time_frequency_frame = None
     self.earthquake_analysis_frame = None
     self.array_analysis_frame = None
     self.moment_tensor_frame = None
     self.receiver_functions_frame = None
     self.project_frame = None
     self.synthetics_frame = None
     self.data_download_frame = None
     self.ppds_frame = None
     self.realtime_frame = None
     self.noise_frame = None
     self.help = HelpDoc()
Exemplo n.º 5
0
    def __init__(self):
        super(BaseFrame, self).__init__()
        self.setupUi(self)
        self.inventory = {}
        self.network_list = []
        self.stations_list = []
        self.catalogBtn.clicked.connect(self.get_catalog)
        self.event_dataBtn.clicked.connect(self.download_events)
        self.plotstationsBtn.clicked.connect(self.stations)
        self.TimeBtn.clicked.connect(self.download_time_series)
        self.MetadataBtn.clicked.connect(self.download_stations_xml)
        self.LoadBtn.clicked.connect(self.load_inventory)
        # Map
        self.cartopy_canvas = CartopyCanvas(self.map)
        self.cartopy_canvas.global_map(0)
        self.cartopy_canvas.figure.subplots_adjust(left=0.00,
                                                   bottom=0.055,
                                                   right=0.97,
                                                   top=0.920,
                                                   wspace=0.0,
                                                   hspace=0.0)
        self.activated_colorbar = True
        self.cartopy_canvas.on_double_click(self.on_click_matplotlib)
        self.cartopy_canvas.mpl_connect('key_press_event', self.key_pressed)
        self.cartopy_canvas.mpl_connect('button_press_event', self.press_right)
        self.actionOpen_Help.triggered.connect(lambda: self.open_help())
        # signal doubleclick
        self.tableWidget.cellDoubleClicked.connect(self.get_coordinates)

        # help Documentation

        self.help = HelpDoc()

        #
        self.latitudes = []
        self.longitudes = []
        self.depths = []
        self.magnitudes = []
Exemplo n.º 6
0
    def __init__(self):
        super(RealTimeFrame, self).__init__()
        self.setupUi(self)
        self.setWindowIcon(pqg.QIcon(':\\icons\\map-icon.png'))
        self.widget_map = None
        self.settings_dialog = SettingsDialog(self)
        self.inventory = {}
        self.files = []
        self.events_times = []
        self.total_items = 0
        self.items_per_page = 1
        self.__dataless_manager = None
        self.__metadata_manager = None
        self.st = None
        self.client = None
        self.stations_available = []
        self.data_dict = {}
        self.dataless_not_found = set(
        )  # a set of mseed files that the dataless couldn't find.
        self.metadata_path_bind = BindPyqtObject(self.datalessPathForm,
                                                 self.onChange_metadata_path)
        self.canvas = MatplotlibCanvas(self.plotMatWidget,
                                       nrows=self.numTracesCB.value(),
                                       constrained_layout=False)
        self.canvas.figure.tight_layout()
        self.timer_outdated = pyc.QTimer()
        self.timer_outdated.setInterval(1000)  # 1 second
        self.timer_outdated.timeout.connect(self.outdated_stations)

        # Binding
        self.root_path_bind = BindPyqtObject(self.rootPathForm)
        self.dataless_path_bind = BindPyqtObject(self.datalessPathForm)

        # Bind

        self.selectDirBtn.clicked.connect(
            lambda: self.on_click_select_directory(self.root_path_bind))

        #self.selectDatalessDirBtn.clicked.connect(lambda: self.on_click_select_directory(self.dataless_path_bind))

        self.metadata_path_bind = BindPyqtObject(self.datalessPathForm,
                                                 self.onChange_metadata_path)
        self.selectDatalessDirBtn.clicked.connect(
            lambda: self.on_click_select_metadata_file(self.metadata_path_bind
                                                       ))

        self.actionSet_Parameters.triggered.connect(
            lambda: self.open_parameters_settings())
        self.mapBtn.clicked.connect(self.show_map)
        # self.__metadata_manager = MetadataManager(self.dataless_path_bind.value)
        self.actionSet_Parameters.triggered.connect(
            lambda: self.open_parameters_settings())
        self.actionArray_Anlysis.triggered.connect(self.open_array_analysis)
        self.actionMoment_Tensor_Inversion.triggered.connect(
            self.open_moment_tensor)
        self.actionTime_Frequency_Analysis.triggered.connect(
            self.time_frequency_analysis)
        self.actionReceiver_Functions.triggered.connect(
            self.open_receiver_functions)
        self.actionOpen_Settings.triggered.connect(
            lambda: self.settings_dialog.show())
        self.actionOpen_Help.triggered.connect(lambda: self.open_help())
        self.RetrieveBtn.clicked.connect(self.retrieve_data)
        self.stopBtn.clicked.connect(self.stop)
        # Parameters settings
        self.parameters = ParametersSettings()
        # Earth Model Viewer
        self.earthmodel = EarthModelViewer()
        # help Documentation
        self.help = HelpDoc()
Exemplo n.º 7
0
    def __init__(self):
        super(ArrayAnalysisFrame, self).__init__()
        self.setupUi(self)
        self.__stations_dir = None
        self.stream_frame = None
        self.__metadata_manager = None
        self.inventory = {}
        self._stations_info = {}
        self._stations_coords = {}
        self.stack = None
        self.canvas = MatplotlibCanvas(self.responseMatWidget)
        self.canvas_fk = MatplotlibCanvas(self.widget_fk, nrows=4)
        self.canvas_slow_map = MatplotlibCanvas(self.widget_slow_map)
        self.canvas_fk.on_double_click(self.on_click_matplotlib)
        self.canvas_stack = MatplotlibCanvas(self.widget_stack)
        self.cartopy_canvas = CartopyCanvas(self.widget_map)
        self.canvas.set_new_subplot(1, ncols=1)

        #Binding
        self.root_pathFK_bind = BindPyqtObject(self.rootPathFormFK)
        self.root_pathBP_bind = BindPyqtObject(self.rootPathFormBP)
        self.metadata_path_bind = BindPyqtObject(self.datalessPathForm,
                                                 self.onChange_metadata_path)
        self.metadata_path_bindBP = BindPyqtObject(self.datalessPathFormBP,
                                                   self.onChange_metadata_path)
        self.output_path_bindBP = BindPyqtObject(self.outputPathFormBP,
                                                 self.onChange_metadata_path)
        self.fmin_bind = BindPyqtObject(self.fminSB)
        self.fmax_bind = BindPyqtObject(self.fmaxSB)
        self.grid_bind = BindPyqtObject(self.gridSB)
        self.smax_bind = BindPyqtObject(self.smaxSB)

        # On select
        self.canvas_fk.register_on_select(self.on_select,
                                          rectprops=dict(alpha=0.2,
                                                         facecolor='red'))
        self.fminFK_bind = BindPyqtObject(self.fminFKSB)
        self.fmaxFK_bind = BindPyqtObject(self.fmaxFKSB)
        self.overlap_bind = BindPyqtObject(self.overlapSB)
        self.timewindow_bind = BindPyqtObject(self.timewindowSB)
        self.smaxFK_bind = BindPyqtObject(self.slowFKSB)
        self.slow_grid_bind = BindPyqtObject(self.gridFKSB)

        # Bind buttons
        self.selectDirBtnFK.clicked.connect(
            lambda: self.on_click_select_directory(self.root_pathFK_bind))
        self.datalessBtn.clicked.connect(
            lambda: self.on_click_select_metadata_file(self.metadata_path_bind
                                                       ))

        # Bind buttons BackProjection
        self.selectDirBtnBP.clicked.connect(
            lambda: self.on_click_select_directory(self.root_pathBP_bind))
        self.datalessBtnBP.clicked.connect(
            lambda: self.on_click_select_metadata_file(self.
                                                       metadata_path_bindBP))
        self.outputBtn.clicked.connect(
            lambda: self.on_click_select_directory(self.output_path_bindBP))

        #Action Buttons
        self.arfBtn.clicked.connect(lambda: self.arf())
        self.runFKBtn.clicked.connect(lambda: self.FK_plot())
        self.plotBtn.clicked.connect(lambda: self.plot_seismograms())
        self.plotBtnBP.clicked.connect(lambda: self.plot_seismograms(FK=False))
        self.actionSettings.triggered.connect(
            lambda: self.open_parameters_settings())
        self.actionProcessed_Seimograms.triggered.connect(self.write)
        self.actionStacked_Seismograms.triggered.connect(self.write_stack)
        self.stationsBtn.clicked.connect(lambda: self.stationsInfo())
        self.stationsBtnBP.clicked.connect(lambda: self.stationsInfo(FK=False))
        self.mapBtn.clicked.connect(self.stations_map)
        self.actionCreate_Stations_File.triggered.connect(
            self.stations_coordinates)
        self.actionLoad_Stations_File.triggered.connect(self.load_path)
        self.actionRunVespagram.triggered.connect(self.open_vespagram)
        self.shortcut_open = pw.QShortcut(pqg.QKeySequence('Ctrl+O'), self)
        self.shortcut_open.activated.connect(self.open_solutions)
        self.create_gridBtn.clicked.connect(self.create_grid)
        self.actionOpen_Help.triggered.connect(lambda: self.open_help())
        self.load_videoBtn.clicked.connect(self.loadvideoBP)

        # help Documentation
        self.help = HelpDoc()

        # Parameters settings
        self.__parameters = ParametersSettings()

        # Stations Coordinates
        self.__stations_coords = StationsCoords()

        # picks
        self.picks = {
            'Time': [],
            'Phase': [],
            'BackAzimuth': [],
            'Slowness': [],
            'Power': []
        }

        # video
        self.player = QMediaPlayer(None, QMediaPlayer.VideoSurface)
        self.player.setVideoOutput(self.backprojection_widget)
        self.player.stateChanged.connect(self.mediaStateChanged)
        self.player.positionChanged.connect(self.positionChanged)
        self.player.durationChanged.connect(self.durationChanged)
        self.playButton.setIcon(self.style().standardIcon(QStyle.SP_MediaPlay))
        self.playButton.clicked.connect(self.play_bp)
        self.positionSlider.sliderMoved.connect(self.setPosition)