在 sunpy 教程中更改参数会引发错误 - 这是错误吗?

Changing parameters in sunpy tutorial throws an error - is this a bug?

这是 this question in the astronomy SO 的后续问题。

遵循 this example in sunpy(与上面链接 post 中的答案非常相似),我正在尝试访问和下载跨越几十年 X 射线通量的时间序列数据集( XRS)。参数 tstarttend 定义要考虑的日期时间范围的边界。

使用 sunpy 3.0.1,以下代码片段成功运行:

import datetime
from sunpy import timeseries as ts
from sunpy.net import Fido
from sunpy.net import attrs as a

tstart = datetime.datetime(2020, 6, 21, 1) # "2020-06-21 01:00"
tend = datetime.datetime(2020, 6, 21, 23) # "2020-06-21 23:00"
result = Fido.search(a.Time(tstart, tend), a.Instrument("XRS"), a.goes.SatelliteNumber(16))
goes_16_files = Fido.fetch(result)
goes_16 = ts.TimeSeries(goes_16_files, concat=True)
goes_table = goes_16.to_table()
goes_table.write('goes_16.csv', format='csv')

上面的示例获得了几乎一整天(tstart - tend ~ 1 天)的观察结果。但我想要跨越 years/decades 的完整数据集;我计划对所有 GOES 卫星(不仅仅是 16 号)重复上述过程。从 wiki,我发现 GOES-16 于 2016 年 11 月 19 日开始运行,23:42 并且仍然活跃(即从未退役)。用代码中相应的范围替换 tstarttend 将抛出错误而不是 运行 成功(如下所示,使用与上面相同的导入):

tstart = datetime.datetime(2016, 11, 19, 23, 59, 59)
tend = datetime.datetime(2020, 6, 21, 23) #datetime.datetime.now() # "2020-06-21 23:00"
result = Fido.search(a.Time(tstart, tend), a.Instrument("XRS"), a.goes.SatelliteNumber(16))
goes_16_files = Fido.fetch(result)
goes_16 = ts.TimeSeries(goes_16_files, concat=True)
goes_table = goes_16.to_table()
goes_table.write('goes_16_re.csv', format='csv')


Files Downloaded:   7%|█▌                   | 89/1227 [01:07<14:22,  1.32file/s]
Traceback (most recent call last):
  File "/Users/T123/Desktop/testme123.py", line 11, in <module>
    goes_table = goes_16.to_table()
AttributeError: 'list' object has no attribute 'to_table'

在上面的代码块中,唯一改变的是参数 tstart.

这是 sunpy 中的错误吗?还是我做错了什么?如果它是相关的(因为 some issues "appear" to be platform-specific),我是 运行 python 3.9 on macOS BigSur 11.2.1.

PS:我将 astropy 作为这个问题的标签,因为 sunpy 的某些功能依赖于 astropy(并且因为没有 sunpy 标签)。如果这个问题有更合适的标签,请随时编辑它们 in/out.

documentation 所述,ts.TimeSeries returns 一个列表,除非 concatenate 参数是 True。您的代码包含不同名称的 concat 参数,该参数可能不会被提取。