You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the `Appendix <#Appendix>`__ for a fail-safe installation method.
17
21
18
22
Basic Example
19
23
-------------
20
24
21
25
.. code:: python
22
26
23
-
# Get and plot Dst index from CDAWeb HAPI server
27
+
# Get Dst index from CDAWeb HAPI server
24
28
from hapiclient import hapi
25
-
from hapiclient import hapiplot
26
29
30
+
# See http://hapi-server.org/servers/ for a list of
31
+
# other HAPI servers and datasets.
27
32
server ='https://cdaweb.gsfc.nasa.gov/hapi'
28
33
dataset ='OMNI2_H0_MRG1HR'
29
34
start ='2003-09-01T00:00:00'
@@ -33,21 +38,43 @@ Basic Example
33
38
34
39
# Get data
35
40
data, meta = hapi(server, dataset, parameters, start, stop, **opts)
36
-
# Show documentation
37
-
#help(hapi)
41
+
print(meta)
42
+
print(data)
38
43
39
44
# Plot all parameters
45
+
from hapiplot import hapi
40
46
hapiplot(data, meta)
41
-
# Show documentation
42
-
#help(hapiplot)
47
+
43
48
44
49
Documentation
45
50
-------------
46
51
47
52
Basic usage examples for various HAPI servers are given in `hapi_demo.py <https://github.com/hapi-server/client-python/blob/master/hapi_demo.py>`__
48
53
54
+
See http://hapi-server.org/servers/ for a list of HAPI servers and datasets.
55
+
49
56
All of the features are extensively demonstrated in the `hapi_demo.ipynb <https://github.com/hapi-server/client-python-notebooks/blob/master/hapi_demo.ipynb>`__ Jupyter Notebook.
50
57
58
+
59
+
Data Model and Time Format
60
+
--------------------------
61
+
62
+
A request for data of the form
63
+
```
64
+
data, meta = hapi(server, dataset, parameters, start, stop)
65
+
```
66
+
67
+
returns the [Numpy N-D array](https://docs.scipy.org/doc/numpy-1.15.1/user/quickstart.html) `data` and a Python dictionary `meta` from a HAPI-compliant data server `server`. The structure of `data` and `meta` mirrors the structure of a response from a HAPI server.
68
+
69
+
The HAPI client data model is intentionally basic. There is an ongoing discussion of a data model for Heliophysics data among the `PyHC community <https://heliopython.org/>`_. When this data model is complete, a function that converts `data` and `meta` to that data model will be included in the `hapiclient` package.
70
+
71
+
Examples of transforming and manipulating `data` is given in a `Jupyter Notebook <https://colab.research.google.com/drive/11Zy99koiE90JKJ4u_KPTaEBMQFzbfU3P#scrollTo=aI_7DxnZtQZ3>`_. The examples include
72
+
73
+
# Fast and well-tested conversion from ISO 8601 timestamp strings to Python `datetime` objects
74
+
# Putting the content of `data` in a Pandas `DataFrame` object
0 commit comments