H2VClient#

class sunpy.net.hek2vso.H2VClient[source]#

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()  

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]#

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 attrs as a, hek, hek2vso
>>> hek2vso_client = hek2vso.H2VClient()  
>>> query = hek2vso_client.full_query((a.Time('2011/08/09 07:00:00', '2011/08/09 07:15:00'), a.hek.EventType('FL')))  
>>> len(query)  
7
translate_and_query(hek_results, limit=None, progress=False, vso_response_format='table')[source]#

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.HEKRow or sunpy.net.hek.hek.HEKTable) – 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 (bool) – A flag to turn off the progress bar, defaults to “off” Was never used and is now deprecated, will be removed in sunpy 7.0

Examples

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