dipole

Calculations of dipole axis, dipole poles, and dipole tilt angle

https://github.com/klaundal/dipole

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Calculations of dipole axis, dipole poles, and dipole tilt angle

Basic Info
  • Host: GitHub
  • Owner: klaundal
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 442 KB
Statistics
  • Stars: 10
  • Watchers: 3
  • Forks: 7
  • Open Issues: 2
  • Releases: 0
Created over 8 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Dipole - calculations involving dipole model of Earth's magnetic field

Python code to calculate

  • dipole magnetic field
  • dipole tilt angle
  • centered dipole coordinates and vector components
  • magnetic local time
  • dipole pole locations
  • magnetic flux poleward of some boundary
  • apex base vectors for a dipole magnetic field

The calculations use time-dependendent IGRF coefficients (see https://www.ngdc.noaa.gov/IAGA/vmod/igrf.html for details and https://doi.org/10.1186/s40623-020-01163-9 for even more details) accessed through the ppigrf Python module (https://github.com/klaundal/ppigrf).

For a definition of centered dipole coordinates, see Section 3.1 in https://doi.org/10.1007/s11214-016-0275-y

The code is vectorized, so all calculations should be pretty fast.

Examples

Here is an example calculation of dipole tilt angle. In this example, a Dipole object is initialized for epoch 2022.5, and dipole tilt angle is calculated for two different times

```python import dipole from datetime import datetime

dates = [datetime(2022, 7, 13, 10, 0, 0), datetime(2022, 7, 13, 22, 0, 0)] tilts = dipole.Dipole(2022.5).tilt(dates) ```

Here is an example converting northward-pointing unit vectors from geocentric to centered dipole coordinates. This example also illustrates how numpy broadcasting rules are used for input with different shapes

```python import dipole import numpy as np

lat = 70 lon = np.r_[0:360:15] north = 1 east = 0

d = dipole.Dipole(2010.) # IGRF epoch 2010. cdlat, cdlon, cdeast, cdnorth = d.geo2mag(lat, lon, Ae = east, An = north)

```

Contact

If you find errors, please let me know!

You don't need permission to copy or use this code.

karl.laundal at uib.no

Owner

  • Name: Karl M. Laundal
  • Login: klaundal
  • Kind: user

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: dipole
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - orcid: 'https://orcid.org/0000-0001-5028-4943'
    given-names: Karl
    family-names: Laundal
    email: karl.laundal@uib.no
    name-particle: Karl
    affiliation: 'University of Bergen, Norway'
  - given-names: Jone
    family-names: Reistad
    affiliation: 'University of Bergen, Norway'
    orcid: 'https://orcid.org/0000-0003-3509-5479'
  - given-names: Ashley
    family-names: Smith
    affiliation: 'University of Edinburgh, UK'
    orcid: 'https://orcid.org/0000-0001-5198-9574'
  - given-names: Amalie
    family-names: Hovland
    affiliation: 'University of Bergen, Norway'
    orcid: 'https://orcid.org/0000-0001-5028-4943'
identifiers:
  - type: url
    value: 'https://github.com/klaundal/dipole'
abstract: >-
  Code for working with magnetic dipole model of Earth's
  magnetic field, including dipole coordinates and magnetic
  apex coordinates and base vectors for a dipole field. 
license: MIT

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1