本文整理匯總了Python中pyasdf.ASDFDataSet.get_all_coordinates方法的典型用法代碼示例。如果您正苦於以下問題:Python ASDFDataSet.get_all_coordinates方法的具體用法?Python ASDFDataSet.get_all_coordinates怎麽用?Python ASDFDataSet.get_all_coordinates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyasdf.ASDFDataSet
的用法示例。
在下文中一共展示了ASDFDataSet.get_all_coordinates方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_coordinate_extraction_but_no_stationxml
# 需要導入模塊: from pyasdf import ASDFDataSet [as 別名]
# 或者: from pyasdf.ASDFDataSet import get_all_coordinates [as 別名]
def test_coordinate_extraction_but_no_stationxml(tmpdir):
"""
Tests what happens if no stationxml is defined for a station.
"""
asdf_filename = os.path.join(tmpdir.strpath, "test.h5")
data_path = os.path.join(data_dir, "small_sample_data_set")
data_set = ASDFDataSet(asdf_filename)
for filename in glob.glob(os.path.join(data_path, "*.mseed")):
data_set.add_waveforms(filename, tag="raw_recording")
# If not stationxml exists it should just return an empty dictionary.
assert data_set.get_all_coordinates() == {}
示例2: test_extract_all_coordinates
# 需要導入模塊: from pyasdf import ASDFDataSet [as 別名]
# 或者: from pyasdf.ASDFDataSet import get_all_coordinates [as 別名]
def test_extract_all_coordinates(example_data_set):
"""
Tests the extraction of all coordinates.
"""
data_set = ASDFDataSet(example_data_set.filename)
assert data_set.get_all_coordinates() == {
"AE.113A": {
"latitude": 32.7683,
"longitude": -113.7667,
"elevation_in_m": 118.0},
"TA.POKR": {
"latitude": 65.1171,
"longitude": -147.4335,
"elevation_in_m": 501.0}}