API Reference
Core functions
HAPIClient.hapi
— FunctionMain 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
— Functionget_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
— TypeAn 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
— MethodHAPIVariable(data, params, i)
Construct a HAPIVariable
object from a JSON-parsed data
and params
at index i
.
HAPIClient.HAPIVariable
— MethodHAPIVariable(data, params, i)
Construct a HAPIVariable
object from CSV.File data
and params
at index i
.
HAPIClient.HAPIVariable
— MethodHAPIVariable(d, i)
Construct a HAPIVariable
object from a JSON-parsed Dict d
(containing parameters) at index i
.
HAPIClient.HAPIVariables
— TypeA thin wrapper over NamedTuple for HAPI variables that shares the same time axis.
Predefined 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.SERVERS
Dict{String, HAPIClient.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
— Methodget_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
— Methodget_data(path, tmin, tmax; kwargs...)
Get data and metadata using a path
in the format "server/dataset/parameter".
HAPIClient.hapi
— FunctionMain 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
— TypeParameter
Represents 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
string
andisotime
types: 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.Server
— MethodGet a HAPI server instance by its ID.
HAPIClient.format
— MethodDefault format for HAPI servers.
HAPIClient.get_capabilities
— Methodget_capabilities(server) -> Dict
Get server capabilities.
HAPIClient.get_catalog
— Methodget_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
HAPIClient.get_parameters
— Methodget_parameters(server, dataset, parameters)
Get a dictionary containing the HAPI info metadata for each parameter in the comma-separated string parameters
.
HAPIClient.get_parameters
— Methodget_parameters(server, dataset)
Get a dictionary containing the HAPI info metadata for all parameters in the 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
HAPIClient.get_servers
— Functionget_servers()
Get a list of available HAPI server URLs from https://github.com/hapi-server/servers/raw/master/all.txt
HAPIClient.is_time_parameter
— Methodis_time_parameter(param::Parameter)
Check if a parameter is a valid time parameter (first parameter in a dataset).
HAPIClient.load_servers_from_json
— Methodload_servers_from_json(; url=DEFAULT_SERVERS_JSON_URL, register=false)
Load HAPI servers from a JSON file at the specified URL.
HAPIClient.parameters
— MethodParse parameters into a Vector of Parameter objects and validate first parameter is time.