Skip to content

About

A Julia client for the Heliophysics Application Programmer's Interface (HAPI)

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

109 Commits

Folders and files

Repository files navigation

HAPIClient

DOI

A Julia client for the Heliophysics Application Programmer's Interface (HAPI).

For information on using the package, see the documentation. For the list of HAPI servers and datasets, see HAPI Server Browser.

Usage Example

using Pkg; Pkg.add("HAPIClient")
using HAPIClient
using Dates

# List available HAPI servers
servers = hapi()

# A server is a catalog of datasets
filter(contains("AC_H0"), keys(CDAWeb))   # dataset ids
ds = CDAWeb["AC_H0_MFI"]                  # a dataset
keys(ds)                                  # parameter names
getmeta(ds)                               # HAPI info response
getmeta(ds["Magnitude"])                  # the parameter's info entry

tmin = DateTime(2001, 1, 1, 5, 0, 0)
tmax = DateTime(2001, 1, 1, 6, 0, 0)
var = getdata(ds["Magnitude"], tmin, tmax)                # a HAPIVariable
data = getdata(ds[["Magnitude", "BGSEc"]], tmin, tmax)    # HAPIVariables, one request
data = getdata(ds, tmin, tmax)                            # all parameters
data["BGSEc"]

parent(var)   # values
times(var)    # timestamps
getmeta(var)  # metadata

# Fetch the request (e.g. into a file cache), then parse it offline
path = download(HAPIClient.data_url(CDAWeb, "AC_H0_MFI", "Magnitude", tmin, tmax))
data = HAPIClient.read_data(path, hapi(CDAWeb, "AC_H0_MFI", "Magnitude"))

Elsewhere

About

A Julia client for the Heliophysics Application Programmer's Interface (HAPI)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages