H2VClient

class sunpy.net.hek2vso.H2VClient[source] [edit on github]

Bases: object

Class to handle HEK to VSO translations

Though the single step functions exists outside this class where translation is also possible, this class provides a framework where all the necessary functionality is easily accessed, along with a few additional and helpful methods.

Examples

>>> from sunpy.net.hek import hek
>>> from sunpy.net import hek2vso
>>> h2v = hek2vso.H2VClient()  # doctest: +REMOTE_DATA

Methods Summary

full_query(client_query[, limit, progress]) An encompassing method that takes a HEK query and returns a VSO result
translate_and_query(hek_results[, limit, …]) Translates HEK results, makes a VSO query, then returns the results.

Methods Documentation

full_query(client_query, limit=None, progress=False)[source] [edit on github]

An encompassing method that takes a HEK query and returns a VSO result

Takes a list containing a HEK style query, passes it to a HEKClient instance, translates it, queries the VSO webservice, then returns the VSO results inside a structured list.

Parameters:
  • client_query (list) – The list containing the HEK style query.
  • limit (int) – An approximate limit to the desired number of VSO results.

Examples

>>> from sunpy.net import hek, hek2vso
>>> h2v = hek2vso.H2VClient()  # doctest: +REMOTE_DATA
>>> q = h2v.full_query((hek.attrs.Time('2011/08/09 07:23:56', '2011/08/09 12:40:29'),
...                    hek.attrs.EventType('FL')))  # doctest: +REMOTE_DATA
translate_and_query(hek_results, limit=None, progress=False)[source] [edit on github]

Translates HEK results, makes a VSO query, then returns the results.

Takes the results from a HEK query, translates them, then makes a VSO query, returning the results in a list organized by their corresponding HEK query.

Parameters:
  • hek_results (sunpy.net.hek.hek.Response or list of such Responses) – The results from a HEK query in the form of a list.
  • limit (int) – An approximate limit to the desired number of VSO results.
  • progress (Boolean) – A flag to turn off the progress bar, defaults to “off”

Examples

>>> from sunpy.net import hek, hek2vso
>>> h = hek.HEKClient()  # doctest: +REMOTE_DATA
>>> tstart = '2011/08/09 07:23:56'
>>> tend = '2011/08/09 12:40:29'
>>> event_type = 'FL'
>>> q = h.search(hek.attrs.Time(tstart, tend), hek.attrs.EventType(event_type))  # doctest: +REMOTE_DATA
>>> h2v = hek2vso.H2VClient()  # doctest: +REMOTE_DATA
>>> res = h2v.translate_and_query(q)  # doctest: +REMOTE_DATA