示例#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
文件: process.py 项目: nikosT/scisola
    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
文件: process.py 项目: nikosT/scisola
    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