def global_wa_hyp(M, lat_hyp, lon_hyp, depth_hyp, lat_sta, lon_sta): """ Computed intensity prediction equation according to Wald & Allan, 2012 Parameters: M magnitude lat_hyp, lon_hyp, depth_hyp: coordinates of the hypocenter (latitude, longitude, depth, respectively) lat_sta, lon_sta: coordinates of the station (latitude and longitude, respectively) Returns: a number """ #defining constants: c0 = 2.085 c1 = 1.428 c2 = -1.402 c4 = 0.078 m1 = -0.209 m2 = 2.042 R_hyp = _threed_dist(lat_hyp, lon_hyp, depth_hyp, lat_sta, lon_sta, 0) R_M = m1 + m2 * exp(M - 5) I = c0 + c1 * M + c2 * log(sqrt(R_hyp**2 + R_M**2)) if R_hyp > 50: I = I + c4 * log(R_hyp / 50) return I
def global_wa_hyp(M, lat_hyp, lon_hyp, depth_hyp, lat_sta, lon_sta): """ Computed intensity prediction equation according to Wald & Allan, 2012 Parameters: M magnitude lat_hyp, lon_hyp, depth_hyp: coordinates of the hypocenter (latitude, longitude, depth, respectively) lat_sta, lon_sta: coordinates of the station (latitude and longitude, respectively) Returns: a number """ #defining constants: c0 = 2.085 c1 = 1.428 c2 = -1.402 c4 = 0.078 m1 = -0.209 m2 = 2.042 R_hyp = _threed_dist(lat_hyp, lon_hyp, depth_hyp, lat_sta, lon_sta, 0) R_M = m1 + m2 * exp(M-5) I = c0 + c1 * M + c2 * log(sqrt(R_hyp ** 2 + R_M ** 2)); if R_hyp > 50: I = I + c4 * log(R_hyp/50) return I
def calculate(self, distance): c0, c1, c2, c4, m1, m2 = self.__constants M = self.m #magnitude R_M = m1 + m2 * exp(M - 5) I = c0 + c1 * M + c2 * log(sqrt(distance**2 + R_M**2)) if distance > 50: I = I + c4 * log(distance / 50) return I
def __call__(self, lat, lon): if not hasattr(self, "_rld"): self._rld, self._rw = rld_rw(self.sof)(self.m) c0, c1, c2, c3 = self.__constants r_rup = rup_distance(lat, lon, self.lat, self.lon, self.depth, self.strike, self.dip, self._rld, self._rw) return c0 + c1 * self.m + c2 * log (sqrt( r_rup ** 2 + (1 + c3 * exp(self.m -5)) **2 ))
def __call__(self, lat, lon): #TO BE IMPLEMENTED #getting constants: c0, c1 , c2 , c4, m1, m2 = self.__constants #R_hyp = _threed_dist(self.lat, self.lon, self.depth, lat, lon, 0) chord = chorddistance(self.lat, self.lon, lat, lon) R_hyp = sqrt(self.depth**2 + chord**2) M = self.m #magnitude R_M = m1 + m2 * exp(M-5) I = c0 + c1 * M + c2 * log(sqrt(R_hyp ** 2 + R_M ** 2)); if R_hyp > 50: I = I + c4 * log(R_hyp/50) return I
def calculate(self, distance): c0, c1, c2, c3 = self.__constants I = c0 + c1 * self.m + c2 * log( sqrt(distance**2 + (1 + c3 * exp(self.m - 5))**2)) return I