Exemplo n.º 1
0
 def stationsInfo(self, FK=True):
     if FK:
         obsfiles = MseedUtil.get_mseed_files(self.root_pathFK_bind.value)
     else:
         obsfiles = MseedUtil.get_mseed_files(self.root_pathBP_bind.value)
     obsfiles.sort()
     sd = []
     for file in obsfiles:
         st = SeismogramDataAdvanced(file)
         station = [
             st.stats.Network, st.stats.Station, st.stats.Location,
             st.stats.Channel, st.stats.StartTime, st.stats.EndTime,
             st.stats.Sampling_rate, st.stats.Npts
         ]
         sd.append(station)
     self._stations_info = StationsInfo(sd, check=True)
     self._stations_info.show()
Exemplo n.º 2
0
    def plot_map_stations(self):
        md = MessageDialog(self)
        md.hide()
        try:
            stations = []
            obsfiles = MseedUtil.get_mseed_files(self.root_path_bind.value)
            obsfiles.sort()
            try:
                if len(self.stream) > 0:
                    stations = ObspyUtil.get_stations_from_stream(self.stream)
            except:
                pass

            map_dict = {}
            sd = []

            for file in obsfiles:
                if len(stations) == 0:
                    st = SeismogramDataAdvanced(file)

                    name = st.stats.Network + "." + st.stats.Station

                    sd.append(name)

                    st_coordinates = self.__metadata_manager.extract_coordinates(
                        self.inventory, file)

                    map_dict[name] = [
                        st_coordinates.Latitude, st_coordinates.Longitude
                    ]
                else:
                    st = SeismogramDataAdvanced(file)
                    if st.stats.Station in stations:
                        name = st.stats.Network + "." + st.stats.Station

                        sd.append(name)

                        st_coordinates = self.__metadata_manager.extract_coordinates(
                            self.inventory, file)

                        map_dict[name] = [
                            st_coordinates.Latitude, st_coordinates.Longitude
                        ]
                    else:
                        pass

            self.map_stations = StationsMap(map_dict)
            self.map_stations.plot_stations_map(latitude=self.latDB.value(),
                                                longitude=self.lonDB.value())

            md.set_info_message("Station Map OK !!! ")
        except:
            md.set_error_message(
                " Please check you have process and plot seismograms and opened stations info,"
                "Please additionally check that your metada fits with your mseed files"
            )

        md.show()
Exemplo n.º 3
0
    def plot_seismograms(self):
        parameters = self.get_inversion_parameters()
        lat = float(parameters['latitude'])
        lon = float(parameters['longitude'])
        starttime = convert_qdatetime_utcdatetime(self.starttime_date)
        endtime = convert_qdatetime_utcdatetime(self.endtime_date)
        diff = endtime - starttime

        parameters = self.parameters.getParameters()
        all_traces = []
        obsfiles = MseedUtil.get_mseed_files(self.root_path_bind.value)
        obsfiles.sort()

        for file in obsfiles:
            sd = SeismogramDataAdvanced(file)
            if self.trimCB.isChecked() and diff >= 0:
                tr = sd.get_waveform_advanced(
                    parameters,
                    self.inventory,
                    filter_error_callback=self.filter_error_message,
                    start_time=starttime,
                    end_time=endtime)
            else:
                tr = sd.get_waveform_advanced(
                    parameters,
                    self.inventory,
                    filter_error_callback=self.filter_error_message)

            all_traces.append(tr)

        self.st = Stream(traces=all_traces)
        self.stream_frame = MatplotlibFrame(self.st, type='normal')
        self.stream_frame.show()

        if self.st:
            min_dist = self.min_distCB.value()
            max_dist = self.max_distCB.value()
            mt = MTIManager(self.st, self.inventory, lat, lon, min_dist,
                            max_dist)
            [self.stream, self.deltas,
             self.stations_isola_path] = mt.get_stations_index()