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
Copy file name to clipboardExpand all lines: docs/available_parameters.rst
+34-9Lines changed: 34 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,12 @@ You can check which parameters are available with:
12
12
req.available_models()
13
13
req.available_auxiliaries()
14
14
15
+
The available measurements are segregated according to the "collection" (essentially Swarm products): each ``collection`` has a number of ``measurements`` associated with it, and the appropriate collection must be set in order to access the measurements. ``auxiliaries`` are available together with any set ``collection``. ``models`` provide magnetic model evaluation on demand, at the locations of the time series which is being accessed.
16
+
17
+
See the `Swarm Data Handbook`_ for details about the products.
18
+
19
+
.. _`Swarm Data Handbook`: https://earth.esa.int/web/guest/missions/esa-eo-missions/swarm/data-handbook/
20
+
15
21
----
16
22
17
23
``collections``
@@ -71,22 +77,41 @@ For IPD::
71
77
``models``
72
78
----------
73
79
74
-
Models are evaluated along the satellite track at the positions of the measurements.
80
+
Models are evaluated along the satellite track at the positions of the time series that has been requested. These must be used together with one of the MAG collections, and one or both of the "F" and "B_NEC" measurements. This can yield either the model values together with the measurements, or the data-model residuals.
(``residuals`` available when combined with MAG ``measurements`` ``F`` and/or ``B_NEC``)
97
+
# Fast-track models:
98
+
MMA_SHA_2F-Primary, MMA_SHA_2F-Secondary,
99
+
100
+
# CHAOS models:
101
+
CHAOS-6-Core,
102
+
CHAOS-6-Static,
103
+
CHAOS-6-MMA-Primary, CHAOS-6-MMA-Secondary
104
+
105
+
# Other lithospheric models:
106
+
MF7, LCS-1
86
107
87
-
Custom models can be provided as a .shc file and become accessible in the same way as pre-defined models, under the name ``"Custom_Model"``.
108
+
Custom (user uploaded) models can be provided as a .shc file and become accessible in the same way as pre-defined models, under the name ``"Custom_Model"``.
109
+
110
+
Flexible evaluation of models and defining new derived models is possible with the "model expressions" functionality whereby models can be defined like:
111
+
112
+
.. code-block:: python
88
113
89
-
Flexible evaluation of models and defining new derived models is possible with the "model expressions" functionality whereby models can be defined like ``"Combined_model = 'MMA_SHA_2F-Primary'(min_degree=1,max_degree=1) + 'MMA_SHA_2F-Secondary'(min_degree=1,max_degree=1)"``
While it is possible to enter the server URL and access credentials each time a new request object is created,
5
+
6
+
.. code-block:: python
7
+
8
+
from viresclient import SwarmRequest
9
+
10
+
# both URL and access token passed as request object's parameters
11
+
request = SwarmRequest(
12
+
url="https://vires.services/ows",
13
+
token="r-8-mlkP_RBx4mDv0di5Bzt3UZ52NGg-"
14
+
)
15
+
16
+
it is more convenient to omit them from the code and store them in a private configuration file. This configuration can be done using the :meth:`viresclient.set_token` convenience function, the underlying :meth:`viresclient.ClientConfig` module, or the command line interface (CLI) - see below. These will all set the configuration options in a file which is by default located at ``~/.viresclient.ini`` which can be edited directly, containing for example::
17
+
18
+
[https://vires.services/ows]
19
+
token = r-8-mlkP_RBx4mDv0di5Bzt3UZ52NGg-
20
+
21
+
[default]
22
+
url = https://vires.services/ows
23
+
24
+
When creating the configuration file manually make sure the file is readable by its owner only::
25
+
26
+
$ chmod 0600 ~/.viresclient.ini
27
+
$ ls -l ~/.viresclient.ini
28
+
-rw------- 1 owner owner 361 May 12 09:12 /home/owner/.viresclient.ini
29
+
30
+
When the configuration file is present, then the url and token options can be omitted from requests:
which calls the same code as above, but makes sure the token remains hidden so that it can't accidentally be shared.
78
+
79
+
80
+
For developers & DISC users
81
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
82
+
83
+
The accounts for the staging server (``staging.vires.services``), and DISC server (``staging.viresdisc.vires.services``) are separate. Tokens can be similarly generated on these and stored in the same configuration file alongside the others::
Using ``SwarmRequest()`` without the ``url`` parameter will use the default URL set above. To access a non-default server the URL parameter must be used:
94
+
95
+
.. code-block:: python
96
+
97
+
from viresclient import SwarmRequest
98
+
99
+
# request using the default server (https://vires.services/ows)
The older HTTP basic access authentication (i.e. username + password) is still available on the staging servers and these credentials can also be configured using :meth:ClientConfig. However, this is not available on the production server and may be removed in the future, so should not be used.
Recommended setup if starting without Python already
@@ -53,7 +54,7 @@ Recommended setup if starting without Python already
53
54
54
55
.. note:: For Jupyter notebook users:
55
56
56
-
The instructions for first time usage are also provided as a Jupyter notebook which you might find easier to use. Download the notebook to your environment and follow the instructions.
57
+
The guide for first time usage are also provided as a Jupyter notebook. Download the notebook to your environment and follow the instructions.
@@ -63,99 +64,24 @@ Recommended setup if starting without Python already
63
64
64
65
then launch the notebook, ``viresclient_examples/0_first_usage.ipynb``
65
66
66
-
Access to the service is through the same user account as on the web interface (https://vires.services/) and is enabled through a token. To get a token, log in to the website and click on your name on the top right to access the settings. From here, click on "Manage access tokens" and follow the instructions to create a new token.
67
+
Access to the service is through the same user account as on the web interface (https://vires.services/) and is enabled through an access token (essentially a password). To get a token, log in to the website and click on your name on the top right to access the settings. From here, click on "Manage access tokens" and follow the instructions to create a new token.
67
68
68
-
While it is possible to enter the server URL and access credentials each time a new request object is created
69
+
To set your token in the client, use either the Python interface:
69
70
70
71
.. code-block:: python
71
72
72
-
from viresclient import SwarmRequest
73
-
74
-
# both URL and access token passed as request object's parameters
75
-
request = SwarmRequest(
76
-
url="https://vires.services/ows",
77
-
token="r-8-mlkP_RBx4mDv0di5Bzt3UZ52NGg-"
78
-
)
79
-
80
-
it is more convenient to omit them from the code and store them in a private configuration file
# both default URL and access token read from configuration
88
-
request = SwarmRequest()
89
-
90
-
The server access configuration can be set either by command line interface (CLI), Python code, or editing of the configuration file, as described in the following sections.
73
+
from viresclient import set_token
74
+
set_token("https://vires.services/ows")
75
+
# (you will now be prompted to enter the token)
91
76
92
-
Configuration via CLI
93
-
^^^^^^^^^^^^^^^^^^^^^
94
-
95
-
The ``viresclient`` shell command can be used to set the server access configuration::
The client configuration is saved as a text file at ``~/.viresclient.ini``. This configuration file can edited in a text editor::
121
-
122
-
[https://vires.services/ows]
123
-
token = r-8-mlkP_RBx4mDv0di5Bzt3UZ52NGg-
124
-
125
-
[default]
126
-
url = https://vires.services/ows
127
-
128
-
When creating the configuration file manually make sure the file is readable by its owner only::
129
-
130
-
$ chmod 0600 ~/.viresclient.ini
131
-
$ ls -l ~/.viresclient.ini
132
-
-rw------- 1 owner owner 361 May 12 09:12 /home/owner/.viresclient.ini
133
-
134
-
135
-
.. note:: For DISC users / developers:
136
-
137
-
The user account for the DISC server is separate. A token can be generated in the same way and stored in the configuration alongside the token for other site::
Copy file name to clipboardExpand all lines: docs/release_notes.rst
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,23 @@
1
1
Release notes
2
2
=============
3
3
4
+
Changes from 0.4.0 to 0.4.1
5
+
---------------------------
6
+
7
+
- Added low level data upload API and CLI
8
+
- Added set_token convenience function for quick configuration
9
+
- Changed list of accessible models:
10
+
11
+
- Removed ``MCO_SHA_2F``, ``SIFM``
12
+
- Added ``MF7``, ``LCS-1``
13
+
4
14
Changes from 0.3.0 to 0.4.0
5
15
---------------------------
6
16
7
17
- Fixed issues with running on Windows
8
-
9
18
- Enforcing Python v3.5+ for installation
10
-
11
19
- Allowing higher versions of cdflib, pandas, and xarray
12
-
13
20
- Added CLI configuration for setting server address and token
14
-
15
21
- Metadata for source lineage is now easier to access (names of original ESA data files, details of models used, and filters applied). These are set as properties of :meth:`viresclient.ReturnedData` (i.e. ``data``) and as metadata (``.attrs``) in the ``Dataset`` returned from ``.as_xarray()``::
16
22
17
23
data.sources
@@ -24,9 +30,7 @@ Changes from 0.3.0 to 0.4.0
24
30
ds.RangeFilters
25
31
26
32
- Added access to collections ``SW_OPER_IPDxIRR_2F``
27
-
28
33
- Added auxiliary data ``F107`` which is the hourly F10.7 value. This is in addition to ``F10_INDEX`` which was already present, which is a daily average.
29
-
30
34
- Added possibility of accessing multiple collections simultaneously, e.g.::
0 commit comments