Interface with an EDR Server and explore its contents from a Python session.
EDR stands for Environmental Data Retrieval. It is a standard API provided by the Open Geospatial Consortium (OGC) for interacting with environmental data in web and GIS applications. Much more information on EDR is available from the OGC.
No pip / conda installer (yet). Download the source code / clone this repo and add the repo root to your $PYTHONPATH
using your preferred method...
EDR Explorer is dependent on the following Python packages:
- NumPy,
- Cartopy,
- IPyWidgets (and JupyterLab if you wish to use the explorer interface in a notebook), and
- GeoViews, HoloViews, Panel and Param
The explorer interface is provided as a Panel dashboard, and intended for use either in a Jupyter notebook or as a standalone Panel application. In the future we hope to add a commandline-based interface as well.
To set up an explorer interface:
from edr_explorer import EDRExplorer
explorer = EDRExplorer()
explorer.layout
This can be used either in a notebook or in a Python script that can be served by Panel. For example, assuming that the Python script is called run.py
:
panel serve --show run.py
You can request all the data described by ... from the EDR Server by clicking the Get Dataset
button in the dashboard. This will make the data represented by the current state of the select widgets in the dashboard available in a common Python data format appropriate
for the type of data. Note that currently the only formats supported for this are Iris Cube
and CubeList
objects.
To access the data:
explorer.dataset
The dashboard sets a limited number of options for plotting the selected data, specifically the colormap of the plotted data and its alpha (transparency). The values for these options are publically accessible, and can be customised for a specifed interface instance as follows:
explorer.cmap = "inferno"
explorer.alpha = 0.75
This assumes that you have set up an dashboard called explorer
as per the Python code above. The colormap can be set as any valid reference to a colormap from matplotlib or colorcet, including as simple string names of the colormap, as shown here.
You can also pass the URI for a running EDR Server to the dashboard when you instantiate it. For example:
explorer = EDRExplorer("http://localhost:8000")
This will pre-populate the server location field in the dashboard.