本文整理汇总了Python中sunpy.util.scraper.Scraper.range方法的典型用法代码示例。如果您正苦于以下问题:Python Scraper.range方法的具体用法?Python Scraper.range怎么用?Python Scraper.range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sunpy.util.scraper.Scraper
的用法示例。
在下文中一共展示了Scraper.range方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testDirectoryRange_Month
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_Month():
s = Scraper("%Y%m/%d/%j_%H.txt")
startdate = datetime.datetime(2008, 2, 20, 10)
enddate = datetime.datetime(2008, 3, 2, 5)
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 12
startdate = datetime.datetime(2009, 2, 20, 10)
enddate = datetime.datetime(2009, 3, 2, 5)
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 11
示例2: testDirectoryRange_Month
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_Month():
s = Scraper('%Y%m/%d/%j_%H.txt')
startdate = parse_time((2008, 2, 20, 10))
enddate = parse_time((2008, 3, 2, 5))
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 12
startdate = parse_time((2009, 2, 20, 10))
enddate = parse_time((2009, 3, 2, 5))
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 11
示例3: testNoDirectory
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testNoDirectory():
s = Scraper('files/%Y%m%d_%H%M.dat')
startdate = parse_time((2010, 1, 10, 20, 30))
enddate = parse_time((2010, 1, 20, 20, 30))
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 1
示例4: testDirectoryRange_single
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_single():
s = Scraper('%Y%m%d/%H_%M.csv')
startdate = parse_time((2010, 10, 10, 5, 0))
enddate = parse_time((2010, 10, 10, 7, 0))
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 1
示例5: testDirectoryRangeHours
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRangeHours():
s = Scraper('%Y%m%d_%H/%H%M.csv')
timerange = TimeRange('2009-12-31T23:40:00', '2010-01-01T01:15:00')
assert len(s.range(timerange)) == 3 # 3 directories (1 per hour)
示例6: testNoDateDirectory
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testNoDateDirectory():
s = Scraper('mySpacecraft/myInstrument/xMinutes/aaa%y%b.ext')
directory_list = ['mySpacecraft/myInstrument/xMinutes/']
timerange = TimeRange('2009/11/20', '2010/01/03')
assert s.range(timerange) == directory_list
示例7: testDirectoryRangeFalse
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRangeFalse():
s = Scraper('%Y%m%d/%Y%m%d_%H.fit.gz')
directory_list = ['20091230/', '20091231/', '20100101/',
'20090102/', '20090103/']
timerange = TimeRange('2009/12/30', '2010/01/03')
assert s.range(timerange) != directory_list
示例8: testDirectoryRange
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange():
s = Scraper('%Y/%m/%d/%Y%m%d_%H.fit.gz')
directory_list = ['2009/12/30/', '2009/12/31/', '2010/01/01/',
'2010/01/02/', '2010/01/03/']
timerange = TimeRange('2009-12-30', '2010-01-03')
assert s.range(timerange) == directory_list
示例9: testNoDirectory
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testNoDirectory():
s = Scraper("files/%Y%m%d_%H%M.dat")
startdate = datetime.datetime(2010, 1, 10, 20, 30)
enddate = datetime.datetime(2010, 1, 20, 20, 30)
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 1
示例10: testDirectoryRange_single
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_single():
s = Scraper("%Y%m%d/%H_%M.csv")
startdate = datetime.datetime(2010, 10, 10, 5, 00)
enddate = datetime.datetime(2010, 10, 10, 7, 00)
timerange = TimeRange(startdate, enddate)
assert len(s.range(timerange)) == 1
示例11: testDirectoryRangeFalse
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRangeFalse():
s = Scraper("%Y%m%d/%Y%m%d_%H.fit.gz")
directory_list = ["20091230/", "20091231/", "20100101/", "20090102/", "20090103/"]
timerange = TimeRange("2009/12/30", "2010/01/03")
assert s.range(timerange) != directory_list
示例12: testDirectoryRange
# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange():
s = Scraper("%Y/%m/%d/%Y%m%d_%H.fit.gz")
directory_list = ["2009/12/30/", "2009/12/31/", "2010/01/01/", "2010/01/02/", "2010/01/03/"]
timerange = TimeRange("2009-12-30", "2010-01-03")
assert s.range(timerange) == directory_list