The python module for DIFI-8 and xDIFI2
Project description
DIFI-8 IONOSPHERE MAGNETIC FIELD MODEL
The Dedicated Ionospheric Field Inversion (DIFI) model is a Swarm-based, global model of the Sq and equatorial electrojet magnetic fields at mid and low-latitudes. It describes variations with local time, season and solar flux and separates primary and induced magnetic fields. The latest version of DIFI is DIFI-8. Please see the DIFI-8 for the detail. Find info on xDIFI2 here.
Prerequirements
- Officially Python 3.9, 3.10, 3.11. 3.12 3.13
- geomaglib >= 1.2.1
- install by
pip install geomaglib>=1.2.1
- install by
- numpy
Installation
The recommended way to install wmm-calculator is via pip
pip install pyDIFI
Quick Start
Get magnetic vectors from single point
from DIFI import getSQfield
lat, lon, year, month, day, hour = 20.5, 100.5, 2024, 6, 6, 0
B = getSQfield(lat, lon, year, month, day, hour=hour)
It will return the results in dict type
{'Z': array([13.19036336]), 'Y': array([28.73130052]), 'X': array([0.65322314])}
Get magnetic vectors from array inputs
import random
from DIFI import getSQfield
year = 2023
month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
day = 15
N = len(month)
lat = [random.uniform(-90, 90) for _ in range(N)]
lon = [random.uniform(-180, 180) for _ in range(N)]
B = getSQfield(lat, lon, year, month, day, model_name="xdifi2")
print(B)
It will return the results
{'Z': array([-2.89438186, 18.22932278, -0.66058193, 7.91297099, 8.00560867,
-2.84424521, 0.28690831, 5.21360212, 1.30044321, 5.78345537,
-0.15228731, 0.17291943]),
'Y': array([ 2.47943185, 36.00415516, 1.29842625, 22.99920884,
4.12382535, 2.21563329, -5.13570097, 6.71462628,
-9.61616475, 0.52689522, -10.66703289, -0.21119736]),
'X': array([ 2.77922129, 45.06151382, 1.14500601, -9.76631768, -1.57326838,
4.39040841, -7.6578116 , 11.15431048, -5.66268463, -6.03204388,
-4.6054734 , 4.19473274])}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydifi-8.1.5.tar.gz.
File metadata
- Download URL: pydifi-8.1.5.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82e1ef14ee1a0f3e3c905d4c496287977ad65e7e74ae14ab1bedeca0eac2f63f
|
|
| MD5 |
c58ac148b7c87971b9fdbe1d39cf7427
|
|
| BLAKE2b-256 |
a738891fe96c9b406266abec5f5882b07292edd8492b9c4c2a44c4a8f629b57c
|
File details
Details for the file pydifi-8.1.5-py3-none-any.whl.
File metadata
- Download URL: pydifi-8.1.5-py3-none-any.whl
- Upload date:
- Size: 2.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c27f9de923cdd010930727a414212ba10dc8cdb60332681dcdebf56f402bee40
|
|
| MD5 |
322c59a77773d39a745b67c61f74963c
|
|
| BLAKE2b-256 |
63dbce0a2756c057058a6e1b3c902111f6af1416660a42b998f562d489e04a9b
|