本文整理匯總了Python中openquake.hazardlib.geo.point.Point.closer_than方法的典型用法代碼示例。如果您正苦於以下問題:Python Point.closer_than方法的具體用法?Python Point.closer_than怎麽用?Python Point.closer_than使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openquake.hazardlib.geo.point.Point
的用法示例。
在下文中一共展示了Point.closer_than方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: circular_distance_from_point
# 需要導入模塊: from openquake.hazardlib.geo.point import Point [as 別名]
# 或者: from openquake.hazardlib.geo.point.Point import closer_than [as 別名]
def circular_distance_from_point(self, point, distance, **kwargs):
'''
Select earthquakes within a distance from a Point
:param point:
Centre point as instance of nhlib.geo.point.Point class
:param float distance:
Distance (km)
:returns:
Instance of :class:`openquake.hmtk.seismicity.catalogue.Catalogue`
containing only selected events
'''
if kwargs['distance_type'] is 'epicentral':
locations = Mesh(
self.catalogue.data['longitude'],
self.catalogue.data['latitude'],
np.zeros(len(self.catalogue.data['longitude']), dtype=float))
point = Point(point.longitude, point.latitude, 0.0)
else:
locations = self.catalogue.hypocentres_as_mesh()
is_close = point.closer_than(locations, distance)
return self.select_catalogue(is_close)