translate_results_to_query

sunpy.net.hek2vso.translate_results_to_query(results)[source] [edit on github]

Formulate VSO queries from HEK results.

Take the results from a HEK query either in the form of a single HEK response or a list containing multiple HEK responses then translates them into a VSO compatible query.

Parameters:results (sunpy.net.hek.hek.Response or list of sunpy.net.hek.hek.Response) – The HEK results from a HEK query to be translated.

Examples

>>> from sunpy.net.hek import hek, HEKClient
>>> from sunpy.net.hek2vso import hek2vso, H2VClient
>>> h = HEKClient()  
>>> h2v = H2VClient()  
>>> q = h.search(hek.attrs.Time('2011/08/09 07:23:56',
...             '2011/08/09 12:40:29'), hek.attrs.EventType('FL'))  
>>> len(q)  
19
>>> hek2vso.translate_results_to_query(q[0])  
[[<Time(datetime.datetime(2011, 8, 8, 1, 30, 4), datetime.datetime(2011, 8, 10, 0, 0, 4), None)>, <Source('SDO')>, <Instrument('HEK')>, <Wavelength(0.0, 0.0, 'Angstrom')>]]
>>> hek2vso.translate_results_to_query(q)   
[[<Time(datetime.datetime(2011, 8, 8, 1, 30, 4), datetime.datetime(2011, 8, 10, 0, 0, 4), None)>, <Source(u'SDO')>, <Instrument(u'AIA')>, <Wave(210.99999999999997, 210.99999999999997, 'Angstrom')>], ..., [<Time(datetime.datetime(2011, 8, 9, 8, 1, 21), datetime.datetime(2011, 8, 9, 8, 16, 45), None)>, <Source(u'SDO')>, <Instrument(u'AIA')>, <Wave(303.99999999999994, 303.99999999999994, 'Angstrom')>]]