本文整理汇总了Python中shake_event.ShakeEvent.mmiDataToRaster方法的典型用法代码示例。如果您正苦于以下问题:Python ShakeEvent.mmiDataToRaster方法的具体用法?Python ShakeEvent.mmiDataToRaster怎么用?Python ShakeEvent.mmiDataToRaster使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shake_event.ShakeEvent
的用法示例。
在下文中一共展示了ShakeEvent.mmiDataToRaster方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testEventToRaster
# 需要导入模块: from shake_event import ShakeEvent [as 别名]
# 或者: from shake_event.ShakeEvent import mmiDataToRaster [as 别名]
def testEventToRaster(self):
"""Check we can convert the shake event to a raster"""
myShakeId = '20120726022003'
myShakeEvent = ShakeEvent(myShakeId)
myExpectedState = """latitude: -0.21
longitude: 124.45
eventId: 20120726022003
magnitude: 5.0
depth: 11.0
description: None
location: Southern Molucca Sea
day: 26
month: 7
year: 2012
time: None
timeZone: WIB
xMinimum: 122.45
xMaximum: 126.45
yMinimum: -2.21
yMaximum: 1.79
rows: 161.0
columns: 161.0
mmiData: Populated
populationRasterPath: None
impactFile: None
impactKeywordsFile: None
fatalityCounts: None
displacedCounts: None
affectedCounts: None
extentWithCities: Not set
zoomFactor: 1.25
searchBoxes: None
"""
myState = str(myShakeEvent)
myMessage = (('Expected:\n----------------\n%s'
'\n\nGot\n------------------\n%s\n') %
(myExpectedState, myState))
assert myState == myExpectedState, myMessage
myPath = myShakeEvent.mmiDataToRaster(theForceFlag=True)
assert os.path.exists(myPath)
myExpectedQml = myPath.replace('tif', 'qml')
assert os.path.exists(myExpectedQml)
myExpectedKeywords = myPath.replace('tif', 'keywords')
assert os.path.exists(myExpectedKeywords)