HECClient

class sunpy.net.helio.HECClient(link=None)[source] [edit on github]

Bases: object

A client class used to interface with and query HELIO webservices.

The constructor; establishes the webservice link for the client

Initializes the client with a weblink

Parameters

link (str) – Contains URL to valid WSDL endpoint

Examples

>>> from sunpy.net.helio import hec
>>> hc = hec.HECClient()  # doctest: +REMOTE_DATA

Methods Summary

get_table_names()

Returns a list of the available tables to query.

select_table()

Creates a list of table names and prompts the user for a choice

time_query(start_time, end_time[, table, …])

The simple interface to query the wsdl service.

Methods Documentation

get_table_names()[source] [edit on github]

Returns a list of the available tables to query.

Returns the names of all the tables that can be queried via the webservice.

Returns

tables.array (numpy.ma.core.MaskedArray) – A VOtable table of available tables names

Examples

>>> from sunpy.net.helio import hec
>>> hc = hec.HECClient()  # doctest: +REMOTE_DATA
>>> print(hc.get_table_names())  # doctest: +REMOTE_DATA +SKIP
[(b'timed_see_flare',) (b'hi_event',) (b'yohkoh_flare_list',)
 (b'wind_mfi_bs_crossing_time',) (b'seeds_soho',) (b'seeds_stb',)
 ...
 (b'rhessi_hxr_flare',) (b'cactus_soho_flow',) (b'cactus_soho_cme',)
 (b'stereob_het_sep',)]
select_table()[source] [edit on github]

Creates a list of table names and prompts the user for a choice

This takes the table of table names from get_table_names(), creates a list of the names, sorts them, then presents the tables in a convenient menu for the user to choose from. It returns a string containing the name of the table that the user picked.

Returns

bytes – contains the name of the table that the user picked.

Examples

>>> from sunpy.net.helio import hec
>>> hc = hec.HECClient()  # doctest: +REMOTE_DATA
>>> hc.select_table()  # doctest: +REMOTE_DATA +SKIP
time_query(start_time, end_time, table=None, max_records=None)[source] [edit on github]

The simple interface to query the wsdl service.

Used to utilize the service’s TimeQuery() method, this is a simple interface between the sunpy module library and the web-service’s API.

Parameters
  • start_time (str, parse_time parsable objects) – The time where the query window opens

  • end_time (str, parse_time parsable objects) – The time where the query window closes

  • table (bytes) – The table to query from. If the table is unknown, the user will be prompted to pick from a list of tables.

  • max_records (int) – The maximum number of desired records.

Returns

results (astropy.io.votable.tree.Table) – Table containing the results from the query

Examples

>>> from sunpy.net.helio import hec
>>> hc = hec.HECClient()  # doctest: +REMOTE_DATA
>>> start = '2005/01/03'
>>> end = '2005/12/03'
>>> temp = hc.time_query(start, end, max_records=10)  # doctest: +REMOTE_DATA +SKIP