本文整理汇总了Python中sunpy.time.TimeRange.window方法的典型用法代码示例。如果您正苦于以下问题:Python TimeRange.window方法的具体用法?Python TimeRange.window怎么用?Python TimeRange.window使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sunpy.time.TimeRange
的用法示例。
在下文中一共展示了TimeRange.window方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TimeRange
# 需要导入模块: from sunpy.time import TimeRange [as 别名]
# 或者: from sunpy.time.TimeRange import window [as 别名]
from sunpy.time import TimeRange
from sunpy.lightcurve import GOESLightCurve
dt = TimeRange('1981/01/10 00:00', '2014/04/18 23:00')
tr_not_found = []
time_ranges = dt.window(60*60*24, 60*60*24)
total_days = len(time_ranges)
total_fails = 0
# missing files http://umbra.nascom.nasa.gov/goes/fits/2005/go1220051116.fits
# http://umbra.nascom.nasa.gov/goes/fits/2005/go1220051116.fits
for time_range in time_ranges:
print(time_range.start())
try:
goes = GOESLightCurve.create(time_range)
print(goes.data['xrsa'].max())
print(goes.data['xrsb'].max())
except:
print("File Not Found!")
tr_not_found.append(time_range)
total_fails = total_fails + 1
print('Number of fails:%i' % total_fails)
print('Number of tries:%i' % total_days)
print('Percent Fail: %d' % (float(total_fails)/total_days * 100))
for tr in tr_not_found:
print(tr.start())