Skip to content

Commit 197902d

Browse files
committed
WMM2025 World Magnetic Model
1 parent db7be2c commit 197902d

24 files changed

+126
-126
lines changed

MANIFEST.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
include src/wmm2020/meson.build src/wmm2020/CMakeLists.txt src/wmm2020/setup.cmake src/wmm2020/test_input.asc src/wmm2020/WMM.COF
2-
recursive-include src/wmm2020/src *.c
3-
recursive-include src/wmm2020/src *.h
1+
include src/wmm2025/meson.build src/wmm2025/CMakeLists.txt src/wmm2025/setup.cmake src/wmm2025/test_input.asc src/wmm2025/WMM.COF
2+
recursive-include src/wmm2025/src *.c
3+
recursive-include src/wmm2025/src *.h

README.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
# WMM2020
1+
# WMM2025
22

3-
![Actions Status](https://github.com/space-physics/wmm2020/workflows/ci/badge.svg)
4-
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/space-physics/wmm2020.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/space-physics/wmm2020/context:python)
5-
[![Python versions (PyPI)](https://img.shields.io/pypi/pyversions/wmm2020.svg)](https://pypi.python.org/pypi/wmm2020)
6-
[![Downloads](http://pepy.tech/badge/wmm2020)](http://pepy.tech/project/wmm2020)
3+
![Actions Status](https://github.com/space-physics/wmm2025/workflows/ci/badge.svg)
4+
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/space-physics/wmm2025.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/space-physics/wmm2025/context:python)
5+
[![Python versions (PyPI)](https://img.shields.io/pypi/pyversions/wmm2025.svg)](https://pypi.python.org/pypi/wmm2025)
6+
[![Downloads](http://pepy.tech/badge/wmm2025)](http://pepy.tech/project/wmm2025)
77

88

9-
WMM2020 World Magnetic Model...in simple, object-oriented Python.
9+
WMM2025 World Magnetic Model...in simple, object-oriented Python.
1010
[WMM2015](https://github.com/space-physics/wmm2015) is also available.
1111
Tested on Linux, Mac and Windows.
1212
Most C compilers work.
1313
At this time Visual Studio is not supported since MSVC doesn't export function symbols without additional headers,
1414
which is typically done with something like SWIG.
1515

16-
![image](./src/wmm2020/tests/incldecl.png)
16+
![image](./src/wmm2025/tests/incldecl.png)
1717

1818
## Install
1919

2020
for the latest release from PyPi:
2121

2222
```sh
23-
python -m pip install wmm2020
23+
python -m pip install wmm2025
2424
```
2525

2626
Optionally, to get the cutting-edge development version:
2727

2828
```sh
29-
git clone https://github.com/space-physics/wmm2020
29+
git clone https://github.com/space-physics/wmm2025
3030

31-
python -m pip install -e wmm2020
31+
python -m pip install -e wmm2025
3232
```
3333

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

3737

3838
## Usage
3939

4040
an example script
4141

4242
```sh
43-
python RunWMM2020.py
43+
python RunWMM2025.py
4444
```
4545

4646
or as a Python module:
4747

4848
```python
49-
import wmm2020
49+
import wmm2025
5050

51-
mag = wmm2020.wmm(glat, glon, alt_km, yeardec)
51+
mag = wmm2025.wmm(glat, glon, alt_km, yeardec)
5252
```
5353

5454
## Reference
5555

56-
* WMM2020 [inclination map](https://www.ngdc.noaa.gov/geomag/WMM/data/WMM2020/WMM2020_I_MERC.pdf)
57-
* WMM2020 [declination map](https://www.ngdc.noaa.gov/geomag/WMM/data/WMM2020/WMM2020_D_MERC.pdf)
56+
* WMM2025 [inclination map](https://www.ngdc.noaa.gov/geomag/WMM/data/WMM2025/WMM2025_I_MERC.pdf)
57+
* WMM2025 [declination map](https://www.ngdc.noaa.gov/geomag/WMM/data/WMM2025/WMM2025_D_MERC.pdf)

RunWMM2020.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from matplotlib.pyplot import show
44
import argparse
55

6-
import wmm2020 as wmm
7-
import wmm2020.plots as plt
6+
import wmm2025 as wmm
7+
import wmm2025.plots as plt
88

99

1010
p = argparse.ArgumentParser()
11-
p.add_argument("yeardec", help="decimal year e.g. 2020.62", type=float)
11+
p.add_argument("yeardec", help="decimal year e.g. 2025.62", type=float)
1212
p.add_argument("alt_km", help="altitude (km) default: 0.", type=float, default=0.0)
1313
P = p.parse_args()
1414

setup.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[metadata]
2-
name = wmm2020
2+
name = wmm2025
33
version = 1.1.1
44
author = Michael Hirsch, Ph.D.
5-
url = https://github.com/space-physics/wmm2020
6-
description = WMM2020 geomagnetic model with simple object-oriented Python interface
5+
url = https://github.com/space-physics/wmm2025
6+
description = WMM2025 geomagnetic model with simple object-oriented Python interface
77
keywords =
88
geomagnetic
99
classifiers =

src/wmm2020/WMM.COF

-93
This file was deleted.

src/wmm2020/test_input.asc

-1
This file was deleted.

src/wmm2020/tests/incldecl.png

-121 KB
Binary file not shown.

src/wmm2020/CMakeLists.txt src/wmm2025/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endif()
2020
add_library(wmm20 SHARED src/wmm_point_sub.c)
2121
target_link_libraries(wmm20 PRIVATE geo)
2222

23-
# https://www.ngdc.noaa.gov/geomag/WMM/data/WMM2020/WMM2020testvalues.pdf
23+
# https://www.ngdc.noaa.gov/geomag/WMM/data/WMM2025/WMM2025testvalues.pdf
2424
add_executable(wmm20_file src/wmm_file.c)
2525
target_link_libraries(wmm20_file geo)
2626

src/wmm2025/WMM.COF

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2025.0 WMM-2025 11/13/2024
2+
1 0 -29351.8 0.0 12.0 0.0
3+
1 1 -1410.8 4545.4 9.7 -21.5
4+
2 0 -2556.6 0.0 -11.6 0.0
5+
2 1 2951.1 -3133.6 -5.2 -27.7
6+
2 2 1649.3 -815.1 -8.0 -12.1
7+
3 0 1361.0 0.0 -1.3 0.0
8+
3 1 -2404.1 -56.6 -4.2 4.0
9+
3 2 1243.8 237.5 0.4 -0.3
10+
3 3 453.6 -549.5 -15.6 -4.1
11+
4 0 895.0 0.0 -1.6 0.0
12+
4 1 799.5 278.6 -2.4 -1.1
13+
4 2 55.7 -133.9 -6.0 4.1
14+
4 3 -281.1 212.0 5.6 1.6
15+
4 4 12.1 -375.6 -7.0 -4.4
16+
5 0 -233.2 0.0 0.6 0.0
17+
5 1 368.9 45.4 1.4 -0.5
18+
5 2 187.2 220.2 0.0 2.2
19+
5 3 -138.7 -122.9 0.6 0.4
20+
5 4 -142.0 43.0 2.2 1.7
21+
5 5 20.9 106.1 0.9 1.9
22+
6 0 64.4 0.0 -0.2 0.0
23+
6 1 63.8 -18.4 -0.4 0.3
24+
6 2 76.9 16.8 0.9 -1.6
25+
6 3 -115.7 48.8 1.2 -0.4
26+
6 4 -40.9 -59.8 -0.9 0.9
27+
6 5 14.9 10.9 0.3 0.7
28+
6 6 -60.7 72.7 0.9 0.9
29+
7 0 79.5 0.0 -0.0 0.0
30+
7 1 -77.0 -48.9 -0.1 0.6
31+
7 2 -8.8 -14.4 -0.1 0.5
32+
7 3 59.3 -1.0 0.5 -0.8
33+
7 4 15.8 23.4 -0.1 0.0
34+
7 5 2.5 -7.4 -0.8 -1.0
35+
7 6 -11.1 -25.1 -0.8 0.6
36+
7 7 14.2 -2.3 0.8 -0.2
37+
8 0 23.2 0.0 -0.1 0.0
38+
8 1 10.8 7.1 0.2 -0.2
39+
8 2 -17.5 -12.6 0.0 0.5
40+
8 3 2.0 11.4 0.5 -0.4
41+
8 4 -21.7 -9.7 -0.1 0.4
42+
8 5 16.9 12.7 0.3 -0.5
43+
8 6 15.0 0.7 0.2 -0.6
44+
8 7 -16.8 -5.2 -0.0 0.3
45+
8 8 0.9 3.9 0.2 0.2
46+
9 0 4.6 0.0 -0.0 0.0
47+
9 1 7.8 -24.8 -0.1 -0.3
48+
9 2 3.0 12.2 0.1 0.3
49+
9 3 -0.2 8.3 0.3 -0.3
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0 0.0
91+
12 12 -0.7 0.2 -0.1 -0.1
92+
999999999999999999999999999999999999999999999999
93+
999999999999999999999999999999999999999999999999
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/wmm2020/plots.py src/wmm2025/plots.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def plotwmm(mag: xarray.Dataset):
66

77
fg = figure()
88
ax = fg.subplots(1, 2, sharey=True)
9-
fg.suptitle("WMM2020 {}".format(mag.time))
9+
fg.suptitle("WMM2025 {}".format(mag.time))
1010
h = ax[0].contour(mag.glon, mag.glat, mag.decl, range(-90, 90 + 20, 20))
1111
ax[0].clabel(h, inline=True, fmt="%0.1f")
1212
ax[0].set_title("Magnetic Declination [degrees]")
File renamed without changes.
File renamed without changes.

src/wmm2020/src/GeomagnetismLibrary.c src/wmm2025/src/GeomagnetismLibrary.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* ABSTRACT
1313
*
14-
* The purpose of Geomagnetism Library is primarily to support the World Magnetic Model (WMM) 2015-2020.
14+
* The purpose of Geomagnetism Library is primarily to support the World Magnetic Model (WMM) 2015-2025.
1515
* It however is built to be used for spherical harmonic models of the Earth's magnetic field
1616
* generally and supports models even with a large (>>12) number of degrees. It is also used in many
1717
* other geomagnetic models distributed by NCEI.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/wmm2025/test_input.asc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025.5 E F30000 70.3 30.8

src/wmm2020/tests/test_all.py src/wmm2025/tests/test_all.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from pytest import approx
22
import xarray
33

4-
import wmm2020 as wmm
4+
import wmm2025 as wmm
55

66

7-
def test_wmm2020():
7+
def test_wmm2025():
88
mag = wmm.wmm(65, 85, alt_km=0, yeardec=2012.52868852459)
99

1010
assert isinstance(mag, xarray.Dataset)
@@ -18,7 +18,7 @@ def test_wmm2020():
1818
assert mag.decl.item() == approx(15.67178464900435)
1919

2020

21-
def test_wmm2020_point():
21+
def test_wmm2025_point():
2222
mag = wmm.wmm_point(65, 85, alt_km=0, yeardec=2012.52868852459)
2323
assert isinstance(mag, dict)
2424

0 commit comments

Comments
 (0)