本文整理汇总了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)