Skip to main content

Retrieve geomagnetic observatory data via web services

Project description

# gmdata_webinterface
[![Build Status](](

This Python package allows a users to programmatically download data from the
[British Geological Survey (BGS) Data Portal to the World Data Centre (WDC)
for geomagnetism, Edinburgh](

Currently hour and minute cadence WDC files from geomagnetic observatories
can be downloaded in this manner.

This code was originally developed by Laurence Billingham, and is now maintained
by William Brown.

### MagPySV
This package was designed in part to support observatory secular variation data processing work
of Grace Cox in `MagPySV` (see [Grace's GitHub repo](,
which will install this project as a dependecy to fetch WDC data on demand.

## Installation
The latest official release of the package can be installed from the Python Package
Index PyPI with
`pip install gmdata_webinterface`.

The latest working version of the package can also be installed directly from git with:
`pip install git+`

## Usage
The main function for getting data is `consume_webservices.fetch_data()`.

### Example usage:
from datetime import date
from gmdata_webinterface import consume_webservices as cws

cadence = 'hour'
stations = ['ESK', 'LER']
start_date = date(2015, 4, 1)
end_date = date(2015, 4, 30)
service = 'WDC'
download_dir = '/tmp/'
start_date=start_date, end_date=end_date,
station_list=stations, cadence=cadence,
service=service, saveroot=download_dir
See the docstring on `fetch_data` and the test in
for detailed useage.
This will download all available hourly data housed in the WDC for Geomagnetism,
Edinburgh, for dates between `start_date` and `end_date`, from 'ESK'(dalemuir) and
'LER'(wick) observatories, to the directory '/tmp/'.

## Contributing
This is a working project, with open source under an MIT license. You can report
bugs, suggest changes, and contribute to this project via github at

Expansion of the current package to access other ground observatory data services,
such as INTERMAGNET and the AUX_OBS_ product of the ESA Swarm mission, are currently
being developed. Any contributions or suggestion are welcome.

### Source code install
You can obtain the source code from github with e.g.:
`git clone ./my_source_dir/`
The code can then be built, documented and tested in various ways with the make `make` command,
when in the source code directory.
Type `make help` in the source directory to see the available options, e.g.

* To install the package from source use:
`make install`

* To install in editable, development mode use:
`make develop`

* To run the unit tests:
`make test`

* To build the html documentation:
`make docs`

## Reference
A manuscript describing [MagPySV]( and the
intergated functionality of this package is currently in preparation.

While the project is open source, we ask that you abide by the included MIT license,
and acknowledge the authors where due.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gmdata-webinterface, version 1.0.8
Filename, size File type Python version Upload date Hashes
Filename, size gmdata_webinterface-1.0.8.tar.gz (2.6 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page