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


Python Catalog.comments方法代码示例

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


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

示例1: _deserialize

# 需要导入模块: from obspy.core.event import Catalog [as 别名]
# 或者: from obspy.core.event.Catalog import comments [as 别名]
 def _deserialize(self):
     catalog = Catalog()
     res_id = '/'.join((res_id_prefix,
                        self.filename.replace(':', '/')))\
         .replace('\\', '/').replace('//', '/')
     catalog.resource_id = ResourceIdentifier(id=res_id)
     catalog.description = 'Created from NEIC PDE mchedr format'
     catalog.comments = ''
     catalog.creation_info = CreationInfo(creation_time=UTCDateTime())
     for line in self.fh.readlines():
         # XXX: ugly, probably we should do everything in byte strings
         # here? Is the pde / mchedr format unicode aware?
         line = line.decode()
         record_id = line[0:2]
         if record_id == 'HY':
             event = self._parse_record_hy(line)
             catalog.append(event)
         elif record_id == 'P ':
             pick, arrival = self._parse_record_p(line, event)
         elif record_id == 'E ':
             self._parse_record_e(line, event)
         elif record_id == 'L ':
             self._parse_record_l(line, event)
         elif record_id == 'A ':
             self._parse_record_a(line, event)
         elif record_id == 'C ':
             self._parse_record_c(line, event)
         elif record_id == 'AH':
             self._parse_record_ah(line, event)
         elif record_id == 'AE':
             self._parse_record_ae(line, event)
         elif record_id == 'Dp':
             focal_mechanism = self._parse_record_dp(line, event)
         elif record_id == 'Dt':
             self._parse_record_dt(line, focal_mechanism)
         elif record_id == 'Da':
             self._parse_record_da(line, focal_mechanism)
         elif record_id == 'Dc':
             self._parse_record_dc(line, focal_mechanism)
         elif record_id == 'M ':
             self._parse_record_m(line, event, pick)
         elif record_id == 'S ':
             self._parse_record_s(line, event, pick, arrival)
     self.fh.close()
     # strip extra whitespaces from event comments
     for event in catalog:
         for comment in event.comments:
             comment.text = comment.text.strip()
         event.scope_resource_ids()
     return catalog
开发者ID:Brtle,项目名称:obspy,代码行数:52,代码来源:mchedr.py

示例2: _deserialize

# 需要导入模块: from obspy.core.event import Catalog [as 别名]
# 或者: from obspy.core.event.Catalog import comments [as 别名]
 def _deserialize(self):
     catalog = Catalog()
     res_id = "/".join((res_id_prefix, self.filename))
     catalog.resource_id = ResourceIdentifier(id=res_id)
     catalog.description = "Created from NEIC PDE mchedr format"
     catalog.comments = ""
     catalog.creation_info = CreationInfo(creation_time=UTCDateTime())
     for line in self.fh.readlines():
         # XXX: ugly, probably we should do everything in byte strings
         # here? Is the pde / mchedr format unicode aware?
         line = line.decode()
         record_id = line[0:2]
         if record_id == "HY":
             event = self._parseRecordHY(line)
             catalog.append(event)
         elif record_id == "P ":
             pick, arrival = self._parseRecordP(line, event)
         elif record_id == "E ":
             self._parseRecordE(line, event)
         elif record_id == "L ":
             self._parseRecordL(line, event)
         elif record_id == "A ":
             self._parseRecordA(line, event)
         elif record_id == "C ":
             self._parseRecordC(line, event)
         elif record_id == "AH":
             self._parseRecordAH(line, event)
         elif record_id == "AE":
             self._parseRecordAE(line, event)
         elif record_id == "Dp":
             focal_mechanism = self._parseRecordDp(line, event)
         elif record_id == "Dt":
             self._parseRecordDt(line, focal_mechanism)
         elif record_id == "Da":
             self._parseRecordDa(line, focal_mechanism)
         elif record_id == "Dc":
             self._parseRecordDc(line, focal_mechanism)
         elif record_id == "M ":
             self._parseRecordM(line, event, pick)
         elif record_id == "S ":
             self._parseRecordS(line, event, pick, arrival)
     self.fh.close()
     # strip extra whitespaces from event comments
     for event in catalog:
         for comment in event.comments:
             comment.text = comment.text.strip()
     return catalog
开发者ID:kaeufl,项目名称:obspy,代码行数:49,代码来源:mchedr.py


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