Skip to content

Interface with an EDR Server and explore the its contents from a Python session

License

Notifications You must be signed in to change notification settings

informatics-lab/edr_explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edr_explorer

Interface with an EDR Server and explore its contents from a Python session.

About EDR

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.

Installation

No pip / conda installer (yet). Download the source code / clone this repo and add the repo root to your $PYTHONPATH using your preferred method...

Dependencies

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

Using it

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

Accessing the data

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

Tips and tricks

Plot options

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.

Pre-populate the EDR Server address

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.

About

Interface with an EDR Server and explore the its contents from a Python session

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published