当前位置: 首页>>代码示例>>Python>>正文


Python ShakeData.extract方法代码示例

本文整理汇总了Python中realtime.shake_data.ShakeData.extract方法的典型用法代码示例。如果您正苦于以下问题:Python ShakeData.extract方法的具体用法?Python ShakeData.extract怎么用?Python ShakeData.extract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在realtime.shake_data.ShakeData的用法示例。


在下文中一共展示了ShakeData.extract方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_extract

# 需要导入模块: from realtime.shake_data import ShakeData [as 别名]
# 或者: from realtime.shake_data.ShakeData import extract [as 别名]
    def test_extract(self):
        """Test extracting data to be used in earth quake realtime."""
        local_path = os.path.join(temp_dir('realtime-test'), 'shakemaps')
        shake_data = ShakeData(working_dir=local_path)

        shake_data.extract()
        final_grid_xml_file = os.path.join(
            shake_data.extract_dir(), 'grid.xml')
        self.assertTrue(
            os.path.exists(final_grid_xml_file), 'grid.xml not found')
开发者ID:Charlotte-Morgan,项目名称:inasafe,代码行数:12,代码来源:test_shake_data.py

示例2: test_extract_shake_map

# 需要导入模块: from realtime.shake_data import ShakeData [as 别名]
# 或者: from realtime.shake_data.ShakeData import extract [as 别名]
    def test_extract_shake_map(self):
        """Test that we can extract the shakemap inp and out files."""
        shake_data = ShakeData(SHAKE_ID)
        grid_xml = shake_data.extract(force_flag=True)

        extract_dir = shakemap_extract_dir()

        expected_grid_xml = os.path.join(
            extract_dir, '20120726022003/grid.xml')
        message = 'Expected: %s\nGot: %s\n' % (
            str(expected_grid_xml), str(grid_xml))
        self.assertEqual(expected_grid_xml, grid_xml, message)
        self.assertTrue(os.path.exists(grid_xml))
开发者ID:SamudraYe,项目名称:inasafe,代码行数:15,代码来源:test_shake_data.py

示例3: testExtractShakeMap

# 需要导入模块: from realtime.shake_data import ShakeData [as 别名]
# 或者: from realtime.shake_data.ShakeData import extract [as 别名]
    def testExtractShakeMap(self):
        """Test that we can extract the shakemap inp and out files"""
        myShakeEvent = '20120726022003'
        myShakeData = ShakeData(myShakeEvent)
        myGridXml = myShakeData.extract(theForceFlag=True)

        myExtractDir = shakemapExtractDir()

        myExpectedGridXml = (os.path.join(myExtractDir,
                           '20120726022003/grid.xml'))
        myMessage = 'Expected: %s\nGot: %s\n' % (myExpectedGridXml, myGridXml)
        assert myExpectedGridXml in myExpectedGridXml, myMessage
        assert os.path.exists(myGridXml)
开发者ID:dichapabe,项目名称:inasafe,代码行数:15,代码来源:test_shake_data.py

示例4: test_extract_shake_map

# 需要导入模块: from realtime.shake_data import ShakeData [as 别名]
# 或者: from realtime.shake_data.ShakeData import extract [as 别名]
    def test_extract_shake_map(self):
        """Test that we can extract the shakemap inp and out files"""
        shake_event = '20120726022003'
        shake_data = ShakeData(shake_event)
        grid_xml = shake_data.extract(force_flag=True)

        extract_dir = shakemap_extract_dir()

        expected_grid_xml = (os.path.join(extract_dir,
                                          '20120726022003/grid.xml'))
        message = 'Expected: %s\nGot: %s\n' % (expected_grid_xml, grid_xml)
        assert expected_grid_xml in expected_grid_xml, message
        assert os.path.exists(grid_xml)
开发者ID:opengeogroep,项目名称:inasafe,代码行数:15,代码来源:test_shake_data.py


注:本文中的realtime.shake_data.ShakeData.extract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。