Remote data (sunpy.net)#

sunpy.net 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#

Classes#

Scraper(pattern[, regex])

A Scraper to scrap web data archives based on dates.

Variables#

Fido

Fido is a unified data search and retrieval tool.

Class Inheritance Diagram#

Inheritance diagram of sunpy.net.scraper.Scraper

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.

AttrAnd(attrs)

Attribute representing attributes ANDed together.

AttrOr(attrs)

Attribute representing attributes ORed together.

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.attrs.AttrAnd, sunpy.net.attrs.AttrOr

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 parfive.Results 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([data, masked, names, ...])

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.

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

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#

ADAPTClient()

Provides access to the ADvanced Adaptive Prediction Technique (ADAPT) products of the National Solar Observatory (NSO).

EVEClient()

Provides access to Level 0CS 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([data, masked, names, dtype, ...])

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 several GOES XRS files archive.

Class Inheritance Diagram#

Inheritance diagram of sunpy.net.dataretriever.sources.adapt.ADAPTClient, 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

sunpy.net.dataretriever.attrs.adapt Module#

Classes#

ADAPTFileType(value)

ADAPT file type: Public.

ADAPTLonType(value)

ADAPT longitude type: Carrington Fixed, Central Meridian, East Limb.

ADAPTInputSource(value)

ADAPT input source: All, KPVT, VSM, GONG, HMI, MDI, MWO.

ADAPTDataAssimilation(value)

ADAPT data assimilation: WH, enLS, enkf, enLAKF.

ADAPTResolution(value)

ADAPT model spatial resolution: 1.0 deg, 0.2 deg.

ADAPTVersionYear(value)

ADAPT code version year.

ADAPTVersionMonth(value)

ADAPT code version month.

ADAPTEvolutionMode(value)

ADAPT evolution mode: Data assimilation step, Intermediate step, Forecast step.

ADAPTHelioData(value)

ADAPT helioseismic data: Not added or no data, Far-side, Emergence, Both emergence & far-side.

ADAPTRealizations(value)

ADAPT realizations: number of model/file realizations, e.g., 16 -> "016"

ADAPTMagData(value)

ADAPT magnetic data: Not added or no data, Mag-los, Mag-vector, Mag- both los & vector, Mag- polar avg obs, Mag- los & polar, Mag- vector & polar, Mag- both los and vector & polar.

Class Inheritance Diagram#

Inheritance diagram of sunpy.net.dataretriever.attrs.adapt.ADAPTFileType, sunpy.net.dataretriever.attrs.adapt.ADAPTLonType, sunpy.net.dataretriever.attrs.adapt.ADAPTInputSource, sunpy.net.dataretriever.attrs.adapt.ADAPTDataAssimilation, sunpy.net.dataretriever.attrs.adapt.ADAPTResolution, sunpy.net.dataretriever.attrs.adapt.ADAPTVersionYear, sunpy.net.dataretriever.attrs.adapt.ADAPTVersionMonth, sunpy.net.dataretriever.attrs.adapt.ADAPTEvolutionMode, sunpy.net.dataretriever.attrs.adapt.ADAPTHelioData, sunpy.net.dataretriever.attrs.adapt.ADAPTRealizations, sunpy.net.dataretriever.attrs.adapt.ADAPTMagData

JSOC#

sunpy.net.jsoc Package#

Classes#

Cutout(bottom_left[, top_right, width, ...])

Select a cutout region.

JSOCClient()

Provides access to the JSOC Data Export service.

JSOCResponse(*args, **kwargs)

Keyword(value)

Allows comparison filtering of the JSOC Keywords.

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. 'image'.

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.Keyword, 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. 'image'.

PrimeKey(label, value)

Prime Keys

Cutout(bottom_left[, top_right, width, ...])

Select a cutout region.

Keyword(value)

Allows comparison filtering of the JSOC Keywords.

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.PrimeKey, sunpy.net.jsoc.attrs.Cutout, sunpy.net.jsoc.attrs.Keyword

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([data, masked, names, dtype, meta, ...])

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)

HEKAttr(name, operator, value)

This ensures the attr inspect magic works for registering in the client.

HEKComparisonParamAttrWrapper(name)

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

Class Inheritance Diagram#

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

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

CDAWeb#

sunpy.net.cdaweb Package#

Functions#

get_datasets(observatory)

Get a list of datasets for a given observatory.

get_observatory_groups()

Get a list of observatory IDs for each observatory in CDAWeb.

Classes#

CDAWEBClient()

Provides access to query and download from the Coordinated Data Analysis Web (CDAWeb).

Dataset(value)

Dataset ID.

Class Inheritance Diagram#

Inheritance diagram of sunpy.net.cdaweb.cdaweb.CDAWEBClient, sunpy.net.cdaweb.attrs.Dataset

HELIO#

sunpy.net.helio Package#

A Module for accessing the HELIO web service

Classes#

HECClient([link])

Provides access to the HELIO webservices.

HECResponse([data, masked, names, dtype, ...])

A container for data returned from HEC searches.

Chaincode(origin, chaincode, **kwargs)

A tool to infer some information from chaincodes produced by HELIO Feature Catalogue or Heliophysics Events Knowledgebase.

Class Inheritance Diagram#

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

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

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#

Functions#

convert_row_to_table(func)

A wrapper to convert any QueryResponseRow objects to QueryResponseTable objects.

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.

QueryResponseRow(table, index)

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

QueryResponseTable([data, masked, names, ...])

A class to represent tables of heterogeneous data.

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.QueryResponseRow, sunpy.net.base_client.QueryResponseTable, sunpy.net.base_client.BaseClient

sunpy.net.dataretriever.client Module#

Classes#

QueryResponse([data, masked, names, dtype, ...])

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

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.

AttrComparison(name, operator, value)

Allows a Attr to have a value and a comparison operator.

ComparisonParamAttrWrapper(name)

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.attrs.AttrAnd, sunpy.net.attrs.AttrOr, sunpy.net.attr.ValueAttr, sunpy.net.attr.AttrWalker, sunpy.net.attr.AttrComparison, sunpy.net.attr.ComparisonParamAttrWrapper

sunpy.net.scraper Module#

This module provides a web scraper.

Classes#

Scraper(pattern[, regex])

A Scraper to scrap web data archives based on dates.

Class Inheritance Diagram#

Inheritance diagram of sunpy.net.scraper.Scraper