示例#1
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box containing all the hypocenters, enlarged by the
     maximum distance
     """
     locations = [rup.hypocenter for rup in self.ruptures]
     return get_bounding_box(locations, maxdist)
示例#2
0
def basemap(projection, sitecol):
    from mpl_toolkits.basemap import Basemap  # costly import
    minlon, minlat, maxlon, maxlat = get_bounding_box(sitecol, maxdist=10)
    bmap = Basemap(projection=projection,
                   llcrnrlon=minlon, llcrnrlat=minlat,
                   urcrnrlon=maxlon, urcrnrlat=maxlat,
                   lat_0=sitecol['lat'].mean(), lon_0=sitecol['lon'].mean())
    bmap.drawcoastlines()
    return bmap
示例#3
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box containing all the hypocenters, enlarged by the
     maximum distance
     """
     locations = []
     for rup in self.ruptures:
         locations.extend(rup.surface.mesh)
     return get_bounding_box(locations, maxdist)
示例#4
0
def basemap(projection, sitecol):
    from mpl_toolkits.basemap import Basemap  # costly import
    minlon, minlat, maxlon, maxlat = get_bounding_box(sitecol, maxdist=10)
    bmap = Basemap(projection=projection,
                   llcrnrlon=minlon, llcrnrlat=minlat,
                   urcrnrlon=maxlon, urcrnrlat=maxlat,
                   lat_0=sitecol['lat'].mean(), lon_0=sitecol['lon'].mean())
    bmap.drawcoastlines()
    return bmap
示例#5
0
    def get_affected_box(self, src):
        """
        Get the enlarged bounding box of a source.

        :param src: a source object
        :returns: a bounding box (min_lon, min_lat, max_lon, max_lat)
        """
        maxdist = self(src.tectonic_region_type)
        bbox = get_bounding_box(src, maxdist)
        return (fix_lon(bbox[0]), bbox[1], fix_lon(bbox[2]), bbox[3])
示例#6
0
    def get_affected_box(self, src):
        """
        Get the enlarged bounding box of a source.

        :param src: a source object
        :returns: a bounding box (min_lon, min_lat, max_lon, max_lat)
        """
        mag = src.get_min_max_mag()[1]
        maxdist = self(src.tectonic_region_type, mag)
        bbox = get_bounding_box(src, maxdist)
        return (fix_lon(bbox[0]), bbox[1], fix_lon(bbox[2]), bbox[3])
示例#7
0
    def get_affected_box(self, src):
        """
        Get the enlarged bounding box of a source.

        :param src: a source object
        :returns: a bounding box (min_lon, min_lat, max_lon, max_lat)
        """
        maxdist = self(src.tectonic_region_type)
        try:
            bbox = get_bounding_box(src, maxdist)
        except Exception as exc:
            raise exc.__class__('source %s: %s' % (src.source_id, exc))
        return (fix_lon(bbox[0]), bbox[1], fix_lon(bbox[2]), bbox[3])
示例#8
0
    def get_enlarged_box(self, src, maxdist=None):
        """
        Get the enlarged bounding box of a source.

        :param src: a source object
        :param maxdist: a scalar maximum distance (or None)
        :returns: a bounding box (min_lon, min_lat, max_lon, max_lat)
        """
        if maxdist is None:
            maxdist = self.integration_distance(src.tectonic_region_type)
        try:
            bbox = get_bounding_box(src, maxdist)
        except Exception as exc:
            raise exc.__class__('source %s: %s' % (src.source_id, exc))
        return (fix_lon(bbox[0]), bbox[1], fix_lon(bbox[2]), bbox[3])
示例#9
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box containing all the point sources, enlarged by the
     maximum distance.
     """
     return utils.get_bounding_box([ps.location for ps in self], maxdist)
示例#10
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box of the point, enlarged by the maximum distance
     """
     radius = self._get_max_rupture_projection_radius()
     return get_bounding_box([self.location], maxdist + radius)
示例#11
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box of the point, enlarged by the maximum distance
     """
     return get_bounding_box([self.location], maxdist)
示例#12
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box of the point, enlarged by the maximum distance
     """
     radius = self._get_max_rupture_projection_radius()
     return get_bounding_box([self.location], maxdist + radius)
示例#13
0
 def get_bounding_box(self, maxdist):
     """
     Bounding box containing all the point sources, enlarged by the
     maximum distance.
     """
     return utils.get_bounding_box([ps.location for ps in self], maxdist)