本文整理汇总了Python中sunpy.util.scraper.Scraper.matches方法的典型用法代码示例。如果您正苦于以下问题:Python Scraper.matches方法的具体用法?Python Scraper.matches怎么用?Python Scraper.matches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sunpy.util.scraper.Scraper
的用法示例。
在下文中一共展示了Scraper.matches方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testDirectoryObsPattern
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import matches [as 别名]
def testDirectoryObsPattern():
s = Scraper('%y%m%d/{observatory}_%Y%m%d.fits', observatory='SDO')
testpath = '140305/SDO_20140305.fits'
d = parse_time((2014, 3, 5))
assert s.matches(testpath, d)
示例2: testDirectoryDatePatternFalse
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import matches [as 别名]
def testDirectoryDatePatternFalse():
s = Scraper('%Y/%m/%d/%Y%m%d_%H%M%S_59.fit.gz')
testpath = '2013/03/05/20140305_013000_59.fit.gz'
d = parse_time((2014, 3, 5, 1, 30))
assert not s.matches(testpath, d)
示例3: testDirectoryDatePatternFalse
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import matches [as 别名]
def testDirectoryDatePatternFalse():
s = Scraper("%Y/%m/%d/%Y%m%d_%H%M%S_59.fit.gz")
testpath = "2013/03/05/20140305_013000_59.fit.gz"
d = datetime.datetime(2014, 3, 5, 1, 30)
assert not s.matches(testpath, d)
示例4: testDirectoryObsPattern
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import matches [as 别名]
def testDirectoryObsPattern():
s = Scraper("%y%m%d/{observatory}_%Y%m%d.fits", observatory="SDO")
testpath = "140305/SDO_20140305.fits"
d = datetime.datetime(2014, 3, 5)
assert s.matches(testpath, d)
示例5: testDirectoryDatePattern
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import matches [as 别名]
def testDirectoryDatePattern():
s = Scraper('%Y/%m/%d/%Y%m%d_%H%M%S_59.fit.gz')
testpath = '2014/03/05/20140305_013000_59.fit.gz'
d = datetime.datetime(2014,3,5,1,30)
assert s.matches(testpath, d)