Aeolus access through VirES
Contents
Aeolus access through VirES¶
Abstract: VirES is a server/client architecture to help access Aeolus data. Access is enabled through a token generated on the website, and a Python package, viresclient, which provides the connection with the Python ecosystem (e.g. xarray).
# Display important package versions used
%load_ext watermark
%watermark -i -v -p viresclient,pandas,xarray,matplotlib
Python implementation: CPython
Python version : 3.9.7
IPython version : 8.0.1
viresclient: 0.11.0
pandas : 1.4.1
xarray : 0.21.1
matplotlib : 3.5.1
VirES (Virtual environments for Earth Scientists) is a platform for data access, analysis, and visualisation for ESA’s Aeolus mission.
This tutorial introduces the Python interface to VirES, viresclient
. We demonstrate usage of the primary Aeolus datasets and other algorithms for further analysis.
Run this on the VRE (Virtual Research Environment), where viresclient is already installed, or check the instructions to set it up on your own Python environment.
For more information see:
https://aeolus.services/ (Web interface)
https://viresclient.readthedocs.io (Python interface)
Configuration¶
In order to authenticate access to the VirES server, viresclient
requires an access token - this ties communications between the server and the client to your account. If you are using the VRE, this is handled automatically so you can skip this step.
If you are running viresclient
on a different machine, you will need to follow these instructions:
Create a user account at https://aeolus.services if you haven’t already done so
Install viresclient in your Python environment - see https://viresclient.readthedocs.io/en/latest/installation.html
Create a new code cell here and execute the following:
from viresclient import set_token set_token("https://aeolus.services/ows", set_default=True)
You will now be directed to the VirES token management page, and prompted to generate a new token and enter it here
Your access token should now have been saved to your environment and you won’t need to provide it again. The token and its associated access URL are stored in a file: ~/.viresclient.ini
(this file can also be edited directly). You may generate and set a new token, or revoke old tokens, at any point. These are similar to passwords, so should be kept secret - if you accidentally leak a token, you can revoke it at the token management page and generate a new one. It is also possible to set access tokens via CLI. For more information, see https://viresclient.readthedocs.io/en/latest/config_details.html
To remove the configuration (assuming you left it in its default location), you can use the CLI command: viresclient clear_credentials
Fetching some data¶
Import the AeolusRequest
object which provides the VirES interface, and datetime
which gives convenient time objects which can be used by AeolusRequest.get_between()
from viresclient import AeolusRequest
The following code will fetch a time period from L2B data.
start_time
and end_time
in .get_between()
together provide the time window you want to fetch data for - executing this line causes the request to be processed on the server and the data returned to you. Alternatively we can provide the start and end times as ISO_8601 strings.
# Set up connection with server
request = AeolusRequest()
# Set collection to use
request.set_collection('ALD_U_N_2B')
request.set_fields(rayleigh_wind_fields=[
"rayleigh_wind_result_start_time",
"rayleigh_wind_result_stop_time",
"rayleigh_wind_result_bottom_altitude",
"rayleigh_wind_result_top_altitude",
"rayleigh_wind_result_wind_velocity",
])
data = request.get_between(
start_time="2020-04-10T06:21:58Z",
end_time="2020-04-10T07:50:33Z",
filetype="nc"
)