Skip to main content

WMM2020 geomagnetic model with simple object-oriented Python interface

Project description

WMM2020_CEXT

This library was modified to make a Python C Extension. This makes the library easy to install if you have the proper compilers installed. Additionally, I published Windows .whl binaries to pypi.org.

Install

wmm2020_cext has prebuilt Windows binaries (.whl files), so the library can easily be installed with pip.

python -m pip install wmm2020_cext

Use with wmm2020

import wmm2020
import numpy as np

wmm2020.wmm(np.array([0]), np.array([0]), 0, 0)

Manually Install

Install Visual Studio C Compilers https://wiki.python.org/moin/WindowsCompilers to compile the C extension. If this is done correctly you can simply pip install ./path/to/library or build your binaries python setup.py bdist_wheel (or pip wheel --no-deps ./path/to/library). The wheel library is required.

WMM2020

Actions Status Language grade: Python Python versions (PyPI) Downloads

WMM2020 World Magnetic Model...in simple, object-oriented Python. WMM2015 is also available. Tested on Linux, Mac and Windows. Most C compilers work. At this time Visual Studio is not supported since MSVC doesn't export function symbols without additional headers, which is typically done with something like SWIG.

image

Install

for the latest release from PyPi:

python -m pip install wmm2020

Optionally, to get the cutting-edge development version:

git clone https://github.com/space-physics/wmm2020

python -m pip install -e wmm2020

This Python wrapper of WMM2020 uses our build-on-run technique. The first time you use WMM2020, you will see messages from the Meson build system and your C compiler.

Usage

an example script

python RunWMM2020.py

or as a Python module:

import wmm2020

mag = wmm2020.wmm(glat, glon, alt_km, yeardec)

Reference

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

wmm2020_cext-1.1.3.tar.gz (3.1 MB view hashes)

Uploaded Source

Built Distributions

wmm2020_cext-1.1.3-cp39-cp39-win_amd64.whl (6.4 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

wmm2020_cext-1.1.3-cp39-cp39-win32.whl (6.4 MB view hashes)

Uploaded CPython 3.9 Windows x86

wmm2020_cext-1.1.3-cp38-cp38-win_amd64.whl (6.4 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

wmm2020_cext-1.1.3-cp38-cp38-win32.whl (6.4 MB view hashes)

Uploaded CPython 3.8 Windows x86

wmm2020_cext-1.1.3-cp37-cp37m-win_amd64.whl (6.4 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

wmm2020_cext-1.1.3-cp37-cp37m-win32.whl (6.4 MB view hashes)

Uploaded CPython 3.7m Windows x86

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