https://github.com/bluegreen-labs/igrf
International Geomagnetic Reference Field (IGRF) R package
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.0%) to scientific vocabulary
Keywords
Repository
International Geomagnetic Reference Field (IGRF) R package
Basic Info
- Host: GitHub
- Owner: bluegreen-labs
- License: agpl-3.0
- Language: Fortran
- Default Branch: main
- Homepage: https://bluegreen-labs.github.io/igrf/
- Size: 1.85 MB
Statistics
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
International Geomagnetic Reference Field 
The 14th Generation International Geomagnetic Reference Field (IGRF) implemented as an R package. The igrf package provides an R version of the of the original IGRF model in Fortran published by Alken et al. 2021 (available on the NOAA website https://www.ncei.noaa.gov/products/international-geomagnetic-reference-field). R outputs have been verified to correspond with the original Fortran code and can be considere equivalent with the exception that values in the R are not rounded before output. For all intents and purposes the data can be considered equivalent.
For full model details I refer to Alken et al. 2021, and the project website where both the original code and a brief model description can be found. The authors of both the R package and the original Fortran code take no responsibility regarding the use of these data within a professional context. For caveats on model use I refer to the health warning on the original project website (https://www.ncei.noaa.gov/products/international-geomagnetic-reference-field/health-warning).
How to cite this package in your article
Koen Hufkens. (2022). bluegreen-labs/igrf: IGRF CRAN release v1.0 (v1.0). Zenodo. https://doi.org/10.5281/zenodo.6527638
Installation
stable release
To install the current stable release use a CRAN repository:
r
install.packages("igrf")
library("igrf")
development release
To install the development releases of the package run the following commands:
r
if(!require(remotes)){install.packages("remotes")}
remotes::install_github("bluegreen-labs/igrf")
library("igrf")
Vignettes are not rendered by default, if you want to include additional documentation please use:
r
if(!require(remotes)){install.packages("remotes")}
remotes::install_github("bluegreen-labs/igrf", build_vignettes = TRUE)
library("igrf")
Use
Single coordinates
IGRF values can be calculated for a single point using the below call. This will generate a data frame with model values. The routine is relatively fast so looping over a time vector will generate time series fairly quickly. To calculate grids a simple function is provided (see below).
r
df <- igrf(
field = "main",
year = 2000,
altitude = 2,
latitude = 0,
longitude = 0
)
Regular grid
You may generate global maps of the IGRF using the igrf_grid() function, setting similar parameters as above while specifying a resolution as decimal degrees of the global grid. Keep in mind that values under 1 (fractions) will take an increasing amount of time and space to store the data.
r
grid <- igrf::igrf_grid(
field = "main",
year = 2000,
altitude = 2,
resolution = 5
)
A resulting map can be generated from this data using contour lines from the metR package. The full code on how to generate the below figure is provided in the vignette.

Licensing
The igrf package is distributed under a AGPLv3 license, while the IGRF model code resides in the public domain (CC0) made available by Alken et al. (2021). I'm indebted to the the original authors for making model interoperability easy.
References
- Alken, P., Thebault, E., Beggan, C.D. et al. International Geomagnetic Reference Field: the thirteenth generation. Earth Planets Space 73, 49 (2021). https://doi.org/10.1186/s40623-020-01288-x
Owner
- Name: BlueGreen Labs
- Login: bluegreen-labs
- Kind: organization
- Email: info@bluegreenlabs.org
- Location: Melsele, Belgium
- Website: http://bluegreenlabs.org
- Repositories: 17
- Profile: https://github.com/bluegreen-labs
BlueGreen open science labs & consulting, providing environmental research infrastructure and editorial solutions.
GitHub Events
Total
- Issues event: 1
- Watch event: 1
- Push event: 5
Last Year
- Issues event: 1
- Watch event: 1
- Push event: 5
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Koen Hufkens | k****s@g****m | 45 |
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 5
- Total pull requests: 1
- Average time to close issues: about 2 months
- Average time to close pull requests: about 2 hours
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 0.8
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 1
- Average time to close issues: about 2 months
- Average time to close pull requests: about 2 hours
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- khufkens (5)
Pull Request Authors
- khufkens (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 235 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 2
- Total maintainers: 1
cran.r-project.org: igrf
International Geomagnetic Reference Field
- Homepage: https://github.com/bluegreen-labs/igrf
- Documentation: http://cran.r-project.org/web/packages/igrf/igrf.pdf
- License: AGPL-3
-
Latest release: 2.0
published 12 months ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.6 depends
- covr * suggests
- ggplot2 * suggests
- knitr * suggests
- metR * suggests
- rmarkdown * suggests
- rnaturalearth * suggests
- rnaturalearthdata * suggests
- testthat * suggests
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite