Python bindings for IRI-2020 model
Project description
IRI-2020 Python Wrapper
iri20py is a wrapper around the IRI-2020 empirical model.
This repository includes a version of the IRI-2020 model where the call signatures have been modified for
ease of integration with Python. The integration is achieved by means of a FORTRAN shim (irishim.f90)
that is compiled into a module using F2PY. Data files
associated with IRI-2020 are included in the data folder and are available at
runtime. The wrapper automatically retrieves the latest available ig_rz.dat
and apf107.dat files on import.
Installation
pip install iri20py git+https://github.com/sunipkm/iri20py
Usage
from iri20py import Iri2020, alt_grid
from datetime import datetime, UTC
import matplotlib.pyplot as plt
# Instantiate the model
iri = Iri2020()
# Note: iri is a singleton (thread safety with FORTRAN)
# Evaluate the model
_, ds = iri.evaluate(
datetime(2022, 3, 12, 0, 0, 0, tzinfo=UTC),
40, -70,
alt_grid()
)
# ds is an xarray Dataset
# Plot electron density profile
ds.Ne.plot(y='alt_km')
plt.show()
Output Dataset Format
- Coordinates
- Altitude (
alt_km): Altitude in km
- Altitude (
- Data Variables (as a function of altitude)
- Electron density (
Ne) in cm-3 - Electron temperature (
Te) in K - Ion temperature (
Ti) in K - O+, H+, He+, O2+, NO+, N+ and cluster ion densities (cm-3)
- Electron density (
- Attributes
settings: JSON string of settings (iri20py.Settings) used to evaluate the model.date: ISO formatted date and time for which the model was evaluated.latandlon: Latitude and longitude for where the model was evaluated.- Additional attributes as returned in the
OARRstruct (refer to IRI-2020 documentation). These additional attributes are provided as JSON dictionaries containing avalue, itsunit, a longer name (long_name) and an associateddescription, if available.
The dataset is NetCDF4 compatible.
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
iri20py-0.0.1.tar.gz
(2.1 MB
view details)
File details
Details for the file iri20py-0.0.1.tar.gz.
File metadata
- Download URL: iri20py-0.0.1.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
383601f385c8cd6a30f911eafa3dfc600b84d50788dd9cc5ad29eb35435cff99
|
|
| MD5 |
fdbed326223155e4861b5b289c23b447
|
|
| BLAKE2b-256 |
917aafa181011302fbab67769aa1caf59482e166d7c2067b60cb91937a45d57d
|