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)
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
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)
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
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])
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])
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])
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])
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)
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)
def get_bounding_box(self, maxdist): """ Bounding box of the point, enlarged by the maximum distance """ return get_bounding_box([self.location], maxdist)
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)
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)