def _get_point_rates(self, source, mmin, mmax=np.inf):
        """
        Adds the rates for a point source

        :param source:
            Point source as instance of :class:
            openquake.hazardlib.source.point.PointSource
        :param float mmin:
            Minimum Magnitude
        :param float mmax:
            Maximum Magnitude
        """
        xloc, yloc = self._get_point_location(source.location)
        if (xloc is None) or (yloc is None):
            return
        # Get annual rates
        annual_rate = source.get_annual_occurrence_rates()
        mags = np.array([val[0] for val in annual_rate])
        annual_rate = np.array([val[1] for val in annual_rate])
        idx = np.logical_and(mags >= mmin, mags < mmax)
        annual_rate = np.sum(annual_rate[idx])
        for hypo_depth in source.hypocenter_distribution.data:
            zloc = int((hypo_depth[1] - self.zlim[0]) / self.zspc)
            if (zloc < 0) or (zloc >= (self.nz - 1)):
                continue
            else:
                self.rates[xloc, yloc, zloc] += float(hypo_depth[0]) * \
                    annual_rate
def _get_point_rates ( self , source , mmin , mmax = np . inf ) : xloc , yloc = self . _get_point_location ( source . location ) if ( xloc is None ) or ( yloc is None ) : return annual_rate = source . get_annual_occurrence_rates ( ) mags = np . array ( [ val [ 0 ] for val in annual_rate ] ) annual_rate = np . array ( [ val [ 1 ] for val in annual_rate ] ) idx = np . logical_and ( mags >= mmin , mags < mmax ) annual_rate = np . sum ( annual_rate [ idx ] ) for hypo_depth in source . hypocenter_distribution . data : zloc = int ( ( hypo_depth [ 1 ] - self . zlim [ 0 ] ) / self . zspc ) if ( zloc < 0 ) or ( zloc >= ( self . nz - 1 ) ) : continue else : self . rates [ xloc , yloc , zloc ] += float ( hypo_depth [ 0 ] ) * annual_rate
Adds the rates for a point source

        :param source:
            Point source as instance of :class:
            openquake.hazardlib.source.point.PointSource
        :param float mmin:
            Minimum Magnitude
        :param float mmax:
            Maximum Magnitude