sunpy/sunpy — pull request #778 by aringlis (2014-01-23 16:27:30+00:00)
Title: Added a GOES event list utility to sunpy/instr

Following on from #758. Added a utility to sunpy/instr which accepts a TimeRange object as input, and returns a list of GOES flares that occured during that time range. Info for each flare is contained in a dictionary. For example:

ln [4]: from sunpy.instr import goes
ln [5]: from sunpy.time import TimeRange
In [6]: tran=TimeRange('2011-03-07 00:00','2011-03-07 12:00')

In [7]: result=goes.get_goes_event_list(tran,goes_class_filter='M1')

In [8]: result
Out[8]:
[{'end_time': datetime.datetime(2011, 3, 7, 5, 19),
'event_date': '2011-03-07',
'goes_class': 'M1.2',
'goes_location': (0, 0),
'noaa_active_region': 11164,
'peak_time': datetime.datetime(2011, 3, 7, 5, 13),
'start_time': datetime.datetime(2011, 3, 7, 5, 0)},
{'end_time': datetime.datetime(2011, 3, 7, 7, 56),
'event_date': '2011-03-07',
'goes_class': 'M1.5',
'goes_location': (78, -20),
'noaa_active_region': 11165,
'peak_time': datetime.datetime(2011, 3, 7, 7, 54),
'start_time': datetime.datetime(2011, 3, 7, 7, 49)},
{'end_time': datetime.datetime(2011, 3, 7, 8, 15),
'event_date': '2011-03-07',
'goes_class': 'M1.4',
'goes_location': (47, 25),
'noaa_active_region': 11164,
'peak_time': datetime.datetime(2011, 3, 7, 8, 7),
'start_time': datetime.datetime(2011, 3, 7, 7, 59)},
{'end_time': datetime.datetime(2011, 3, 7, 9, 28),
'event_date': '2011-03-07',
'goes_class': 'M1.8',
'goes_location': (50, 23),
'noaa_active_region': 11164,
'peak_time': datetime.datetime(2011, 3, 7, 9, 20),
'start_time': datetime.datetime(2011, 3, 7, 9, 14)}]

The code is basically a wrapper around the HEK functionality.