API Reference
Core functions
HAPIClient.hapi — Function
Main interface to HAPI servers and provides multiple dispatch for different use cases:
hapi()- List available HAPI servers (get_servers)hapi(server)- Get catalog of datasets from a server (get_catalog)hapi(server, dataset)- Get parameter information for a dataset (get_parameters)hapi(server, dataset, parameters)- Get parameter information for specific parameters (get_parameters)hapi(server, dataset, tmin, tmax)- Get all data for a dataset in a time range (get_data)hapi(server, dataset, parameters, tmin, tmax)- Get specific parameter data in a time range (get_data)
HAPIClient.get_data — Function
get_data(server, dataset, parameters, tmin, tmax; format="csv")Get data and metadata from a HAPI server for a given dataset and parameters within a time range [tmin, tmax].
Supported optional keyword arguments:
format: Data format, default is "csv" (other options: "binary", "json").verbose: Verbosity level (passed toHTTP.get), default is 0 (other options: 1, 2).
get_data(path, tmin, tmax; kwargs...)Get data and metadata using a path in the format "server/dataset/parameter".
Types
HAPIClient.HAPIVariable — Type
An array-like object that represents a HAPI variable.
Fields
data: The underlying data values (useparent(x)to access).time: The time axis (usetimes(x)to access).meta: The metadata (usemeta(x)to access).
HAPIClient.HAPIVariable — Method
HAPIVariable(d, i)Construct a HAPIVariable object from a JSON-parsed Dict d (containing parameters) at index i.
HAPIClient.HAPIVariable — Method
HAPIVariable(data, params, i)Construct a HAPIVariable object from a JSON-parsed data and params at index i.
HAPIClient.HAPIVariable — Method
HAPIVariable(data, params, i)Construct a HAPIVariable object from CSV.File data and params at index i.
HAPIClient.HAPIVariables — Type
A thin wrapper over NamedTuple for HAPI variables that shares the same time axis.
sourceHAPIClient.Server — Method
Server(id)Get a HAPI server instance by its ID.
Examples
cdaweb = Server("CDAWeb") # same as HAPIClient.CDAWebsourcePredefined Servers
Convenient constants for commonly used HAPI servers are automatically exported (the valid keys of the SERVERS dictionary, e.g. DAS2, CDAWeb, etc.) and can be used directly:
using HAPIClient
HAPIClient.SERVERSDict{String, Server} with 19 entries:
"DAS2" => Server("https://planet.physics.uiowa.edu/das/das2Server/…
"TESTDATA2.1" => Server("http://hapi-server.org/servers/TestData2.1/hapi"…
"TESTDATA3.0" => Server("http://hapi-server.org/servers/TestData3.0/hapi"…
"WDC" => Server("https://wdcapi.bgs.ac.uk/hapi", "WDC", "HAPI WDC…
"TESTDATA3.3" => Server("http://hapi-server.org/servers/TestData3.3/hapi"…
"VIRES-FOR-SWARM" => Server("https://vires.services/hapi", "VirES-for-Swarm",…
"TESTDATA3.2" => Server("http://hapi-server.org/servers/TestData3.2/hapi"…
"AMDA" => Server("https://amda.irap.omp.eu/service/hapi", "AMDA", …
"KNMI" => Server("https://hapi.spaceweather.knmi.nl/hapi", "KNMI",…
"CSA" => Server("https://csatools.esac.esa.int/HapiServer/hapi", …
"HELIOVIEWER" => Server("https://api.helioviewer.org/hapi/Helioviewer/hap…
"SUPERMAG" => Server("https://supermag.jhuapl.edu/hapi", "SuperMAG", "…
"CDAWEB" => Server("https://cdaweb.gsfc.nasa.gov/hapi", "CDAWeb", "C…
"CCMC_ISWA" => Server("https://iswa.gsfc.nasa.gov/IswaSystemWebApp/hapi…
"INTERMAGNET" => Server("https://imag-data.bgs.ac.uk/GIN_V1/hapi", "INTER…
"TESTDATA3.1" => Server("http://hapi-server.org/servers/TestData3.1/hapi"…
"LISIRD" => Server("http://lasp.colorado.edu/lisird/hapi", "LISIRD",…
"SSCWEB" => Server("http://hapi-server.org/servers/SSCWeb/hapi", "SS…
"TESTDATA2.0" => Server("http://hapi-server.org/servers/TestData2.0/hapi"…Public
HAPIClient.get_data — Method
get_data(server, dataset, parameters, tmin, tmax; format="csv")Get data and metadata from a HAPI server for a given dataset and parameters within a time range [tmin, tmax].
Supported optional keyword arguments:
format: Data format, default is "csv" (other options: "binary", "json").verbose: Verbosity level (passed toHTTP.get), default is 0 (other options: 1, 2).
HAPIClient.get_data — Method
get_data(path, tmin, tmax; kwargs...)Get data and metadata using a path in the format "server/dataset/parameter".
HAPIClient.hapi — Function
Main interface to HAPI servers and provides multiple dispatch for different use cases:
hapi()- List available HAPI servers (get_servers)hapi(server)- Get catalog of datasets from a server (get_catalog)hapi(server, dataset)- Get parameter information for a dataset (get_parameters)hapi(server, dataset, parameters)- Get parameter information for specific parameters (get_parameters)hapi(server, dataset, tmin, tmax)- Get all data for a dataset in a time range (get_data)hapi(server, dataset, parameters, tmin, tmax)- Get specific parameter data in a time range (get_data)
Private
HAPIClient.Parameter — Type
ParameterRepresents a HAPI parameter with validation according to the specification.
Required fields:
name: String identifier for the parametertype: One of "string", "double", "integer", or "isotime"units: String, array of strings, or nothing for dimensionless quantitiesfill: String or nothing indicating no fill value
Type-specific requirements:
- For
stringandisotimetypes: must specifylength - For array parameters: must specify
size
Optional fields:
description: Brief description of the parameterlabel: Display label or array of labelssize: Array dimensions for array parametersbins: Array parameter bin informationstringType: For string parameters that represent URIscoordinateSystemName: Name of coordinate system for vector quantitiesvectorComponents: Component names for vector quantities
HAPIClient.format — Method
Default format for HAPI servers.
sourceHAPIClient.get_capabilities — Method
HAPIClient.get_catalog — Method
get_catalog(server)Get a list of datasets available from the server.
HAPI info response JSON structure: https://github.com/hapi-server/data-specification/blob/master/hapi-dev/HAPI-data-access-spec-dev.md#35-catalog
sourceHAPIClient.get_parameters — Method
get_parameters(server, id, parameters)Get a dictionary containing the HAPI info metadata for each parameter in the comma-separated string parameters.
HAPIClient.get_parameters — Method
get_parameters(server, id)Get a dictionary containing the HAPI info metadata for all parameters in the id dataset. Returns a tuple of (info, parameters) where info is the full response and parameters is a Vector of Parameter objects.
HAPI info response JSON structure: https://github.com/hapi-server/data-specification/blob/master/hapi-dev/HAPI-data-access-spec-dev.md#36-info
sourceHAPIClient.get_servers — Function
get_servers()Get a list of available HAPI server URLs from https://github.com/hapi-server/servers/raw/master/all.txt
sourceHAPIClient.is_time_parameter — Method
is_time_parameter(param::Parameter)Check if a parameter is a valid time parameter (first parameter in a dataset).
sourceHAPIClient.load_servers_from_json — Method
load_servers_from_json(; url=DEFAULT_SERVERS_JSON_URL, register=false)Load HAPI servers from a JSON file at the specified URL.
sourceHAPIClient.parameters — Method
Parse parameters into a Vector of Parameter objects and validate first parameter is time.
source