當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。