Пример #1
0
    def retrieveVars(self):
        """
        Retrieving all important variables in order to run the revised
        procedure
        """
        try:
            self.log.info('Retrieving all important variables ' + \
                          'in order to run the revised procedure...\n')

            # get depth list
            _text = "The possible centroid depths (in km) are:"
            _f = open(self.dir.log, "r")
            _lines = _f.readlines()
            _f.close()
            for _i, _line in enumerate(_lines):
                if _text in _line:
                    self.depth_list = eval(_lines[_i + 1][:-1])
                    break

            # tl
            _f = open(self.dir.grdat, "r")
            _lines = _f.readlines()
            _f.close()
            self.tl = float(_lines[3][3:-1])

            # time_grid_start, step, end
            _f = open(self.dir.inpinv, "r")
            _lines = _f.readlines()
            _f.close()
            _l = _lines[8][:-1].split()
            self.settings.time_grid_start = int(_l[0])
            self.settings.time_grid_step = int(_l[1])
            self.settings.time_grid_end = int(_l[2])

            # load stations info (coordinates)
            _station_list = []
            _station_list = self.db_scisola.loadStations(_station_list)

            for station in self.station_list:
                for _station in _station_list:
                    if _station.code == station.code:
                        station.latitude = _station.latitude
                        station.longitude = _station.longitude
                        break

            self.station_list = stream.calculateDistAzm(
                self.station_list, self.origin)

        except:
            self.log.info('Error occurred in variables retrieval...\n')
            raise
Пример #2
0
    def retrieveVars(self):
        """
        Retrieving all important variables in order to run the revised
        procedure
        """
        try:
            self.log.info('Retrieving all important variables ' + \
                          'in order to run the revised procedure...\n')

            # get depth list
            _text = "The possible centroid depths (in km) are:"
            _f = open(self.dir.log, "r")
            _lines = _f.readlines()
            _f.close()
            for _i, _line in enumerate(_lines):
                if _text in _line:
                    self.depth_list = eval(_lines[_i+1][:-1])
                    break

            # tl
            _f = open(self.dir.grdat, "r")
            _lines = _f.readlines()
            _f.close()
            self.tl = float(_lines[3][3:-1])

            # time_grid_start, step, end
            _f = open(self.dir.inpinv, "r")
            _lines = _f.readlines()
            _f.close()
            _l = _lines[8][:-1].split()
            self.settings.time_grid_start = int(_l[0])
            self.settings.time_grid_step = int(_l[1])
            self.settings.time_grid_end = int(_l[2])

            # load stations info (coordinates)
            _station_list = []
            _station_list = self.db_scisola.loadStations(_station_list)

            for station in self.station_list:
                for _station in _station_list:
                    if _station.code == station.code:
                        station.latitude = _station.latitude
                        station.longitude = _station.longitude
                        break

            self.station_list = stream.calculateDistAzm(self.station_list,
                                                        self.origin)

        except:
            self.log.info('Error occurred in variables retrieval...\n')
            raise
Пример #3
0
    def calculateDistAzm(self):
        """
        Calculating the distance and the azimuth (from North) between
        qualified stations and epicenter and selects those who are
        at the specific distance range (from distance min to distance max)
        """
        try:
            self.log.info('Calculating distance and azimuth (from North) ' + \
                          'between epicenter and station...\n')

            self.station_list = stream.calculateDistAzm(
                self.station_list, self.origin)

        except:
            self.log.info('Error occurred in distance and azimuth ' + \
                          'calculation...\n')
            raise
Пример #4
0
    def calculateDistAzm(self):
        """
        Calculating the distance and the azimuth (from North) between
        qualified stations and epicenter and selects those who are
        at the specific distance range (from distance min to distance max)
        """
        try:
            self.log.info('Calculating distance and azimuth (from North) ' + \
                          'between epicenter and station...\n')

            self.station_list = stream.calculateDistAzm(self.station_list,
                                                        self.origin)

        except:
            self.log.info('Error occurred in distance and azimuth ' + \
                          'calculation...\n')
            raise