Skip to main content

Python interface to plot meteorological data in GRIB, NetCDF and BUFR.

Project description

Magics is the latest generation of the ECMWF’s meteorological plotting software and can be either accessed directly through its Python or Fortran interfaces or by using Metview.

Features:

  • supports plotting of contours, wind fields, observations, satellite images, symbols, text, axis and graphs (including boxplots)

  • can plot GRIB 1 and 2 coded data, gaussian grid, regularly spaced grid and fitted data

Limitations:

  • development stage: Alpha,

Installation

The package is installed from PyPI with:

$ pip install Magics

System dependencies

The python module depends on the ECMWF Magics library that must be installed on the system and accessible as a shared library. Some Linux distributions ship a binary version that may be installed with the standard package manager. On Ubuntu 18.04 use the command:

$ sudo apt-get install libmagplus3v5

As an alternative you may install the official source distribution by following the instructions at https://software.ecmwf.int/magics/Installation+Guide

Note that Magics support for the Windows operating system is experimental.

You may run a simple selfcheck command to ensure that your system is set up correctly:

$ python -m Magics selfcheck
Found: Magics '4.0.0'.
Your system is ready.

Usage

First, you need a well-formed GRIB file, if you don’t have one at hand you can download our a 2m temperature grib file:

$ wget http://download.ecmwf.int/test-data/magics/2m_temperature.grib

You may try out the high level API in a python interpreter:

from Magics import macro as magics

name = 'magics'
#Setting of the output file name
output = magics.output(output_formats = ['png'],
             output_name_first_page_number = "off",
             output_name = "magics")

#Import the  data
data =  magics.mgrib(grib_input_file_name  = "2m_temperature.grib", )

#Apply an automatic styling
contour = magics.mcont( contour_automatic_setting = "ecmwf", )
coast = magics.mcoast()
magics.plot(output, data, contour, coast)

Running the test program will create a png named magics.png

You can find notebooks examples : https://github.com/ecmwf/notebook-examples/tree/master/visualisation

Contributing

The main repository is hosted on GitHub, testing, bug reports and contributions are highly welcomed and appreciated:

https://github.com/ecmwf/magics-python

Please see the CONTRIBUTING.rst document for the best way to help.

Lead developer:

Main contributors:

See also the list of contributors who participated in this project.

License

Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

Magics-1.0.6.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

Magics-1.0.6-py2.py3-none-any.whl (21.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file Magics-1.0.6.tar.gz.

File metadata

  • Download URL: Magics-1.0.6.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.0

File hashes

Hashes for Magics-1.0.6.tar.gz
Algorithm Hash digest
SHA256 b852ddc368116f9a3a8d9e778e7d82eb2f086601c5ff3cc61e2ed2928812d498
MD5 09c12d502690cef4cac0ada3d2bb4bd3
BLAKE2b-256 79b7ae9f57a39781092740c0def283a13c2f61cc93de6874bdbb8b2e362af313

See more details on using hashes here.

File details

Details for the file Magics-1.0.6-py2.py3-none-any.whl.

File metadata

  • Download URL: Magics-1.0.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.7.0

File hashes

Hashes for Magics-1.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4e2610694e5043c6d1a524e717bc1d32b559977a04f3a7495d95317f5277d771
MD5 dadbbb5ad5c4be6cfc1441e68f40ab26
BLAKE2b-256 c3dd373caa06915dd8a8ec2f344a1a2711dfb6a035e4a7ed786eb364a7715771

See more details on using hashes here.

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