Using fdsnws_fetch

Introduction

fdsnws_fetch is a Python script that simplifies downloading data and metadata from FDSN web services. It supports the following notable features:

  • Routing the request to datacenters that archive respective stations/channels.
  • Merging results from multiple datacenters into one MiniSEED, XML or text file.
  • Authentication with username and password or with a token.

Installation

fdsnws_fetch is a single script without any special dependencies. It is compatible with Python 2 (at least 2.6) and Python 3.

Note

The following examples assume that the script can be found in PATH and execute bit added (chmod a+x fdsnws_fetch).

Usage examples

Request 60 minutes of the "LHZ" channel of EIDA stations starting with "A" for a seismic event around 2010-02-27 07:00 (UTC). Optionally add "-v" for verbosity. Resulting Mini-SEED data will be written to file "data.mseed".

$ fdsnws_fetch.py -N "*" -S "A*" -L "*" -C "LHZ" \
  -s "2010-02-27T07:00:00Z" -e "2010-02-27T08:00:00Z" -v -o data.mseed

StationXML metadata for the above request can be requested using the following command:

$ fdsnws_fetch.py -N "*" -S "A*" -L "*" -C "LHZ" \
  -s "2010-02-27T07:00:00Z" -e "2010-02-27T08:00:00Z" \
  -y station -q level=response -v -o station.xml

Multiple query parameters can be used:

$ fdsnws_fetch.py -N "*" -S "*" -L "*" -C "*" \
  -s "2010-02-27T07:00:00Z" -e "2010-02-27T08:00:00Z" \
  -y station -q format=text -q level=channel \
  -q latitude=20 -q longitude=-150 -q maxradius=15 -v -o station.txt

Bulk requests can be made in ArcLink (-f), breq_fast (-b) or native FDSNWS POST (-p) format. Query parameters should not be included in the request file, but specified on the command line.

$ fdsnws_fetch.py -p request.txt -y station -q level=channel -v -o station.xml

The list of all command-line options can be obtained with

$ fdsnws_fetch.py --help