Example #1
0
 def calculate_hash_focalmech(self):
     """
     Run the actual focal mech calculation, and find the probable mech
     """
     # determine maximum acceptable number misfit polarities
     nmismax = max(int(self.npol * self.badfrac),2)        # nint
     nextra  = max(int(self.npol * self.badfrac * 0.5),2)  # nint
     
     # find the set of acceptable focal mechanisms for all trials
     self.nf2, self.strike2, self.dip2, self.rake2, self.f1norm, self.f2norm = focalmc(self.p_azi_mc, self.p_the_mc, self.p_pol[:self.npol], self.p_qual[:self.npol], self.nmc, self.dang2, self.nmax0, nextra, nmismax, self.npol)
     self.nout2 = min(self.nmax0, self.nf2)  # number mechs returned from sub
     self.nout1 = min(self.maxout, self.nf2) # number mechs to return
     
     # find the probable mechanism from the set of acceptable solutions
     self.nmult, self.str_avg, self.dip_avg, self.rak_avg, self.prob, self.var_est = mech_prob(self.f1norm[:,:self.nout2], self.f2norm[:,:self.nout2], self.cangle, self.prob_max, self.nout2) # nout2
Example #2
0
    def calculate_hash_focalmech(self):
        """
        Run the actual focal mech calculation, and find the probable mech
        """
        # determine maximum acceptable number misfit polarities
        nmismax = max(int(self.npol * self.badfrac), 2)  # nint
        nextra = max(int(self.npol * self.badfrac * 0.5), 2)  # nint

        # find the set of acceptable focal mechanisms for all trials
        self.nf2, self.strike2, self.dip2, self.rake2, self.f1norm, self.f2norm = focalmc(
            self.p_azi_mc, self.p_the_mc, self.p_pol[:self.npol],
            self.p_qual[:self.npol], self.nmc, self.dang2, self.nmax0, nextra,
            nmismax, self.npol)
        self.nout2 = min(self.nmax0,
                         self.nf2)  # number mechs returned from sub
        self.nout1 = min(self.maxout, self.nf2)  # number mechs to return

        # find the probable mechanism from the set of acceptable solutions
        self.nmult, self.str_avg, self.dip_avg, self.rak_avg, self.prob, self.var_est = mech_prob(
            self.f1norm[:, :self.nout2], self.f2norm[:, :self.nout2],
            self.cangle, self.prob_max, self.nout2)  # nout2
Example #3
0
    def calculate_hash_focalmech(self, use_amplitudes=False):
        """
        Run the actual focal mech calculation, and find the probable mech

        use_amplitudes : bool of whether to use the 'focalamp_mc' routine
        """
        if use_amplitudes:
            # determine maximum acceptable number misfit polarities
            nmismax = max(int(self.nppl * self.badfrac), 2)  # nint
            nextra = max(int(self.nppl * self.badfrac * 0.5), 2)  # nint
            qmismax = max(int(self.nspr * self.qbadfrac), 2)  # nint
            qextra = max(int(self.nspr * self.qbadfrac * 0.5), 2)  # nint
            # find the set of acceptable focal mechanisms for all trials
            self.nf2, self.strike2, self.dip2, self.rake2, self.f1norm, self.f2norm = focalamp_mc(
                self.p_azi_mc, self.p_the_mc, self.sp_ratio[:self.npol],
                self.p_pol[:self.npol], self.nmc, self.dang2, self.nmax0,
                nextra, nmismax, self.qextra, self.qmismax, self.npol)
        else:
            # determine maximum acceptable number misfit polarities
            nmismax = max(int(self.npol * self.badfrac), 2)  # nint
            nextra = max(int(self.npol * self.badfrac * 0.5), 2)  # nint

            # find the set of acceptable focal mechanisms for all trials
            self.nf2, self.strike2, self.dip2, self.rake2, self.f1norm, self.f2norm = focalmc(
                self.p_azi_mc, self.p_the_mc, self.p_pol[:self.npol],
                self.p_qual[:self.npol], self.nmc, self.dang2, self.nmax0,
                nextra, nmismax, self.npol)

        self.nout2 = min(self.nmax0,
                         self.nf2)  # number mechs returned from sub
        self.nout1 = min(self.maxout, self.nf2)  # number mechs to return

        # find the probable mechanism from the set of acceptable solutions
        self.nmult, self.str_avg, self.dip_avg, self.rak_avg, self.prob, self.var_est = mech_prob(
            self.f1norm[:, :self.nout2], self.f2norm[:, :self.nout2],
            self.cangle, self.prob_max, self.nout2)  # nout2