From 30be10a25ec0df0157f4d94bef7cdc0490a03933 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 13:25:27 -0500 Subject: [PATCH 01/39] ENH: Updated release date to go with RC creation --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c85ebe2..415fda3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [1.1.0] - ????? +## [1.1.0] - 2025-04-04 - Switched away from distutils to Meson for build system - Updated coupling to coveralls - Updated package version for security issue in sphinx From ccf2c3320eab049582a66a0bf412da4aaa1e1305 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 13:31:34 -0500 Subject: [PATCH 02/39] DOC: Added updated documentation to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 415fda3e..110fb2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Updated package version for security issue in sphinx - Added online unit testing for Linux and MacOS - Updated to IGRF14 +- Updated documentation ## [1.0.1] - 2022-01-04 - Added pyproject.toml to support systems without numpy. From 17f980ea4708d95b62f8190d32a872446a2b21ec Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 15:44:55 -0500 Subject: [PATCH 03/39] TST: Debugging unit testing reporting --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2edf3a35..fb49e2bc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,11 +108,11 @@ jobs: - name: Run unit and integration tests Mac/Linux if: ${{ matrix.os != 'windows-latest' }} run: | - rm -rf ./OMMBV + mkdir new_dir cd new_dir - coverage run -m pytest ../ + coverage run -m pytest ../tests coverage report coverage xml ls From 24ba2226ce7f5ea5875c31fec11a2cb318146cea Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:04:04 -0500 Subject: [PATCH 04/39] TST: Try putting fortran in own directory --- meson.build | 14 +++++++------- {OMMBV => ommbvfortran}/_coords.f | 0 {OMMBV => ommbvfortran}/igrf14.f | 0 {OMMBV => ommbvfortran}/sources.f | 0 4 files changed, 7 insertions(+), 7 deletions(-) rename {OMMBV => ommbvfortran}/_coords.f (100%) rename {OMMBV => ommbvfortran}/igrf14.f (100%) rename {OMMBV => ommbvfortran}/sources.f (100%) diff --git a/meson.build b/meson.build index 678e3921..508de9f6 100644 --- a/meson.build +++ b/meson.build @@ -41,13 +41,13 @@ fortranobject_dep = declare_dependency( igrf_source = custom_target('igrfmodule.c', - input : ['OMMBV/igrf14.f'], # .f so no F90 wrappers + input : ['ommbvfortran/igrf14.f'], # .f so no F90 wrappers output : ['igrfmodule.c', 'igrf-f2pywrappers.f'], command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'igrf', '--lower'] ) py.extension_module('igrf', [ - 'OMMBV/igrf14.f', + 'ommbvfortran/igrf14.f', igrf_source, fortranobject_c ], @@ -60,14 +60,14 @@ py.extension_module('igrf', sources_source = custom_target('sourcesmodule.c', - input : ['OMMBV/sources.f', 'OMMBV/igrf14.f'], # .f so no F90 wrappers + input : ['ommbvfortran/sources.f', 'OMMBV/igrf14.f'], # .f so no F90 wrappers output : ['sourcesmodule.c', 'sources-f2pywrappers.f'], command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'sources', '--lower'] ) py.extension_module('sources', [ - 'OMMBV/sources.f', - 'OMMBV/igrf14.f', + 'ommbvfortran/sources.f', + 'ommbvfortran/igrf14.f', sources_source, fortranobject_c ], @@ -80,13 +80,13 @@ py.extension_module('sources', fcoords_source = custom_target('fortran_coordsmodule.c', - input : ['OMMBV/_coords.f'], # .f so no F90 wrappers + input : ['ommbvfortran/_coords.f'], # .f so no F90 wrappers output : ['fortran_coordsmodule.c', 'fortran_coords-f2pywrappers.f'], command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'fortran_coords', '--lower'] ) py.extension_module('fortran_coords', [ - 'OMMBV/_coords.f', + 'ommbvfortran/_coords.f', fcoords_source, fortranobject_c ], diff --git a/OMMBV/_coords.f b/ommbvfortran/_coords.f similarity index 100% rename from OMMBV/_coords.f rename to ommbvfortran/_coords.f diff --git a/OMMBV/igrf14.f b/ommbvfortran/igrf14.f similarity index 100% rename from OMMBV/igrf14.f rename to ommbvfortran/igrf14.f diff --git a/OMMBV/sources.f b/ommbvfortran/sources.f similarity index 100% rename from OMMBV/sources.f rename to ommbvfortran/sources.f From 7deff53d0d2382505606dbdd71ec16491a303aba Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:06:10 -0500 Subject: [PATCH 05/39] TST: Try putting fortran in own directory --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 508de9f6..10b9be4e 100644 --- a/meson.build +++ b/meson.build @@ -60,7 +60,7 @@ py.extension_module('igrf', sources_source = custom_target('sourcesmodule.c', - input : ['ommbvfortran/sources.f', 'OMMBV/igrf14.f'], # .f so no F90 wrappers + input : ['ommbvfortran/sources.f', 'ommbvfortran/igrf14.f'], # .f so no F90 wrappers output : ['sourcesmodule.c', 'sources-f2pywrappers.f'], command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', 'sources', '--lower'] ) From bd0657bcbdefb7dc28f0b1943d57948ec4b33b33 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:08:12 -0500 Subject: [PATCH 06/39] TST: Try putting fortran in own directory --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb49e2bc..89e221de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,7 +108,7 @@ jobs: - name: Run unit and integration tests Mac/Linux if: ${{ matrix.os != 'windows-latest' }} run: | - + rm -rf ./OMMBV mkdir new_dir cd new_dir From 2acf3fe4cdcf6be9c8bd4349be8067951df83eff Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:15:41 -0500 Subject: [PATCH 07/39] TST: Try putting fortran in own directory --- .github/workflows/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89e221de..49296da9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,15 +108,13 @@ jobs: - name: Run unit and integration tests Mac/Linux if: ${{ matrix.os != 'windows-latest' }} run: | - rm -rf ./OMMBV - mkdir new_dir - cd new_dir - coverage run -m pytest ../tests + cd .. + coverage run -m pytest coverage report coverage xml ls - cp coverage.xml ../coverage.xml + cp coverage.xml OMMBV\. cat coverage.xml - name: Run unit and integration tests on Windows From 3c8255f5922dd68067ff3d2d5999dd268d688bb4 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:30:32 -0500 Subject: [PATCH 08/39] TST: Try removing init --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 From 823eeec226724e7876bf07531770e6b74e6d66bd Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:31:04 -0500 Subject: [PATCH 09/39] TST: Try different dir setup --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 49296da9..05a823f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,12 +109,12 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | - cd .. - coverage run -m pytest + cd ../.. + coverage run -m pytest OMMBV/tests coverage report coverage xml ls - cp coverage.xml OMMBV\. + cp coverage.xml OMMBV/. cat coverage.xml - name: Run unit and integration tests on Windows From a094c589d0f9afbfa0a2aec383ccbdea73a74eca Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:34:19 -0500 Subject: [PATCH 10/39] TST: Try different dir setup --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 05a823f8..a6b50984 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,12 +109,12 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | - cd ../.. - coverage run -m pytest OMMBV/tests + cd .. + coverage run -m pytest ../tests coverage report coverage xml ls - cp coverage.xml OMMBV/. + cp coverage.xml ../coverage.xml cat coverage.xml - name: Run unit and integration tests on Windows From 28567f3159028bf6a518f0a8da47209a473a08d1 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:35:50 -0500 Subject: [PATCH 11/39] TST: Try different dir setup --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6b50984..bc84a632 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,7 +110,7 @@ jobs: run: | cd .. - coverage run -m pytest ../tests + coverage run -m pytest OMMBV/tests coverage report coverage xml ls From 6ae7e5618cc907c08cf09f14a912781d6c25be59 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 16:46:41 -0500 Subject: [PATCH 12/39] TST: Try not importing tests --- .github/workflows/main.yml | 2 +- tests/test_core.py | 6 +++--- tests/test_former_methods.py | 2 +- tests/test_trace.py | 2 +- tests/test_trans.py | 2 +- tests/test_vector.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bc84a632..025d61f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -110,7 +110,7 @@ jobs: run: | cd .. - coverage run -m pytest OMMBV/tests + coverage run -m pytest coverage report coverage xml ls diff --git a/tests/test_core.py b/tests/test_core.py index 2e86e6eb..1ec29b37 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -8,9 +8,9 @@ import pytest import warnings +import pysat + import OMMBV -import tests -import tests.test_deprecation as testing import OMMBV.trace import OMMBV.trans import OMMBV.vector @@ -348,7 +348,7 @@ def test_nonconvergence_basis_ecef(self): assert len(war) >= len(self.warn_msgs) # Test the warning messages, ensuring each attribute is present. - testing.eval_warnings(war, self.warn_msgs, RuntimeWarning) + pysat.utils.testing.eval_warnings(war, self.warn_msgs, RuntimeWarning) return diff --git a/tests/test_former_methods.py b/tests/test_former_methods.py index d2eba15c..95ed6dbc 100644 --- a/tests/test_former_methods.py +++ b/tests/test_former_methods.py @@ -4,7 +4,7 @@ import OMMBV import OMMBV.heritage -from tests.test_core import gen_plot_grid_fixed_alt +from test_core import gen_plot_grid_fixed_alt import OMMBV.vector diff --git a/tests/test_trace.py b/tests/test_trace.py index e42aae25..193984bb 100644 --- a/tests/test_trace.py +++ b/tests/test_trace.py @@ -5,7 +5,7 @@ import numpy as np import pytest -from tests.test_core import gen_data_fixed_alt +from test_core import gen_data_fixed_alt import OMMBV.trans import OMMBV.trace as trace diff --git a/tests/test_trans.py b/tests/test_trans.py index 80d2e3dd..647130a7 100644 --- a/tests/test_trans.py +++ b/tests/test_trans.py @@ -6,7 +6,7 @@ from OMMBV import igrf from OMMBV import sources import OMMBV.trans -from tests.test_core import gen_data_fixed_alt +from test_core import gen_data_fixed_alt # ############## TRANSFORMATIONS ############## # diff --git a/tests/test_vector.py b/tests/test_vector.py index c813cfdd..3ba13d46 100644 --- a/tests/test_vector.py +++ b/tests/test_vector.py @@ -5,7 +5,7 @@ import OMMBV from OMMBV import sources -from tests.test_core import gen_data_fixed_alt +from test_core import gen_data_fixed_alt class TestVector(object): From 7c49e920d46e9f247f3d08c76685d0484f57f1d7 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:04:36 -0500 Subject: [PATCH 13/39] TST: Tweaking commands, but tests run, no coverage --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 025d61f1..2e7bfc4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -114,8 +114,9 @@ jobs: coverage report coverage xml ls - cp coverage.xml ../coverage.xml cat coverage.xml + mv coverage.xml OMMBV/. + - name: Run unit and integration tests on Windows if: ${{ matrix.os == 'windows-latest' }} From 3f49fd5f8f532aebeb2f0eefa6982f02aa0756c8 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:14:10 -0500 Subject: [PATCH 14/39] TST: Tweaking commands, but tests run, no coverage --- .github/workflows/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e7bfc4c..a6c8ee20 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,14 +109,9 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | - cd .. - coverage run -m pytest + pytest tests coverage report coverage xml - ls - cat coverage.xml - mv coverage.xml OMMBV/. - - name: Run unit and integration tests on Windows if: ${{ matrix.os == 'windows-latest' }} From 7330f3d9d85582ea9560ec2b5f48e190fbdddbae Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:24:36 -0500 Subject: [PATCH 15/39] TST: Try out github actions --- .github/workflows/main.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a6c8ee20..f94ea292 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,7 +109,7 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | - pytest tests + coverage run -m pytest coverage report coverage xml @@ -124,20 +124,22 @@ jobs: coverage xml mv coverage.xml .\OMMBV\. - - name: Publish results to coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_PARALLEL: true - run: coveralls --service=github --verbose + - name: Publish results to coveralls upon success + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run=${{ join(matrix.*, '-') }} + parallel: true + format: cobertura finish: name: Finish Coverage Analysis needs: build + if: ${{ always() }} runs-on: ubuntu-latest steps: - name: Coveralls Finished - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - pip install --upgrade coveralls - coveralls --service=github --finish --verbose + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true \ No newline at end of file From 720f7ed0ec2c30a5b59a2304fd0cbe2f9424ac63 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:28:06 -0500 Subject: [PATCH 16/39] TST: Try out github actions --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f94ea292..38d6b5f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,10 +108,11 @@ jobs: - name: Run unit and integration tests Mac/Linux if: ${{ matrix.os != 'windows-latest' }} run: | - + cd .. coverage run -m pytest coverage report coverage xml + mv coverage.xml OMMBV/. - name: Run unit and integration tests on Windows if: ${{ matrix.os == 'windows-latest' }} From 3100982e78fc468f52daa7e2a7ea117629c565ea Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:36:24 -0500 Subject: [PATCH 17/39] TST: Try out get real coverage --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 38d6b5f9..1df2c306 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,7 +109,7 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | cd .. - coverage run -m pytest + coverage run -m pytest --source=OMMBV coverage report coverage xml mv coverage.xml OMMBV/. From 9060553c7dba5da909e0485f5c6f711937adbf81 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:40:33 -0500 Subject: [PATCH 18/39] TST: Try out get real coverage --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1df2c306..17801dda 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,7 +109,7 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | cd .. - coverage run -m pytest --source=OMMBV + coverage run -m --source=OMMBV pytest coverage report coverage xml mv coverage.xml OMMBV/. From bcaf5e38eb0d12ed6fdb805cea47c0d9a22dd7d5 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:58:20 -0500 Subject: [PATCH 19/39] TST: Try to get real coverage --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17801dda..445bca05 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,7 +109,7 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | cd .. - coverage run -m --source=OMMBV pytest + coverage run -m --source=OMMBV pytest --cov-exclude=OMMBV/OMMBV/*.py coverage report coverage xml mv coverage.xml OMMBV/. From 6de9088ed760278a2803a19725d10ac796e2e12c Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 17:59:42 -0500 Subject: [PATCH 20/39] TST: Try to get real coverage --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 445bca05..84c35040 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,7 +109,7 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | cd .. - coverage run -m --source=OMMBV pytest --cov-exclude=OMMBV/OMMBV/*.py + coverage run -m --source=OMMBV --cov-exclude=OMMBV/OMMBV/*.py pytest coverage report coverage xml mv coverage.xml OMMBV/. From 982dda6bedc2ae70c9cb175434b7d8c96016f90f Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 18:07:58 -0500 Subject: [PATCH 21/39] TST: Try to get real coverage --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84c35040..073bfa4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,7 +109,7 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | cd .. - coverage run -m --source=OMMBV --cov-exclude=OMMBV/OMMBV/*.py pytest + coverage run -m --source=OMMBV --omit=OMMBV/*.py pytest coverage report coverage xml mv coverage.xml OMMBV/. From fabee9f82549656a9083b7092882c1069a5b6121 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 18:18:28 -0500 Subject: [PATCH 22/39] TST: Try to get real coverage --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 073bfa4f..4c011194 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,8 +108,9 @@ jobs: - name: Run unit and integration tests Mac/Linux if: ${{ matrix.os != 'windows-latest' }} run: | + rm -rf ./OMMBV cd .. - coverage run -m --source=OMMBV --omit=OMMBV/*.py pytest + coverage run -m --source=OMMBV pytest coverage report coverage xml mv coverage.xml OMMBV/. From 09335d62a78a2681ea0403989f3764a7efc3f642 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 18:41:48 -0500 Subject: [PATCH 23/39] TST: Try to get real coverage --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c011194..6c7c8c4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,11 +109,12 @@ jobs: if: ${{ matrix.os != 'windows-latest' }} run: | rm -rf ./OMMBV - cd .. - coverage run -m --source=OMMBV pytest + mkdir new_dir + cd new_dir + coverage run -m --source=OMMBV pytest ../tests coverage report coverage xml - mv coverage.xml OMMBV/. + mv coverage.xml ../OMMBV/coverage.xml - name: Run unit and integration tests on Windows if: ${{ matrix.os == 'windows-latest' }} From 45d06bb6ad10113c339cfecbed990b9b4edaf203 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 18:49:02 -0500 Subject: [PATCH 24/39] TST: Try to get real coverage --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c7c8c4d..7e1cb26e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -114,6 +114,7 @@ jobs: coverage run -m --source=OMMBV pytest ../tests coverage report coverage xml + mkdir ../OMMBV mv coverage.xml ../OMMBV/coverage.xml - name: Run unit and integration tests on Windows From 39f8c39cd7c075a9cc0597680d7b7efc077dc73d Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 19:00:57 -0500 Subject: [PATCH 25/39] TST: Omit __init__ from reporting --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e1cb26e..3140c44f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -111,7 +111,7 @@ jobs: rm -rf ./OMMBV mkdir new_dir cd new_dir - coverage run -m --source=OMMBV pytest ../tests + coverage run -m --source=OMMBV omit=__init__.py pytest ../tests coverage report coverage xml mkdir ../OMMBV From c63d9e45a03642b2540d624ad9444240464cb07b Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Fri, 4 Apr 2025 19:06:21 -0500 Subject: [PATCH 26/39] TST: Omit __init__ from reporting --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3140c44f..b75e8330 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -111,7 +111,7 @@ jobs: rm -rf ./OMMBV mkdir new_dir cd new_dir - coverage run -m --source=OMMBV omit=__init__.py pytest ../tests + coverage run -m --source=OMMBV --omit=__init__.py pytest ../tests coverage report coverage xml mkdir ../OMMBV From e9861ed165c70807a58b6c0ded5730780755090d Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:07:28 -0500 Subject: [PATCH 27/39] ENH: Update fortran code locations for old setup --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index d7db02ee..b418258b 100644 --- a/setup.py +++ b/setup.py @@ -22,14 +22,14 @@ '-Wno-unused-variable', '-Wno-maybe-uninitialized', '-Wno-unused-dummy-argument'] extensions = [Extension(name='OMMBV.igrf', - sources=[os.path.join('OMMBV', 'igrf14.f')], + sources=[os.path.join('ommbvfortran', 'igrf14.f')], extra_f77_compile_args=extra_args), Extension(name='OMMBV.sources', - sources=[os.path.join('OMMBV', 'sources.f'), - os.path.join('OMMBV', 'igrf14.f')], + sources=[os.path.join('ommbvfortran', 'sources.f'), + os.path.join('ommbvfortran', 'igrf14.f')], extra_f77_compile_args=extra_args), Extension(name='OMMBV.fortran_coords', - sources=[os.path.join('OMMBV', '_coords.f')])] + sources=[os.path.join('ommbvfortran', '_coords.f')])] setup_kwargs = {'ext_modules': extensions} setup(**setup_kwargs) From b46689f1aae967c5339ae1dc22433e0d07e29f91 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:32:18 -0500 Subject: [PATCH 28/39] ENH: Remove old IGRF version --- OMMBV/igrf13.f | 699 ------------------------------------------------- 1 file changed, 699 deletions(-) delete mode 100644 OMMBV/igrf13.f diff --git a/OMMBV/igrf13.f b/OMMBV/igrf13.f deleted file mode 100644 index 9c12f639..00000000 --- a/OMMBV/igrf13.f +++ /dev/null @@ -1,699 +0,0 @@ - - - subroutine igrf13syn (isv,date,itype,alt,colat,elong,x,y,z,f) -c -c This is a synthesis routine for the 13th generation IGRF as agreed -c in December 2019 by IAGA Working Group V-MOD. It is valid 1900.0 to -c 2025.0 inclusive. Values for dates from 1945.0 to 2015.0 inclusive are -c definitive, otherwise they are non-definitive. -c INPUT -c isv = 0 if main-field values are required -c isv = 1 if secular variation values are required -c date = year A.D. Must be greater than or equal to 1900.0 and -c less than or equal to 2030.0. Warning message is given -c for dates greater than 2025.0. Must be double precision. -c itype = 1 if geodetic (spheroid) -c itype = 2 if geocentric (sphere) -c alt = height in km above sea level if itype = 1 -c = distance from centre of Earth in km if itype = 2 (>3485 km) -c colat = colatitude (0-180) /changed by RS(radians) -c elong = east-longitude (0-360) /changed by RS(radians) -c alt, colat and elong must be double precision. -c OUTPUT -c x = north component (nT) if isv = 0, nT/year if isv = 1 -c y = east component (nT) if isv = 0, nT/year if isv = 1 -c z = vertical component (nT) if isv = 0, nT/year if isv = 1 -c f = total intensity (nT) if isv = 0, rubbish if isv = 1 -c -c To get the other geomagnetic elements (D, I, H and secular -c variations dD, dH, dI and dF) use routines ptoc and ptocsv. -c -c Adapted from 8th generation version to include new maximum degree for -c main-field models for 2000.0 and onwards and use WGS84 spheroid instead -c of International Astronomical Union 1966 spheroid as recommended by IAGA -c in July 2003. Reference radius remains as 6371.2 km - it is NOT the mean -c radius (= 6371.0 km) but 6371.2 km is what is used in determining the -c coefficients. Adaptation by Susan Macmillan, August 2003 (for -c 9th generation), December 2004, December 2009 & December 2014; -c by William Brown, December 2019, February 2020. -c -c Coefficients at 1995.0 incorrectly rounded (rounded up instead of -c to even) included as these are the coefficients published in Excel -c spreadsheet July 2005. -c - implicit double precision (a-h,o-z) - dimension gh(3645),g0(120),g1(120),g2(120),g3(120),g4(120), - 1 g5(120),g6(120),g7(120),g8(120),g9(120),ga(120), - 2 gb(120),gc(120),gd(120),ge(120),gf(120),gg(120), - 3 gi(120),gj(120),gk(195),gl(195),gm(195),gp(195), - 4 gq(195),gr(195),gs(195), - 5 p(105),q(105),cl(13),sl(13) - equivalence (g0,gh(1)),(g1,gh(121)),(g2,gh(241)),(g3,gh(361)), - 1 (g4,gh(481)),(g5,gh(601)),(g6,gh(721)),(g7,gh(841)), - 2 (g8,gh(961)),(g9,gh(1081)),(ga,gh(1201)), - 3 (gb,gh(1321)),(gc,gh(1441)),(gd,gh(1561)), - 4 (ge,gh(1681)),(gf,gh(1801)),(gg,gh(1921)), - 5 (gi,gh(2041)),(gj,gh(2161)),(gk,gh(2281)), - 6 (gl,gh(2476)),(gm,gh(2671)),(gp,gh(2866)), - 7 (gq,gh(3061)),(gr,gh(3256)),(gs,gh(3451)) -c - data g0/ -31543.,-2298., 5922., -677., 2905.,-1061., 924., 1121., 1900 - 1 1022.,-1469., -330., 1256., 3., 572., 523., 876., 1900 - 2 628., 195., 660., -69., -361., -210., 134., -75., 1900 - 3 -184., 328., -210., 264., 53., 5., -33., -86., 1900 - 4 -124., -16., 3., 63., 61., -9., -11., 83., 1900 - 5 -217., 2., -58., -35., 59., 36., -90., -69., 1900 - 6 70., -55., -45., 0., -13., 34., -10., -41., 1900 - 7 -1., -21., 28., 18., -12., 6., -22., 11., 1900 - 8 8., 8., -4., -14., -9., 7., 1., -13., 1900 - 9 2., 5., -9., 16., 5., -5., 8., -18., 1900 - a 8., 10., -20., 1., 14., -11., 5., 12., 1900 - b -3., 1., -2., -2., 8., 2., 10., -1., 1900 - c -2., -1., 2., -3., -4., 2., 2., 1., 1900 - d -5., 2., -2., 6., 6., -4., 4., 0., 1900 - e 0., -2., 2., 4., 2., 0., 0., -6./ 1900 - data g1/ -31464.,-2298., 5909., -728., 2928.,-1086., 1041., 1065., 1905 - 1 1037.,-1494., -357., 1239., 34., 635., 480., 880., 1905 - 2 643., 203., 653., -77., -380., -201., 146., -65., 1905 - 3 -192., 328., -193., 259., 56., -1., -32., -93., 1905 - 4 -125., -26., 11., 62., 60., -7., -11., 86., 1905 - 5 -221., 4., -57., -32., 57., 32., -92., -67., 1905 - 6 70., -54., -46., 0., -14., 33., -11., -41., 1905 - 7 0., -20., 28., 18., -12., 6., -22., 11., 1905 - 8 8., 8., -4., -15., -9., 7., 1., -13., 1905 - 9 2., 5., -8., 16., 5., -5., 8., -18., 1905 - a 8., 10., -20., 1., 14., -11., 5., 12., 1905 - b -3., 1., -2., -2., 8., 2., 10., 0., 1905 - c -2., -1., 2., -3., -4., 2., 2., 1., 1905 - d -5., 2., -2., 6., 6., -4., 4., 0., 1905 - e 0., -2., 2., 4., 2., 0., 0., -6./ 1905 - data g2/ -31354.,-2297., 5898., -769., 2948.,-1128., 1176., 1000., 1910 - 1 1058.,-1524., -389., 1223., 62., 705., 425., 884., 1910 - 2 660., 211., 644., -90., -400., -189., 160., -55., 1910 - 3 -201., 327., -172., 253., 57., -9., -33., -102., 1910 - 4 -126., -38., 21., 62., 58., -5., -11., 89., 1910 - 5 -224., 5., -54., -29., 54., 28., -95., -65., 1910 - 6 71., -54., -47., 1., -14., 32., -12., -40., 1910 - 7 1., -19., 28., 18., -13., 6., -22., 11., 1910 - 8 8., 8., -4., -15., -9., 6., 1., -13., 1910 - 9 2., 5., -8., 16., 5., -5., 8., -18., 1910 - a 8., 10., -20., 1., 14., -11., 5., 12., 1910 - b -3., 1., -2., -2., 8., 2., 10., 0., 1910 - c -2., -1., 2., -3., -4., 2., 2., 1., 1910 - d -5., 2., -2., 6., 6., -4., 4., 0., 1910 - e 0., -2., 2., 4., 2., 0., 0., -6./ 1910 - data g3/ -31212.,-2306., 5875., -802., 2956.,-1191., 1309., 917., 1915 - 1 1084.,-1559., -421., 1212., 84., 778., 360., 887., 1915 - 2 678., 218., 631., -109., -416., -173., 178., -51., 1915 - 3 -211., 327., -148., 245., 58., -16., -34., -111., 1915 - 4 -126., -51., 32., 61., 57., -2., -10., 93., 1915 - 5 -228., 8., -51., -26., 49., 23., -98., -62., 1915 - 6 72., -54., -48., 2., -14., 31., -12., -38., 1915 - 7 2., -18., 28., 19., -15., 6., -22., 11., 1915 - 8 8., 8., -4., -15., -9., 6., 2., -13., 1915 - 9 3., 5., -8., 16., 6., -5., 8., -18., 1915 - a 8., 10., -20., 1., 14., -11., 5., 12., 1915 - b -3., 1., -2., -2., 8., 2., 10., 0., 1915 - c -2., -1., 2., -3., -4., 2., 2., 1., 1915 - d -5., 2., -2., 6., 6., -4., 4., 0., 1915 - e 0., -2., 1., 4., 2., 0., 0., -6./ 1915 - data g4/ -31060.,-2317., 5845., -839., 2959.,-1259., 1407., 823., 1920 - 1 1111.,-1600., -445., 1205., 103., 839., 293., 889., 1920 - 2 695., 220., 616., -134., -424., -153., 199., -57., 1920 - 3 -221., 326., -122., 236., 58., -23., -38., -119., 1920 - 4 -125., -62., 43., 61., 55., 0., -10., 96., 1920 - 5 -233., 11., -46., -22., 44., 18., -101., -57., 1920 - 6 73., -54., -49., 2., -14., 29., -13., -37., 1920 - 7 4., -16., 28., 19., -16., 6., -22., 11., 1920 - 8 7., 8., -3., -15., -9., 6., 2., -14., 1920 - 9 4., 5., -7., 17., 6., -5., 8., -19., 1920 - a 8., 10., -20., 1., 14., -11., 5., 12., 1920 - b -3., 1., -2., -2., 9., 2., 10., 0., 1920 - c -2., -1., 2., -3., -4., 2., 2., 1., 1920 - d -5., 2., -2., 6., 6., -4., 4., 0., 1920 - e 0., -2., 1., 4., 3., 0., 0., -6./ 1920 - data g5/ -30926.,-2318., 5817., -893., 2969.,-1334., 1471., 728., 1925 - 1 1140.,-1645., -462., 1202., 119., 881., 229., 891., 1925 - 2 711., 216., 601., -163., -426., -130., 217., -70., 1925 - 3 -230., 326., -96., 226., 58., -28., -44., -125., 1925 - 4 -122., -69., 51., 61., 54., 3., -9., 99., 1925 - 5 -238., 14., -40., -18., 39., 13., -103., -52., 1925 - 6 73., -54., -50., 3., -14., 27., -14., -35., 1925 - 7 5., -14., 29., 19., -17., 6., -21., 11., 1925 - 8 7., 8., -3., -15., -9., 6., 2., -14., 1925 - 9 4., 5., -7., 17., 7., -5., 8., -19., 1925 - a 8., 10., -20., 1., 14., -11., 5., 12., 1925 - b -3., 1., -2., -2., 9., 2., 10., 0., 1925 - c -2., -1., 2., -3., -4., 2., 2., 1., 1925 - d -5., 2., -2., 6., 6., -4., 4., 0., 1925 - e 0., -2., 1., 4., 3., 0., 0., -6./ 1925 - data g6/ -30805.,-2316., 5808., -951., 2980.,-1424., 1517., 644., 1930 - 1 1172.,-1692., -480., 1205., 133., 907., 166., 896., 1930 - 2 727., 205., 584., -195., -422., -109., 234., -90., 1930 - 3 -237., 327., -72., 218., 60., -32., -53., -131., 1930 - 4 -118., -74., 58., 60., 53., 4., -9., 102., 1930 - 5 -242., 19., -32., -16., 32., 8., -104., -46., 1930 - 6 74., -54., -51., 4., -15., 25., -14., -34., 1930 - 7 6., -12., 29., 18., -18., 6., -20., 11., 1930 - 8 7., 8., -3., -15., -9., 5., 2., -14., 1930 - 9 5., 5., -6., 18., 8., -5., 8., -19., 1930 - a 8., 10., -20., 1., 14., -12., 5., 12., 1930 - b -3., 1., -2., -2., 9., 3., 10., 0., 1930 - c -2., -2., 2., -3., -4., 2., 2., 1., 1930 - d -5., 2., -2., 6., 6., -4., 4., 0., 1930 - e 0., -2., 1., 4., 3., 0., 0., -6./ 1930 - data g7/ -30715.,-2306., 5812.,-1018., 2984.,-1520., 1550., 586., 1935 - 1 1206.,-1740., -494., 1215., 146., 918., 101., 903., 1935 - 2 744., 188., 565., -226., -415., -90., 249., -114., 1935 - 3 -241., 329., -51., 211., 64., -33., -64., -136., 1935 - 4 -115., -76., 64., 59., 53., 4., -8., 104., 1935 - 5 -246., 25., -25., -15., 25., 4., -106., -40., 1935 - 6 74., -53., -52., 4., -17., 23., -14., -33., 1935 - 7 7., -11., 29., 18., -19., 6., -19., 11., 1935 - 8 7., 8., -3., -15., -9., 5., 1., -15., 1935 - 9 6., 5., -6., 18., 8., -5., 7., -19., 1935 - a 8., 10., -20., 1., 15., -12., 5., 11., 1935 - b -3., 1., -3., -2., 9., 3., 11., 0., 1935 - c -2., -2., 2., -3., -4., 2., 2., 1., 1935 - d -5., 2., -2., 6., 6., -4., 4., 0., 1935 - e 0., -1., 2., 4., 3., 0., 0., -6./ 1935 - data g8/ -30654.,-2292., 5821.,-1106., 2981.,-1614., 1566., 528., 1940 - 1 1240.,-1790., -499., 1232., 163., 916., 43., 914., 1940 - 2 762., 169., 550., -252., -405., -72., 265., -141., 1940 - 3 -241., 334., -33., 208., 71., -33., -75., -141., 1940 - 4 -113., -76., 69., 57., 54., 4., -7., 105., 1940 - 5 -249., 33., -18., -15., 18., 0., -107., -33., 1940 - 6 74., -53., -52., 4., -18., 20., -14., -31., 1940 - 7 7., -9., 29., 17., -20., 5., -19., 11., 1940 - 8 7., 8., -3., -14., -10., 5., 1., -15., 1940 - 9 6., 5., -5., 19., 9., -5., 7., -19., 1940 - a 8., 10., -21., 1., 15., -12., 5., 11., 1940 - b -3., 1., -3., -2., 9., 3., 11., 1., 1940 - c -2., -2., 2., -3., -4., 2., 2., 1., 1940 - d -5., 2., -2., 6., 6., -4., 4., 0., 1940 - e 0., -1., 2., 4., 3., 0., 0., -6./ 1940 - data g9/ -30594.,-2285., 5810.,-1244., 2990.,-1702., 1578., 477., 1945 - 1 1282.,-1834., -499., 1255., 186., 913., -11., 944., 1945 - 2 776., 144., 544., -276., -421., -55., 304., -178., 1945 - 3 -253., 346., -12., 194., 95., -20., -67., -142., 1945 - 4 -119., -82., 82., 59., 57., 6., 6., 100., 1945 - 5 -246., 16., -25., -9., 21., -16., -104., -39., 1945 - 6 70., -40., -45., 0., -18., 0., 2., -29., 1945 - 7 6., -10., 28., 15., -17., 29., -22., 13., 1945 - 8 7., 12., -8., -21., -5., -12., 9., -7., 1945 - 9 7., 2., -10., 18., 7., 3., 2., -11., 1945 - a 5., -21., -27., 1., 17., -11., 29., 3., 1945 - b -9., 16., 4., -3., 9., -4., 6., -3., 1945 - c 1., -4., 8., -3., 11., 5., 1., 1., 1945 - d 2., -20., -5., -1., -1., -6., 8., 6., 1945 - e -1., -4., -3., -2., 5., 0., -2., -2./ 1945 - data ga/ -30554.,-2250., 5815.,-1341., 2998.,-1810., 1576., 381., 1950 - 1 1297.,-1889., -476., 1274., 206., 896., -46., 954., 1950 - 2 792., 136., 528., -278., -408., -37., 303., -210., 1950 - 3 -240., 349., 3., 211., 103., -20., -87., -147., 1950 - 4 -122., -76., 80., 54., 57., -1., 4., 99., 1950 - 5 -247., 33., -16., -12., 12., -12., -105., -30., 1950 - 6 65., -55., -35., 2., -17., 1., 0., -40., 1950 - 7 10., -7., 36., 5., -18., 19., -16., 22., 1950 - 8 15., 5., -4., -22., -1., 0., 11., -21., 1950 - 9 15., -8., -13., 17., 5., -4., -1., -17., 1950 - a 3., -7., -24., -1., 19., -25., 12., 10., 1950 - b 2., 5., 2., -5., 8., -2., 8., 3., 1950 - c -11., 8., -7., -8., 4., 13., -1., -2., 1950 - d 13., -10., -4., 2., 4., -3., 12., 6., 1950 - e 3., -3., 2., 6., 10., 11., 3., 8./ 1950 - data gb/ -30500.,-2215., 5820.,-1440., 3003.,-1898., 1581., 291., 1955 - 1 1302.,-1944., -462., 1288., 216., 882., -83., 958., 1955 - 2 796., 133., 510., -274., -397., -23., 290., -230., 1955 - 3 -229., 360., 15., 230., 110., -23., -98., -152., 1955 - 4 -121., -69., 78., 47., 57., -9., 3., 96., 1955 - 5 -247., 48., -8., -16., 7., -12., -107., -24., 1955 - 6 65., -56., -50., 2., -24., 10., -4., -32., 1955 - 7 8., -11., 28., 9., -20., 18., -18., 11., 1955 - 8 9., 10., -6., -15., -14., 5., 6., -23., 1955 - 9 10., 3., -7., 23., 6., -4., 9., -13., 1955 - a 4., 9., -11., -4., 12., -5., 7., 2., 1955 - b 6., 4., -2., 1., 10., 2., 7., 2., 1955 - c -6., 5., 5., -3., -5., -4., -1., 0., 1955 - d 2., -8., -3., -2., 7., -4., 4., 1., 1955 - e -2., -3., 6., 7., -2., -1., 0., -3./ 1955 - data gc/ -30421.,-2169., 5791.,-1555., 3002.,-1967., 1590., 206., 1960 - 1 1302.,-1992., -414., 1289., 224., 878., -130., 957., 1960 - 2 800., 135., 504., -278., -394., 3., 269., -255., 1960 - 3 -222., 362., 16., 242., 125., -26., -117., -156., 1960 - 4 -114., -63., 81., 46., 58., -10., 1., 99., 1960 - 5 -237., 60., -1., -20., -2., -11., -113., -17., 1960 - 6 67., -56., -55., 5., -28., 15., -6., -32., 1960 - 7 7., -7., 23., 17., -18., 8., -17., 15., 1960 - 8 6., 11., -4., -14., -11., 7., 2., -18., 1960 - 9 10., 4., -5., 23., 10., 1., 8., -20., 1960 - a 4., 6., -18., 0., 12., -9., 2., 1., 1960 - b 0., 4., -3., -1., 9., -2., 8., 3., 1960 - c 0., -1., 5., 1., -3., 4., 4., 1., 1960 - d 0., 0., -1., 2., 4., -5., 6., 1., 1960 - e 1., -1., -1., 6., 2., 0., 0., -7./ 1960 - data gd/ -30334.,-2119., 5776.,-1662., 2997.,-2016., 1594., 114., 1965 - 1 1297.,-2038., -404., 1292., 240., 856., -165., 957., 1965 - 2 804., 148., 479., -269., -390., 13., 252., -269., 1965 - 3 -219., 358., 19., 254., 128., -31., -126., -157., 1965 - 4 -97., -62., 81., 45., 61., -11., 8., 100., 1965 - 5 -228., 68., 4., -32., 1., -8., -111., -7., 1965 - 6 75., -57., -61., 4., -27., 13., -2., -26., 1965 - 7 6., -6., 26., 13., -23., 1., -12., 13., 1965 - 8 5., 7., -4., -12., -14., 9., 0., -16., 1965 - 9 8., 4., -1., 24., 11., -3., 4., -17., 1965 - a 8., 10., -22., 2., 15., -13., 7., 10., 1965 - b -4., -1., -5., -1., 10., 5., 10., 1., 1965 - c -4., -2., 1., -2., -3., 2., 2., 1., 1965 - d -5., 2., -2., 6., 4., -4., 4., 0., 1965 - e 0., -2., 2., 3., 2., 0., 0., -6./ 1965 - data ge/ -30220.,-2068., 5737.,-1781., 3000.,-2047., 1611., 25., 1970 - 1 1287.,-2091., -366., 1278., 251., 838., -196., 952., 1970 - 2 800., 167., 461., -266., -395., 26., 234., -279., 1970 - 3 -216., 359., 26., 262., 139., -42., -139., -160., 1970 - 4 -91., -56., 83., 43., 64., -12., 15., 100., 1970 - 5 -212., 72., 2., -37., 3., -6., -112., 1., 1970 - 6 72., -57., -70., 1., -27., 14., -4., -22., 1970 - 7 8., -2., 23., 13., -23., -2., -11., 14., 1970 - 8 6., 7., -2., -15., -13., 6., -3., -17., 1970 - 9 5., 6., 0., 21., 11., -6., 3., -16., 1970 - a 8., 10., -21., 2., 16., -12., 6., 10., 1970 - b -4., -1., -5., 0., 10., 3., 11., 1., 1970 - c -2., -1., 1., -3., -3., 1., 2., 1., 1970 - d -5., 3., -1., 4., 6., -4., 4., 0., 1970 - e 1., -1., 0., 3., 3., 1., -1., -4./ 1970 - data gf/ -30100.,-2013., 5675.,-1902., 3010.,-2067., 1632., -68., 1975 - 1 1276.,-2144., -333., 1260., 262., 830., -223., 946., 1975 - 2 791., 191., 438., -265., -405., 39., 216., -288., 1975 - 3 -218., 356., 31., 264., 148., -59., -152., -159., 1975 - 4 -83., -49., 88., 45., 66., -13., 28., 99., 1975 - 5 -198., 75., 1., -41., 6., -4., -111., 11., 1975 - 6 71., -56., -77., 1., -26., 16., -5., -14., 1975 - 7 10., 0., 22., 12., -23., -5., -12., 14., 1975 - 8 6., 6., -1., -16., -12., 4., -8., -19., 1975 - 9 4., 6., 0., 18., 10., -10., 1., -17., 1975 - a 7., 10., -21., 2., 16., -12., 7., 10., 1975 - b -4., -1., -5., -1., 10., 4., 11., 1., 1975 - c -3., -2., 1., -3., -3., 1., 2., 1., 1975 - d -5., 3., -2., 4., 5., -4., 4., -1., 1975 - e 1., -1., 0., 3., 3., 1., -1., -5./ 1975 - data gg/ -29992.,-1956., 5604.,-1997., 3027.,-2129., 1663., -200., 1980 - 1 1281.,-2180., -336., 1251., 271., 833., -252., 938., 1980 - 2 782., 212., 398., -257., -419., 53., 199., -297., 1980 - 3 -218., 357., 46., 261., 150., -74., -151., -162., 1980 - 4 -78., -48., 92., 48., 66., -15., 42., 93., 1980 - 5 -192., 71., 4., -43., 14., -2., -108., 17., 1980 - 6 72., -59., -82., 2., -27., 21., -5., -12., 1980 - 7 16., 1., 18., 11., -23., -2., -10., 18., 1980 - 8 6., 7., 0., -18., -11., 4., -7., -22., 1980 - 9 4., 9., 3., 16., 6., -13., -1., -15., 1980 - a 5., 10., -21., 1., 16., -12., 9., 9., 1980 - b -5., -3., -6., -1., 9., 7., 10., 2., 1980 - c -6., -5., 2., -4., -4., 1., 2., 0., 1980 - d -5., 3., -2., 6., 5., -4., 3., 0., 1980 - e 1., -1., 2., 4., 3., 0., 0., -6./ 1980 - data gi/ -29873.,-1905., 5500.,-2072., 3044.,-2197., 1687., -306., 1985 - 1 1296.,-2208., -310., 1247., 284., 829., -297., 936., 1985 - 2 780., 232., 361., -249., -424., 69., 170., -297., 1985 - 3 -214., 355., 47., 253., 150., -93., -154., -164., 1985 - 4 -75., -46., 95., 53., 65., -16., 51., 88., 1985 - 5 -185., 69., 4., -48., 16., -1., -102., 21., 1985 - 6 74., -62., -83., 3., -27., 24., -2., -6., 1985 - 7 20., 4., 17., 10., -23., 0., -7., 21., 1985 - 8 6., 8., 0., -19., -11., 5., -9., -23., 1985 - 9 4., 11., 4., 14., 4., -15., -4., -11., 1985 - a 5., 10., -21., 1., 15., -12., 9., 9., 1985 - b -6., -3., -6., -1., 9., 7., 9., 1., 1985 - c -7., -5., 2., -4., -4., 1., 3., 0., 1985 - d -5., 3., -2., 6., 5., -4., 3., 0., 1985 - e 1., -1., 2., 4., 3., 0., 0., -6./ 1985 - data gj/ -29775.,-1848., 5406.,-2131., 3059.,-2279., 1686., -373., 1990 - 1 1314.,-2239., -284., 1248., 293., 802., -352., 939., 1990 - 2 780., 247., 325., -240., -423., 84., 141., -299., 1990 - 3 -214., 353., 46., 245., 154., -109., -153., -165., 1990 - 4 -69., -36., 97., 61., 65., -16., 59., 82., 1990 - 5 -178., 69., 3., -52., 18., 1., -96., 24., 1990 - 6 77., -64., -80., 2., -26., 26., 0., -1., 1990 - 7 21., 5., 17., 9., -23., 0., -4., 23., 1990 - 8 5., 10., -1., -19., -10., 6., -12., -22., 1990 - 9 3., 12., 4., 12., 2., -16., -6., -10., 1990 - a 4., 9., -20., 1., 15., -12., 11., 9., 1990 - b -7., -4., -7., -2., 9., 7., 8., 1., 1990 - c -7., -6., 2., -3., -4., 2., 2., 1., 1990 - d -5., 3., -2., 6., 4., -4., 3., 0., 1990 - e 1., -2., 3., 3., 3., -1., 0., -6./ 1990 - data gk/ -29692.,-1784., 5306.,-2200., 3070.,-2366., 1681., -413., 1995 - 1 1335.,-2267., -262., 1249., 302., 759., -427., 940., 1995 - 2 780., 262., 290., -236., -418., 97., 122., -306., 1995 - 3 -214., 352., 46., 235., 165., -118., -143., -166., 1995 - 4 -55., -17., 107., 68., 67., -17., 68., 72., 1995 - 5 -170., 67., -1., -58., 19., 1., -93., 36., 1995 - 6 77., -72., -69., 1., -25., 28., 4., 5., 1995 - 7 24., 4., 17., 8., -24., -2., -6., 25., 1995 - 8 6., 11., -6., -21., -9., 8., -14., -23., 1995 - 9 9., 15., 6., 11., -5., -16., -7., -4., 1995 - a 4., 9., -20., 3., 15., -10., 12., 8., 1995 - b -6., -8., -8., -1., 8., 10., 5., -2., 1995 - c -8., -8., 3., -3., -6., 1., 2., 0., 1995 - d -4., 4., -1., 5., 4., -5., 2., -1., 1995 - e 2., -2., 5., 1., 1., -2., 0., -7., 1995 - f 75*0./ 1995 - data gl/ -29619.4,-1728.2, 5186.1,-2267.7, 3068.4,-2481.6, 1670.9, 2000 - 1 -458.0, 1339.6,-2288.0, -227.6, 1252.1, 293.4, 714.5, 2000 - 2 -491.1, 932.3, 786.8, 272.6, 250.0, -231.9, -403.0, 2000 - 3 119.8, 111.3, -303.8, -218.8, 351.4, 43.8, 222.3, 2000 - 4 171.9, -130.4, -133.1, -168.6, -39.3, -12.9, 106.3, 2000 - 5 72.3, 68.2, -17.4, 74.2, 63.7, -160.9, 65.1, 2000 - 6 -5.9, -61.2, 16.9, 0.7, -90.4, 43.8, 79.0, 2000 - 7 -74.0, -64.6, 0.0, -24.2, 33.3, 6.2, 9.1, 2000 - 8 24.0, 6.9, 14.8, 7.3, -25.4, -1.2, -5.8, 2000 - 9 24.4, 6.6, 11.9, -9.2, -21.5, -7.9, 8.5, 2000 - a -16.6, -21.5, 9.1, 15.5, 7.0, 8.9, -7.9, 2000 - b -14.9, -7.0, -2.1, 5.0, 9.4, -19.7, 3.0, 2000 - c 13.4, -8.4, 12.5, 6.3, -6.2, -8.9, -8.4, 2000 - d -1.5, 8.4, 9.3, 3.8, -4.3, -8.2, -8.2, 2000 - e 4.8, -2.6, -6.0, 1.7, 1.7, 0.0, -3.1, 2000 - f 4.0, -0.5, 4.9, 3.7, -5.9, 1.0, -1.2, 2000 - g 2.0, -2.9, 4.2, 0.2, 0.3, -2.2, -1.1, 2000 - h -7.4, 2.7, -1.7, 0.1, -1.9, 1.3, 1.5, 2000 - i -0.9, -0.1, -2.6, 0.1, 0.9, -0.7, -0.7, 2000 - j 0.7, -2.8, 1.7, -0.9, 0.1, -1.2, 1.2, 2000 - k -1.9, 4.0, -0.9, -2.2, -0.3, -0.4, 0.2, 2000 - l 0.3, 0.9, 2.5, -0.2, -2.6, 0.9, 0.7, 2000 - m -0.5, 0.3, 0.3, 0.0, -0.3, 0.0, -0.4, 2000 - n 0.3, -0.1, -0.9, -0.2, -0.4, -0.4, 0.8, 2000 - o -0.2, -0.9, -0.9, 0.3, 0.2, 0.1, 1.8, 2000 - p -0.4, -0.4, 1.3, -1.0, -0.4, -0.1, 0.7, 2000 - q 0.7, -0.4, 0.3, 0.3, 0.6, -0.1, 0.3, 2000 - r 0.4, -0.2, 0.0, -0.5, 0.1, -0.9/ 2000 - data gm/-29554.63,-1669.05, 5077.99,-2337.24, 3047.69,-2594.50, 2005 - 1 1657.76, -515.43, 1336.30,-2305.83, -198.86, 1246.39, 2005 - 2 269.72, 672.51, -524.72, 920.55, 797.96, 282.07, 2005 - 3 210.65, -225.23, -379.86, 145.15, 100.00, -305.36, 2005 - 4 -227.00, 354.41, 42.72, 208.95, 180.25, -136.54, 2005 - 5 -123.45, -168.05, -19.57, -13.55, 103.85, 73.60, 2005 - 6 69.56, -20.33, 76.74, 54.75, -151.34, 63.63, 2005 - 7 -14.58, -63.53, 14.58, 0.24, -86.36, 50.94, 2005 - 8 79.88, -74.46, -61.14, -1.65, -22.57, 38.73, 2005 - 9 6.82, 12.30, 25.35, 9.37, 10.93, 5.42, 2005 - a -26.32, 1.94, -4.64, 24.80, 7.62, 11.20, 2005 - b -11.73, -20.88, -6.88, 9.83, -18.11, -19.71, 2005 - c 10.17, 16.22, 9.36, 7.61, -11.25, -12.76, 2005 - d -4.87, -0.06, 5.58, 9.76, -20.11, 3.58, 2005 - e 12.69, -6.94, 12.67, 5.01, -6.72, -10.76, 2005 - f -8.16, -1.25, 8.10, 8.76, 2.92, -6.66, 2005 - g -7.73, -9.22, 6.01, -2.17, -6.12, 2.19, 2005 - h 1.42, 0.10, -2.35, 4.46, -0.15, 4.76, 2005 - i 3.06, -6.58, 0.29, -1.01, 2.06, -3.47, 2005 - j 3.77, -0.86, -0.21, -2.31, -2.09, -7.93, 2005 - k 2.95, -1.60, 0.26, -1.88, 1.44, 1.44, 2005 - l -0.77, -0.31, -2.27, 0.29, 0.90, -0.79, 2005 - m -0.58, 0.53, -2.69, 1.80, -1.08, 0.16, 2005 - n -1.58, 0.96, -1.90, 3.99, -1.39, -2.15, 2005 - o -0.29, -0.55, 0.21, 0.23, 0.89, 2.38, 2005 - p -0.38, -2.63, 0.96, 0.61, -0.30, 0.40, 2005 - q 0.46, 0.01, -0.35, 0.02, -0.36, 0.28, 2005 - r 0.08, -0.87, -0.49, -0.34, -0.08, 0.88, 2005 - s -0.16, -0.88, -0.76, 0.30, 0.33, 0.28, 2005 - t 1.72, -0.43, -0.54, 1.18, -1.07, -0.37, 2005 - u -0.04, 0.75, 0.63, -0.26, 0.21, 0.35, 2005 - v 0.53, -0.05, 0.38, 0.41, -0.22, -0.10, 2005 - w -0.57, -0.18, -0.82/ 2005 - data gp/-29496.57,-1586.42, 4944.26,-2396.06, 3026.34,-2708.54, 2010 - 1 1668.17, -575.73, 1339.85,-2326.54, -160.40, 1232.10, 2010 - 2 251.75, 633.73, -537.03, 912.66, 808.97, 286.48, 2010 - 3 166.58, -211.03, -356.83, 164.46, 89.40, -309.72, 2010 - 4 -230.87, 357.29, 44.58, 200.26, 189.01, -141.05, 2010 - 5 -118.06, -163.17, -0.01, -8.03, 101.04, 72.78, 2010 - 6 68.69, -20.90, 75.92, 44.18, -141.40, 61.54, 2010 - 7 -22.83, -66.26, 13.10, 3.02, -78.09, 55.40, 2010 - 8 80.44, -75.00, -57.80, -4.55, -21.20, 45.24, 2010 - 9 6.54, 14.00, 24.96, 10.46, 7.03, 1.64, 2010 - a -27.61, 4.92, -3.28, 24.41, 8.21, 10.84, 2010 - b -14.50, -20.03, -5.59, 11.83, -19.34, -17.41, 2010 - c 11.61, 16.71, 10.85, 6.96, -14.05, -10.74, 2010 - d -3.54, 1.64, 5.50, 9.45, -20.54, 3.45, 2010 - e 11.51, -5.27, 12.75, 3.13, -7.14, -12.38, 2010 - f -7.42, -0.76, 7.97, 8.43, 2.14, -8.42, 2010 - g -6.08, -10.08, 7.01, -1.94, -6.24, 2.73, 2010 - h 0.89, -0.10, -1.07, 4.71, -0.16, 4.44, 2010 - i 2.45, -7.22, -0.33, -0.96, 2.13, -3.95, 2010 - j 3.09, -1.99, -1.03, -1.97, -2.80, -8.31, 2010 - k 3.05, -1.48, 0.13, -2.03, 1.67, 1.65, 2010 - l -0.66, -0.51, -1.76, 0.54, 0.85, -0.79, 2010 - m -0.39, 0.37, -2.51, 1.79, -1.27, 0.12, 2010 - n -2.11, 0.75, -1.94, 3.75, -1.86, -2.12, 2010 - o -0.21, -0.87, 0.30, 0.27, 1.04, 2.13, 2010 - p -0.63, -2.49, 0.95, 0.49, -0.11, 0.59, 2010 - q 0.52, 0.00, -0.39, 0.13, -0.37, 0.27, 2010 - r 0.21, -0.86, -0.77, -0.23, 0.04, 0.87, 2010 - s -0.09, -0.89, -0.87, 0.31, 0.30, 0.42, 2010 - t 1.66, -0.45, -0.59, 1.08, -1.14, -0.31, 2010 - u -0.07, 0.78, 0.54, -0.18, 0.10, 0.38, 2010 - v 0.49, 0.02, 0.44, 0.42, -0.25, -0.26, 2010 - w -0.53, -0.26, -0.79/ 2010 - data gq/-29441.46,-1501.77, 4795.99,-2445.88, 3012.20,-2845.41, 2015 - 1 1676.35, -642.17, 1350.33,-2352.26, -115.29, 1225.85, 2015 - 2 245.04, 581.69, -538.70, 907.42, 813.68, 283.54, 2015 - 3 120.49, -188.43, -334.85, 180.95, 70.38, -329.23, 2015 - 4 -232.91, 360.14, 46.98, 192.35, 196.98, -140.94, 2015 - 5 -119.14, -157.40, 15.98, 4.30, 100.12, 69.55, 2015 - 6 67.57, -20.61, 72.79, 33.30, -129.85, 58.74, 2015 - 7 -28.93, -66.64, 13.14, 7.35, -70.85, 62.41, 2015 - 8 81.29, -75.99, -54.27, -6.79, -19.53, 51.82, 2015 - 9 5.59, 15.07, 24.45, 9.32, 3.27, -2.88, 2015 - a -27.50, 6.61, -2.32, 23.98, 8.89, 10.04, 2015 - b -16.78, -18.26, -3.16, 13.18, -20.56, -14.60, 2015 - c 13.33, 16.16, 11.76, 5.69, -15.98, -9.10, 2015 - d -2.02, 2.26, 5.33, 8.83, -21.77, 3.02, 2015 - e 10.76, -3.22, 11.74, 0.67, -6.74, -13.20, 2015 - f -6.88, -0.10, 7.79, 8.68, 1.04, -9.06, 2015 - g -3.89, -10.54, 8.44, -2.01, -6.26, 3.28, 2015 - h 0.17, -0.40, 0.55, 4.55, -0.55, 4.40, 2015 - i 1.70, -7.92, -0.67, -0.61, 2.13, -4.16, 2015 - j 2.33, -2.85, -1.80, -1.12, -3.59, -8.72, 2015 - k 3.00, -1.40, 0.00, -2.30, 2.11, 2.08, 2015 - l -0.60, -0.79, -1.05, 0.58, 0.76, -0.70, 2015 - m -0.20, 0.14, -2.12, 1.70, -1.44, -0.22, 2015 - n -2.57, 0.44, -2.01, 3.49, -2.34, -2.09, 2015 - o -0.16, -1.08, 0.46, 0.37, 1.23, 1.75, 2015 - p -0.89, -2.19, 0.85, 0.27, 0.10, 0.72, 2015 - q 0.54, -0.09, -0.37, 0.29, -0.43, 0.23, 2015 - r 0.22, -0.89, -0.94, -0.16, -0.03, 0.72, 2015 - s -0.02, -0.92, -0.88, 0.42, 0.49, 0.63, 2015 - t 1.56, -0.42, -0.50, 0.96, -1.24, -0.19, 2015 - u -0.10, 0.81, 0.42, -0.13, -0.04, 0.38, 2015 - v 0.48, 0.08, 0.48, 0.46, -0.30, -0.35, 2015 - w -0.43, -0.36, -0.71/ 2015 - data gr/ -29404.8, -1450.9, 4652.5, -2499.6, 2982.0, -2991.6, 2020 - 1 1677.0, -734.6, 1363.2, -2381.2, -82.1, 1236.2, 2020 - 2 241.9, 525.7, -543.4, 903.0, 809.5, 281.9, 2020 - 3 86.3, -158.4, -309.4, 199.7, 48.0, -349.7, 2020 - 4 -234.3, 363.2, 47.7, 187.8, 208.3, -140.7, 2020 - 5 -121.2, -151.2, 32.3, 13.5, 98.9, 66.0, 2020 - 6 65.5, -19.1, 72.9, 25.1, -121.5, 52.8, 2020 - 7 -36.2, -64.5, 13.5, 8.9, -64.7, 68.1, 2020 - 8 80.6, -76.7, -51.5, -8.2, -16.9, 56.5, 2020 - 9 2.2, 15.8, 23.5, 6.4, -2.2, -7.2, 2020 - a -27.2, 9.8, -1.8, 23.7, 9.7, 8.4, 2020 - b -17.6, -15.3, -0.5, 12.8, -21.1, -11.7, 2020 - c 15.3, 14.9, 13.7, 3.6, -16.5, -6.9, 2020 - d -0.3, 2.8, 5.0, 8.4, -23.4, 2.9, 2020 - e 11.0, -1.5, 9.8, -1.1, -5.1, -13.2, 2020 - f -6.3, 1.1, 7.8, 8.8, 0.4, -9.3, 2020 - g -1.4, -11.9, 9.6, -1.9, -6.2, 3.4, 2020 - h -0.1, -0.2, 1.7, 3.6, -0.9, 4.8, 2020 - i 0.7, -8.6, -0.9, -0.1, 1.9, -4.3, 2020 - j 1.4, -3.4, -2.4, -0.1, -3.8, -8.8, 2020 - k 3.0, -1.4, 0.0, -2.5, 2.5, 2.3, 2020 - l -0.6, -0.9, -0.4, 0.3, 0.6, -0.7, 2020 - m -0.2, -0.1, -1.7, 1.4, -1.6, -0.6, 2020 - n -3.0, 0.2, -2.0, 3.1, -2.6, -2.0, 2020 - o -0.1, -1.2, 0.5, 0.5, 1.3, 1.4, 2020 - p -1.2, -1.8, 0.7, 0.1, 0.3, 0.8, 2020 - q 0.5, -0.2, -0.3, 0.6, -0.5, 0.2, 2020 - r 0.1, -0.9, -1.1, 0.0, -0.3, 0.5, 2020 - s 0.1, -0.9, -0.9, 0.5, 0.6, 0.7, 2020 - t 1.4, -0.3, -0.4, 0.8, -1.3, 0.0, 2020 - u -0.1, 0.8, 0.3, 0.0, -0.1, 0.4, 2020 - v 0.5, 0.1, 0.5, 0.5, -0.4, -0.5, 2020 - w -0.4, -0.4, -0.6/ 2020 - data gs/ 5.7, 7.4, -25.9, -11.0, -7.0, -30.2, 2022 - 1 -2.1, -22.4, 2.2, -5.9, 6.0, 3.1, 2022 - 2 -1.1, -12.0, 0.5, -1.2, -1.6, -0.1, 2022 - 3 -5.9, 6.5, 5.2, 3.6, -5.1, -5.0, 2022 - 4 -0.3, 0.5, 0.0, -0.6, 2.5, 0.2, 2022 - 5 -0.6, 1.3, 3.0, 0.9, 0.3, -0.5, 2022 - 6 -0.3, 0.0, 0.4, -1.6, 1.3, -1.3, 2022 - 7 -1.4, 0.8, 0.0, 0.0, 0.9, 1.0, 2022 - 8 -0.1, -0.2, 0.6, 0.0, 0.6, 0.7, 2022 - 9 -0.8, 0.1, -0.2, -0.5, -1.1, -0.8, 2022 - a 0.1, 0.8, 0.3, 0.0, 0.1, -0.2, 2022 - b -0.1, 0.6, 0.4, -0.2, -0.1, 0.5, 2022 - c 0.4, -0.3, 0.3, -0.4, -0.1, 0.5, 2022 - d 0.4, 0.0, 115*0.0/ 2022 -C following added by RStoneback -Cf2py intent(in) isv,date,itype,alt,colat,elong -Cf2py intent(out) x,y,z,f - - - -c -c set initial values -c - x = 0.0 - y = 0.0 - z = 0.0 - if (date.lt.1900.0.or.date.gt.2030.0) go to 11 - if (date.gt.2025.0) write (6,960) date - 960 format (/' This version of the IGRF is intended for use up', - 1 ' to 2025.0.'/' values for',f9.3,' will be computed', - 2 ' but may be of reduced accuracy'/) - if (date.ge.2020.0) go to 1 - t = 0.2*(date - 1900.0) - ll = t - one = ll - t = t - one -c -c SH models before 1995.0 are only to degree 10 -c - if (date.lt.1995.0) then - nmx = 10 - nc = nmx*(nmx+2) - ll = nc*ll - kmx = (nmx+1)*(nmx+2)/2 - else - nmx = 13 - nc = nmx*(nmx+2) - ll = 0.2*(date - 1995.0) -c -c 19 is the number of SH models that extend to degree 10 -c - ll = 120*19 + nc*ll - kmx = (nmx+1)*(nmx+2)/2 - endif - tc = 1.0 - t - if (isv.eq.1) then - tc = -0.2 - t = 0.2 - end if - go to 2 -c - 1 t = date - 2020.0 - tc = 1.0 - if (isv.eq.1) then - t = 1.0 - tc = 0.0 - end if -c -c pointer for last coefficient in pen-ultimate set of MF coefficients... -c - ll = 3255 - nmx = 13 - nc = nmx*(nmx+2) - kmx = (nmx+1)*(nmx+2)/2 - 2 r = alt - one = colat - !*0.017453292 - ct = cos(one) - st = sin(one) - one = elong - !*0.017453292 - cl(1) = cos(one) - sl(1) = sin(one) - cd = 1.0 - sd = 0.0 - l = 1 - m = 1 - n = 0 - if (itype.eq.2) go to 3 -c -c conversion from geodetic to geocentric coordinates -c (using the WGS84 spheroid) -c - a2 = 40680631.6 - b2 = 40408296.0 - one = a2*st*st - two = b2*ct*ct - three = one + two - rho = sqrt(three) - r = sqrt(alt*(alt + 2.0*rho) + (a2*one + b2*two)/three) - cd = (alt + rho)/r - sd = (a2 - b2)/rho*ct*st/r - one = ct - ct = ct*cd - st*sd - st = st*cd + one*sd -c - 3 ratio = 6371.2/r - rr = ratio*ratio -c -c computation of Schmidt quasi-normal coefficients p and x(=q) -c - p(1) = 1.0 - p(3) = st - q(1) = 0.0 - q(3) = ct - do 10 k=2,kmx - if (n.ge.m) go to 4 - m = 0 - n = n + 1 - rr = rr*ratio - fn = n - gn = n - 1 - 4 fm = m - if (m.ne.n) go to 5 - if (k.eq.3) go to 6 - one = sqrt(1.0 - 0.5/fm) - j = k - n - 1 - p(k) = one*st*p(j) - q(k) = one*(st*q(j) + ct*p(j)) - cl(m) = cl(m-1)*cl(1) - sl(m-1)*sl(1) - sl(m) = sl(m-1)*cl(1) + cl(m-1)*sl(1) - go to 6 - 5 gmm = m*m - one = sqrt(fn*fn - gmm) - two = sqrt(gn*gn - gmm)/one - three = (fn + gn)/one - i = k - n - j = i - n + 1 - p(k) = three*ct*p(i) - two*p(j) - q(k) = three*(ct*q(i) - st*p(i)) - two*q(j) -c -c synthesis of x, y and z in geocentric coordinates -c - 6 lm = ll + l - one = (tc*gh(lm) + t*gh(lm+nc))*rr - if (m.eq.0) go to 9 - two = (tc*gh(lm+1) + t*gh(lm+nc+1))*rr - three = one*cl(m) + two*sl(m) - x = x + three*q(k) - z = z - (fn + 1.0)*three*p(k) - if (st.eq.0.0) go to 7 - y = y + (one*sl(m) - two*cl(m))*fm*p(k)/st - go to 8 - 7 y = y + (one*sl(m) - two*cl(m))*q(k)*ct - 8 l = l + 2 - go to 10 - 9 x = x + one*q(k) - z = z - (fn + 1.0)*one*p(k) - l = l + 1 - 10 m = m + 1 -c -c conversion to coordinate system specified by itype -c - one = x - x = x*cd + z*sd - z = z*cd - one*sd - f = sqrt(x*x + y*y + z*z) -c - return -c -c error return if date out of bounds -c - 11 f = 1.0d8 - write (6,961) date - 961 format (/' This subroutine will not work with a date of', - 1 f9.3,'. Date must be in the range 1900.0.ge.date', - 2 '.le.2030.0. On return f = 1.0d8., x = y = z = 0.') - return - end From 25e0548a862163084416114909a9a2425d4ba1b0 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:32:30 -0500 Subject: [PATCH 29/39] ENH: Update old manifest --- MANIFEST.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 356a2861..c90dfe11 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ include LICENSE -include CONTRIBUTING.md +include CHANGELOG.md include OMMBV/version.txt +include meson.build +include README.md From 74605e578684e311546bf3eeac80cf76152ee109 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:34:05 -0500 Subject: [PATCH 30/39] ENH: Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 110fb2c6..063f5c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [1.1.0] - 2025-04-04 +## [1.1.0] - 2025-04-07 - Switched away from distutils to Meson for build system - Updated coupling to coveralls - Updated package version for security issue in sphinx From db687157a0ae781682d7b1bc50b31176b62c8115 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:38:58 -0500 Subject: [PATCH 31/39] ENH: Restore coverage percentage --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6b2d0224..a6aa3d90 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ # Orthogonal Multipole Magnetic Basis Vectors (OMMBV) [![Build Status](https://github.com/CosmicStudioSoftware/OMMBV/actions/workflows/main.yml/badge.svg)](https://github.com/CosmicStudioSoftware/OMMBV/actions/workflows/main.yml/badge.svg) +[![Coverage Status](https://coveralls.io/repos/github/CosmicStudioSoftware/OMMBV/badge.svg?branch=main)](https://coveralls.io/github/CosmicStudioSoftware/OMMBV?branch=main) [![Documentation Status](https://readthedocs.org/projects/ommbv/badge/?version=latest)](https://ommbv.readthedocs.io/en/latest/?badge=latest) [![DOI](https://zenodo.org/badge/138220240.svg)](https://zenodo.org/badge/latestdoi/138220240) From 49868ce5e22dc31a90d54c119196644d78f9f180 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:43:08 -0500 Subject: [PATCH 32/39] ENH: Restore coverage percentage --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6aa3d90..6b2c0f70 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,8 @@ and measurements from the Communications/Navigation Outage Forecasting System The development of the multipole software has been supported, in part, by multiple agencies under the following grants: -Naval Research Laboratory N00173-19-1-G016 and NASA 80NSSC18K1203. +Cosmic Studio, Naval Research Laboratory N00173-19-1-G016, +and NASA 80NSSC18K1203. Previous versions of this software that provided an 'average' basis were funded by: National Aeronautics and Space Agency (NASA NNG12FA45C), From a2435ca685f0373eff3f4857a8a4577042756344 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 13:50:22 -0500 Subject: [PATCH 33/39] BUG: PEP8 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b418258b..295b4dac 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,8 @@ os.path.join('ommbvfortran', 'igrf14.f')], extra_f77_compile_args=extra_args), Extension(name='OMMBV.fortran_coords', - sources=[os.path.join('ommbvfortran', '_coords.f')])] + sources=[os.path.join('ommbvfortran', + '_coords.f')])] setup_kwargs = {'ext_modules': extensions} setup(**setup_kwargs) From 2c14342a67de530743f927e4eba82cfd0b4d27bf Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 14:16:21 -0500 Subject: [PATCH 34/39] DOC: Updated citation --- docs/citing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/citing.rst b/docs/citing.rst index e76e05dd..a5dd60b7 100644 --- a/docs/citing.rst +++ b/docs/citing.rst @@ -20,7 +20,7 @@ OMMBV author = {Stoneback, R. A. and Klenzing, J. H., and Iyer, G..}, title = {Orthogonal Multipole Magnetic Basis Vectors (OMMBV) v1.1.0}, year = {2025}, - date = {2025-04-04}, + date = {2025-04-07}, doi = {10.5281/zenodo.1299374}, url = {https://doi.org/10.5281/zenodo.1299374} } From a73594c24c4556d74a72e9181ae059e36496a8c5 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 14:27:54 -0500 Subject: [PATCH 35/39] BUG: Removed old commented and unneeded code --- OMMBV/_core.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/OMMBV/_core.py b/OMMBV/_core.py index d04b2007..2286a37a 100644 --- a/OMMBV/_core.py +++ b/OMMBV/_core.py @@ -292,13 +292,6 @@ def calculate_mag_drift_unit_vectors_ecef(latitude, longitude, altitude, ecef_x, ecef_y, ecef_z = trans.geodetic_to_ecef(latitude, longitude, altitude) - # This shouldn't have been pushed to the repo - # idx, = np.where(np.isnan(ecef_x)) - # if len(idx) > 0: - # print("Encountered nan starting ecef locations ", ecef_x[idx], - # ecef_y[idx], ecef_z[idx], latitude[idx], longitude[idx], - # altitude[idx]) - # Begin method calculation. # Magnetic field at root location @@ -358,13 +351,6 @@ def calculate_mag_drift_unit_vectors_ecef(latitude, longitude, altitude, ecef_input=True, **step_kwargs) - # This shouldn't be here - # idx, = np.where(np.isnan(tzx)) - # if len(idx) > 0: - # print("Encountered nan tzx values ", idx, ecef_x[idx], - # ecef_y[idx], ecef_z[idx], tzx[idx], tzy[idx], tzz[idx], - # latitude[idx], longitude[idx], altitude[idx]) - if centered_diff: # Negative step ecef_xz2, ecef_yz2, ecef_zz2 = (ecef_x - step_size * tzx, @@ -435,15 +421,6 @@ def calculate_mag_drift_unit_vectors_ecef(latitude, longitude, altitude, & (loop_num + 1 >= min_loops): # Reached terminating conditions repeat_flag = False - # print('Using position ', location_info(ecef_xz, ecef_yz, ecef_zz, - # datetimes, - # return_geodetic=True, - # ecef_input=True, - # **step_kwargs)[3:], loop_num) - # idx, = np.where(np.isnan(ecef_xz)) - # if len(idx) > 0: - # print("Encountered nan apex locations ", ecef_xz[idx], - # ecef_yz[idx], ecef_zz[idx]) else: # Store info into calculation vectors to refine next loop tzx, tzy, tzz = tzx2, tzy2, tzz2 From 241f79df2b17a07b1e735aa9e750134a0f1afbc1 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 14:30:02 -0500 Subject: [PATCH 36/39] DOC: Update version --- OMMBV/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMMBV/__init__.py b/OMMBV/__init__.py index f40bdb27..568e2059 100644 --- a/OMMBV/__init__.py +++ b/OMMBV/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """init routine for OMMBV.""" -__version__ = '1.0.2' +__version__ = '1.1.0' try: from OMMBV import igrf From 3568ee192e0df414cb22219551aca39f24ce3494 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 14:30:57 -0500 Subject: [PATCH 37/39] BUG: Deleted commented code --- OMMBV/_core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/OMMBV/_core.py b/OMMBV/_core.py index 2286a37a..471a39be 100644 --- a/OMMBV/_core.py +++ b/OMMBV/_core.py @@ -668,7 +668,6 @@ def step_along_mag_unit_vector(x, y, z, date, direction, num_steps=1, if direction == 'meridional': centered_diff = True - # print("False") else: centered_diff = False From 728e9dee4e2f7df4954ab7d248b5c2d161494cf3 Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Sat, 5 Apr 2025 14:34:35 -0500 Subject: [PATCH 38/39] DOC: Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 063f5c54..66719dc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Added online unit testing for Linux and MacOS - Updated to IGRF14 - Updated documentation +- Updated unit tests to latest standards ## [1.0.1] - 2022-01-04 - Added pyproject.toml to support systems without numpy. From 69a76319dde6593853763fef1ac854e94394cabc Mon Sep 17 00:00:00 2001 From: Russell Stoneback Date: Mon, 7 Apr 2025 09:42:44 -0500 Subject: [PATCH 39/39] DOC: Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66719dc6..8890f6a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Switched away from distutils to Meson for build system - Updated coupling to coveralls - Updated package version for security issue in sphinx -- Added online unit testing for Linux and MacOS +- Updated online unit testing - Updated to IGRF14 - Updated documentation - Updated unit tests to latest standards