def get_fault_type_dummy_variables(self, rup):
        """
        Fault-type classification dummy variable based on rup.rake.

        "``H`` is 1 for a strike-slip mechanism and 0 for a reverse mechanism"
        (p. 1201).

        Note:
            UserWarning is raised if mechanism is determined to be normal
            faulting, since as summarized in Table 2 on p. 1197 the data used
            for regression included only reverse and stike-slip events.
        """

        # normal faulting
        is_normal = np.array(
            self.RAKE_THRESH < -rup.rake < (180. - self.RAKE_THRESH))

        # reverse raulting
        is_reverse = np.array(
            self.RAKE_THRESH < rup.rake < (180. - self.RAKE_THRESH))

        if not self.ALREADY_WARNED and is_normal.any():
            # make sure that the warning is printed only once to avoid
            # flooding the terminal
            msg = ('Normal faulting not supported by %s; '
                   'treating as strike-slip' % type(self).__name__)
            warnings.warn(msg, UserWarning)
            self.ALREADY_WARNED = True

        is_strike_slip = ~is_reverse | is_normal
        is_strike_slip = is_strike_slip.astype(float)

        return is_strike_slip
def get_fault_type_dummy_variables ( self , rup ) : is_normal = np . array ( self . RAKE_THRESH < - rup . rake < ( 180. - self . RAKE_THRESH ) ) is_reverse = np . array ( self . RAKE_THRESH < rup . rake < ( 180. - self . RAKE_THRESH ) ) if not self . ALREADY_WARNED and is_normal . any ( ) : msg = ( 'Normal faulting not supported by %s; ' 'treating as strike-slip' % type ( self ) . __name__ ) warnings . warn ( msg , UserWarning ) self . ALREADY_WARNED = True is_strike_slip = ~ is_reverse | is_normal is_strike_slip = is_strike_slip . astype ( float ) return is_strike_slip
Fault-type classification dummy variable based on rup.rake.

        "``H`` is 1 for a strike-slip mechanism and 0 for a reverse mechanism"
        (p. 1201).

        Note:
            UserWarning is raised if mechanism is determined to be normal
            faulting, since as summarized in Table 2 on p. 1197 the data used
            for regression included only reverse and stike-slip events.