SunPy net

SunPy’s net submodule contains a lot of different code for accessing various solar physics related web services. This submodule contains many layers. Most users should use Fido, which is an interface to multiple sources including all the sources implemented in dataretriever as well as vso and jsoc. Fido can be used like so:

>>> from sunpy.net import Fido, attrs as a
>>> results = Fido.search(a.Time("2012/1/1", "2012/1/2"), a.Instrument.lyra)  
>>> files = Fido.fetch(results)  

sunpy.net Package

Variables

Fido

Fido is a unified data search and retrieval tool.

sunpy.net.attrs Module

‘attrs’ are parameters which can be composed together to specify searches to sunpy.net.Fido. They can be combined by using logical and (&) and logical or (|) operations to construct very complex queries.

For example you could combine two instruments using or (|) with a time specification and a sample cadence using:

>>> import astropy.units as u
>>> from sunpy.net import Fido, attrs as a
>>> a.Time("2011/01/01", "2011/01/02") & (a.Instrument.aia | a.Instrument.hmi) & a.Sample(1*u.day))  

In addition to the core attrs defined here, other sunpy clients also provide attrs specific to them, under:

Classes

Time(start[, end, near])

Specify the time range of the query.

Instrument(value)

Specifies the Instrument name for the search.

Wavelength(wavemin[, wavemax])

Level(value)

Specifies the data processing level to search for.

ExtentType(value)

The type of Extent; for example, “FULLDISK”, “SYNOPTIC”, “LIMB”, etc.

Sample(value)

Time interval for data sampling.

Detector(value)

The detector from which the data comes from.

Resolution(value)

Resolution level of the data.

Physobs(value)

Specifies the physical observable the VSO can search for.

Source(value)

Data sources that Fido can search with.

Provider(value)

Specifies the data provider to search for data using Fido.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.attrs.Time, sunpy.net.attrs.Instrument, sunpy.net.attrs.Wavelength, sunpy.net.attrs.Level, sunpy.net.attrs.ExtentType, sunpy.net.attrs.Sample, sunpy.net.attrs.Detector, sunpy.net.attrs.Resolution, sunpy.net.attrs.Physobs, sunpy.net.attrs.Source, sunpy.net.attrs.Provider

sunpy.net.fido_factory Module

This module provides the Fido instance of sunpy.net.fido_factory.UnifiedDownloaderFactory it also provides the UnifiedResponse class which Fido.search returns and the DownloadResponse class that is returned by Fido.fetch.

Classes

UnifiedResponse(*results)

The object used to store results from search.

UnifiedDownloaderFactory([…])

Fido is a unified data search and retrieval tool.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.fido_factory.UnifiedResponse, sunpy.net.fido_factory.UnifiedDownloaderFactory

VSO

sunpy.net.vso Package

Classes

VSOClient([url, port, api])

Provides access to query and download from Virtual Solar Observatory (VSO).

VSOQueryResponseTable(*args, **kwargs)

Class Inheritance Diagram

Inheritance diagram of sunpy.net.vso.vso.VSOClient, sunpy.net.vso.table_response.VSOQueryResponseTable

sunpy.net.vso.attrs Module

Attributes that can be used to construct VSO queries.

Attributes are the fundamental building blocks of queries that, together with the two operations of AND and OR (and in some rare cases XOR) can be used to construct complex queries. Most attributes can only be used once in an AND-expression, if you still attempt to do so it is called a collision. For a quick example think about how the system should handle Instrument(‘aia’) & Instrument(‘eit’).

Classes

Extent(x, y, width, length, atype)

Specify the spatial field-of-view of the query.

Field(fielditem)

A subclass of the value attribute.

Pixels(value)

Pixels are (currently) limited to a single dimension (and only implemented for SDO data) We hope to change this in the future to support TRACE, Hinode and other investigations where this changed between observations.

Filter(value)

This attribute is a placeholder for the future.

Quicklook(value)

Retrieve ‘quicklook’ data if available.

PScale(value)

Pixel Scale (PSCALE) is in arc seconds.

Time(*args, **kwargs)

sunpy.net.vso.attrs.Time is deprecated, please use sunpy.net.attrs.Time

Instrument(*args, **kwargs)

sunpy.net.vso.attrs.Instrument is deprecated, please use sunpy.net.attrs.Instrument

Wavelength(*args, **kwargs)

sunpy.net.vso.attrs.Wavelength is deprecated, please use sunpy.net.attrs.Wavelength None

Source(*args, **kwargs)

sunpy.net.vso.attrs.Source is deprecated, please use sunpy.net.attrs.Source

Provider(*args, **kwargs)

sunpy.net.vso.attrs.Provider is deprecated, please use sunpy.net.attrs.Provider

Level(*args, **kwargs)

sunpy.net.vso.attrs.Level is deprecated, please use sunpy.net.attrs.Level

Sample(*args, **kwargs)

sunpy.net.vso.attrs.Sample is deprecated, please use sunpy.net.attrs.Sample

Detector(*args, **kwargs)

sunpy.net.vso.attrs.Detector is deprecated, please use sunpy.net.attrs.Detector

Resolution(*args, **kwargs)

sunpy.net.vso.attrs.Resolution is deprecated, please use sunpy.net.attrs.Resolution

Physobs(*args, **kwargs)

sunpy.net.vso.attrs.Physobs is deprecated, please use sunpy.net.attrs.Physobs

Class Inheritance Diagram

Inheritance diagram of sunpy.net.vso.attrs.Extent, sunpy.net.vso.attrs.Field, sunpy.net.vso.attrs.Pixels, sunpy.net.vso.attrs.Filter, sunpy.net.vso.attrs.Quicklook, sunpy.net.vso.attrs.PScale, sunpy.net.vso.attrs.Time, sunpy.net.vso.attrs.Instrument, sunpy.net.vso.attrs.Wavelength, sunpy.net.vso.attrs.Source, sunpy.net.vso.attrs.Provider, sunpy.net.vso.attrs.Level, sunpy.net.vso.attrs.Sample, sunpy.net.vso.attrs.Detector, sunpy.net.vso.attrs.Resolution, sunpy.net.vso.attrs.Physobs

Dataretriever

sunpy.net.dataretriever Package

The sunpy.net.dataretriever submodule is a framework for downloading data from “simple” web sources such as HTTP or FTP servers. Although it could be used for more complex services as well. Following the example of sunpy.map and sunpy.timeseries this module provides a base class GenericClient from which specific services can subclass. All these subclasses are then registered with the sunpy.net.Fido factory class, so do not need to be called individually.

Classes

EVEClient()

Provides access to Level 0C Extreme ultraviolet Variability Experiment (EVE) data.

GBMClient()

Provides access to data from the Gamma-Ray Burst Monitor (GBM) instrument on board the Fermi satellite.

GONGClient()

Provides access to the Magnetogram products of NSO-GONG synoptic Maps.

GenericClient()

Base class for simple web clients for the data retriever module.

LYRAClient()

Provides access to the LYRA/Proba2 data archive.

NOAAIndicesClient()

Provides access to the NOAA solar cycle indices.

NOAAPredictClient()

Provides access to the NOAA SWPC predicted sunspot Number and 10.7 cm radio flux values.

NoRHClient()

Provides access to the Nobeyama RadioHeliograph (NoRH) averaged correlation time series data.

QueryResponse(*args, **kwargs)

RHESSIClient()

Provides access to the RHESSI observing summary time series data.

SRSClient()

Provides access to the NOAA SWPC solar region summary data.

SUVIClient()

Provides access to data from the GOES Solar Ultraviolet Imager (SUVI).

XRSClient()

Provides access to the GOES XRS fits files archive.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.dataretriever.sources.eve.EVEClient, sunpy.net.dataretriever.sources.fermi_gbm.GBMClient, sunpy.net.dataretriever.sources.gong.GONGClient, sunpy.net.dataretriever.client.GenericClient, sunpy.net.dataretriever.sources.lyra.LYRAClient, sunpy.net.dataretriever.sources.noaa.NOAAIndicesClient, sunpy.net.dataretriever.sources.noaa.NOAAPredictClient, sunpy.net.dataretriever.sources.norh.NoRHClient, sunpy.net.dataretriever.client.QueryResponse, sunpy.net.dataretriever.sources.rhessi.RHESSIClient, sunpy.net.dataretriever.sources.noaa.SRSClient, sunpy.net.dataretriever.sources.goes.SUVIClient, sunpy.net.dataretriever.sources.goes.XRSClient

sunpy.net.dataretriever.attrs.goes Module

Classes

SatelliteNumber(value)

The GOES Satellite Number

Class Inheritance Diagram

Inheritance diagram of sunpy.net.dataretriever.attrs.goes.SatelliteNumber

JSOC

sunpy.net.jsoc Package

Classes

Cutout(bottom_left[, top_right, tracking, …])

Select a cutout region.

JSOCClient()

Provides access to the JSOC Data Export service.

JSOCResponse(*args, **kwargs)

Keys(value)

Deprecated since version 2.1.

Notify(value)

An email address to get a notification to when JSOC has staged your request.

PrimeKey(label, value)

Prime Keys

Protocol(value)

The type of download to request one of (“FITS”, “JPEG”, “MPG”, “MP4”, or “as-is”).

Segment(value)

Segments choose which files to download when there are more than one present for each record e.g.

Series(value)

The JSOC Series to Download.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.jsoc.attrs.Cutout, sunpy.net.jsoc.jsoc.JSOCClient, sunpy.net.jsoc.jsoc.JSOCResponse, sunpy.net.jsoc.attrs.Keys, sunpy.net.jsoc.attrs.Notify, sunpy.net.jsoc.attrs.PrimeKey, sunpy.net.jsoc.attrs.Protocol, sunpy.net.jsoc.attrs.Segment, sunpy.net.jsoc.attrs.Series

sunpy.net.jsoc.attrs Module

Classes

Series(value)

The JSOC Series to Download.

Protocol(value)

The type of download to request one of (“FITS”, “JPEG”, “MPG”, “MP4”, or “as-is”).

Notify(value)

An email address to get a notification to when JSOC has staged your request.

Segment(value)

Segments choose which files to download when there are more than one present for each record e.g.

Keys(value)

Deprecated since version 2.1.

PrimeKey(label, value)

Prime Keys

Cutout(bottom_left[, top_right, tracking, …])

Select a cutout region.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.jsoc.attrs.Series, sunpy.net.jsoc.attrs.Protocol, sunpy.net.jsoc.attrs.Notify, sunpy.net.jsoc.attrs.Segment, sunpy.net.jsoc.attrs.Keys, sunpy.net.jsoc.attrs.PrimeKey, sunpy.net.jsoc.attrs.Cutout

HEK

sunpy.net.hek Package

Classes

HEKClient([url])

Provides access to the Heliophysics Event Knowledgebase (HEK).

HEKRow(table, index)

Handles the response from the HEK.

HEKTable(*args, **kwargs)

A container for data returned from HEK searches.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.hek.hek.HEKClient, sunpy.net.hek.hek.HEKRow, sunpy.net.hek.hek.HEKTable

sunpy.net.hek.attrs Module

Attributes that can be used to construct HEK queries. They are different to the VSO ones in that a lot of them are wrappers that conveniently expose the comparisons by overloading Python operators. So, e.g., you are able to say AR & AR.NumSpots < 5 to find all active regions with less than 5 spots. As with the VSO query, you can use the fundamental logic operators AND and OR to construct queries of almost arbitrary complexity. Note that complex queries result in multiple requests to the server which might make them less efficient.

Classes

Contains(*types)

EventType(item)

SpatialRegion([x1, y1, x2, y2, sys])

Time(*args, **kwargs)

Class Inheritance Diagram

Inheritance diagram of sunpy.net.hek.attrs.Contains, sunpy.net.hek.attrs.EventType, sunpy.net.hek.attrs.SpatialRegion, sunpy.net.hek.attrs.Time

sunpy.net.hek2vso Package

This module provides a translation layer between the HEK and the VSO. It allows you to acquire records of data that are available via the VSO, based on the data in HEK event entries.

Warning

This module is in beta and maybe unstable.

Functions

translate_results_to_query(results)

Formulate VSO queries from HEK results.

vso_attribute_parse(phrase)

Parses VSO attributes from a HEK result.

Classes

H2VClient()

Class to handle HEK to VSO translations

Class Inheritance Diagram

Inheritance diagram of sunpy.net.hek2vso.hek2vso.H2VClient

HELIO

sunpy.net.helio Package

A Module for accessing the HELIO web service

Warning

This module is still in beta and may be unstable

Classes

HECClient([link])

Provides access to the HELIO webservices.

HECResponse(*args, **kwargs)

A container for data returned from HEC searches.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.helio.hec.HECClient, sunpy.net.helio.hec.HECResponse

sunpy.net.helio.attrs Module

Classes

MaxRecords(value)

The maximum number of desired records.

TableName(value)

The table to query from

Class Inheritance Diagram

Inheritance diagram of sunpy.net.helio.attrs.MaxRecords, sunpy.net.helio.attrs.TableName

Helioviewer

sunpy.net.helioviewer Module

This module provides a wrapper around the Helioviewer API.

Classes

HelioviewerClient([url])

Helioviewer.org Client

Class Inheritance Diagram

Inheritance diagram of sunpy.net.helioviewer.HelioviewerClient

Internal Classes and Functions

These classes and functions are designed to be used to help develop new clients for sunpy.net.Fido.

sunpy.net.base_client Module

Classes

QueryResponseColumn([data, name, dtype, …])

A column subclass which knows about the client of the parent table.

BaseQueryResponse()

An Abstract Base Class for results returned from BaseClient.

QueryResponseTable(*args, **kwargs)

BaseClient()

This defines the Abstract Base Class for each download client.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.base_client.QueryResponseColumn, sunpy.net.base_client.BaseQueryResponse, sunpy.net.base_client.QueryResponseTable, sunpy.net.base_client.BaseClient

sunpy.net.attr Module

Allow representation of queries as logic expressions. This module makes sure that attributes that are combined using the two logic operations AND (&) and OR (|) always are in disjunctive normal form, that is, there are only two levels ­- the first being disjunction and the second being conjunction. In other words, every combinations of attributes looks like this: (a AND b AND c) OR (d AND e).

Walkers are used to traverse the tree that results from combining attributes. They are implemented using functools.singledispatch modified to dispatch on the second argument to the function.

Please note that & is evaluated first, so A & B | C is equivalent to (A & B) | C.

Functions

and_(*args)

Trick operator precedence.

or_(*args)

Trick operator precedence.

Classes

Attr()

This is the base for all attributes.

DataAttr(*args, **kwargs)

A base class for attributes classes which contain data.

DummyAttr()

Empty attribute.

SimpleAttr(value)

An attribute that only has a single value.

Range(min_, max_)

An attribute that represents a range of a value.

AttrAnd(attrs)

Attribute representing attributes ANDed together.

AttrOr(attrs)

Attribute representing attributes ORed together.

ValueAttr(attrs)

AttrWalker()

Traverse the Attr tree and convert it to a different representation.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.attr.Attr, sunpy.net.attr.DataAttr, sunpy.net.attr.DummyAttr, sunpy.net.attr.SimpleAttr, sunpy.net.attr.Range, sunpy.net.attr.AttrAnd, sunpy.net.attr.AttrOr, sunpy.net.attr.ValueAttr, sunpy.net.attr.AttrWalker

sunpy.net.dataretriever.client Module

Classes

QueryResponse(*args, **kwargs)

GenericClient()

Base class for simple web clients for the data retriever module.

Class Inheritance Diagram

Inheritance diagram of sunpy.net.dataretriever.client.QueryResponse, sunpy.net.dataretriever.client.GenericClient