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.HEKRow or sunpy.net.hek.hek.HEKTable) – 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()  # doctest: +REMOTE_DATA
>>> h2v = H2VClient()  # doctest: +REMOTE_DATA
>>> q = h.search(hek.attrs.Time('2011/08/09 07:23:56',
...             '2011/08/09 12:40:29'), hek.attrs.EventType('FL'))  # doctest: +REMOTE_DATA
>>> len(q)  # doctest: +REMOTE_DATA
19
>>> hek2vso.translate_results_to_query(q[0])  # doctest: +REMOTE_DATA
[[<Time(<Time object: scale='utc' format='isot' value=2011-08-08T01:30:04.000>, <Time object: scale='utc' format='isot' value=2011-08-10T00:00:04.000>, None)>, <Source('SDO')>, <Instrument('HEK')>, <Wavelength(0.0, 0.0, 'Angstrom')>]]
>>> hek2vso.translate_results_to_query(q)   # doctest: +SKIP
[[<Time(<Time object: scale='utc' format='isot' value=2011-08-08T01:30:04.000>, <Time object: scale='utc' format='isot' value=2011-08-10T00:00:04.000>, None)>, <Source('SDO')>, <Instrument('HEK')>, <Wavelength(0.0, 0.0, 'Angstrom')>], ..., [<Time(<Time object: scale='utc' format='isot' value=2011-08-09T08:01:21.000>, <Time object: scale='utc' format='isot' value=2011-08-09T08:16:45.000>, None)>, <Source('SDO')>, <Instrument('AIA')>, <Wavelength(303.99999999999994, 303.99999999999994, 'Angstrom')>]]