Skip to main content

Downloading air quality data from the SOS of IRCEL - CELINE

Project description

Downloading air quality data from the SOS of IRCEL - CELINE, the Belgian Interregional Environment Agency (http://www.irceline.be).

This packages provides both a command line interface, as a python module that downloads the data as pandas DataFrames.

Installation

ircelsos is a Python package. If you have Python installed, ircelsos can easily be installed with pip:

pip install ircelsos

This will automatically install the dependency OWSlib. ircelsos supports python 2.7 and 3.3+. For python 3, OWSlib 9.0 or higher is needed.

Command line usage

Installing ircelsos will register a ircelsos command. This can be used from the command line to download data and to retrieve info about the stations and pollutants available in the SOS, using the two subcommands query and info.

Downloading data

To download data, you can use the ircelsos query command. Eg:

ircelsos query o3 -s BETN060 -p 2015-03-27T00:00:00 2015-03-27T10:00:00

This will save a csv file in the current directory.

Specifying no stations or no period, will download the data for that pollutant for all stations for the full available period.

For more details on the arguments, call ircelsos query -h.

Retrieving info

The ircelsos info command can be used to inspect available stations and pollutants. The following will give a list of all pollutants:

$ ircelsos info --pollutant
SOS of IRCEL - CELINE

id                     | short | name                         | stations
-----------------------+-------+------------------------------+---------
16111 - Black Carbon   | bc    | Black Carbon                 | 25
42101 - CO             | co    | Carbon Monoxide              | 24
...

To get the detailed information about one pollutant, you can specify this after --pollutant. Eg:

$ ircelsos info --pollutant bc
SOS of IRCEL - CELINE

      id = 16111 - Black Carbon
   short = bc
    name = Black Carbon
stations = 25

This pollutant is measured at the following stations:

name   | EU_code | location             | region   | type
-------+---------+----------------------+----------+-----------
40AB01 | BELAB01 | ANTWERPEN            | suburban | Background
40AL01 | BELAL01 | LINKEROEVER          | suburban | Background
...

The same can be done to get information about the stations: ircelsos info --station for a list of all stations and ircelsos info --station STATION_CODE for the detailed information of one station.

Alternatively to the command line, you can also run the same script from the ircelsos directory:

python -m ircelsos query ...

Interactive usage (pandas)

To use the packages in an interactive python session, you need an extra dependency: pandas (to install pandas, it is recommended to use a scientific python distribution like Anaconda or Canopy that includes pandas).

To download data as a pandas DataFrame, you can use the query function:

>>> import ircelsos
>>> df = ircelsos.query('no2', station=['42R801', '42R802'], utc_start='2015-11-15')
>>> df.head()
                               42R801  42R802
time
2015-11-24T01:00:00.000+01:00    27.0    28.5
2015-11-24T02:00:00.000+01:00    17.5    19.5
2015-11-24T03:00:00.000+01:00    16.0    16.5
2015-11-24T04:00:00.000+01:00    17.0    17.5
2015-11-24T05:00:00.000+01:00    24.0    24.5

  • Author: Joris Van den Bossche

  • License: BSD 2-clause

Project details


Download files

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

Source Distribution

ircelsos-0.1.0.zip (18.2 kB view details)

Uploaded Source

Built Distribution

ircelsos-0.1.0-py2.py3-none-any.whl (16.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ircelsos-0.1.0.zip.

File metadata

  • Download URL: ircelsos-0.1.0.zip
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ircelsos-0.1.0.zip
Algorithm Hash digest
SHA256 33d745cc4a121af315dcd88145327ecc17a44e20e36ac121c357da3076e0a3e9
MD5 a304791585ab127eade7cc08706905e8
BLAKE2b-256 42d3b81dbe1b86e1a64b52fae428fc990bdc6e43cabba563825dd532f219fc7e

See more details on using hashes here.

Provenance

File details

Details for the file ircelsos-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ircelsos-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 24f04592838eea6d4c0babf33ec84f1a6fe7d793be499268b60b5c27c8ee07cf
MD5 da6200bf42d2a67d895bc95011bb5070
BLAKE2b-256 4bf87adfe36da752d38fdc578998ae29b65452333c61914d5a97d0397587024d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page