Skip to main content

Merged Interplanetary Data from L1

Python client for the MIDL solar wind dataset.

Install

pip install csem-midl

Quickstart

import midl

data = midl.load("2005-01-01 00:00", "2005-01-01 01:00", 32)
print(data)
<xarray.Dataset> Size: 4kB
Dimensions:  (time: 61)
Coordinates:
  * time     (time) datetime64[ns] 488B 2005-01-01 ... 2005-01-01T01:00:00
Data variables:
    Bx       (time) float64 488B -6.05 -3.94 -3.7 -3.75 ... -2.01 -1.78 -2.08
    By       (time) float64 488B 3.84 3.5 3.12 2.94 3.2 ... 4.97 5.3 5.29 5.2
    Bz       (time) float64 488B -0.93 -4.06 -4.83 -4.92 ... 1.25 2.04 2.05 2.11
    Ux       (time) float64 488B -422.3 -429.9 -433.6 ... -437.4 -441.8 -441.8
    Uy       (time) float64 488B -13.38 -12.91 -9.05 ... -28.15 -27.06 -26.68
    Uz       (time) float64 488B 26.93 47.59 54.86 54.99 ... 0.46 1.42 0.92
    rho      (time) float64 488B 5.169 5.439 5.481 5.359 ... 6.131 6.363 6.323
    T        (time) float64 488B 1.33e+05 1.321e+05 ... 1.159e+05 1.159e+05
Attributes:
    source:             MIDL
    url:                https://csem.engin.umich.edu/MIDL/
    target:             32Re
    midl_propagation:   {'method': 'ballistic', 'target_re': 32.0}
# 14Re and 32Re Ballistically-propagated data are available for direct download
midl.load("2024-05-10 00:00", "2024-05-11 01:00", 14, method="ballistic")
midl.load("2024-05-10 00:00", "2024-05-11 01:00", 32, method="ballistic") 

# [-70,70]Re MHD-propagated data are available for direct download
midl.load("2024-05-10 00:00", "2024-05-11 01:00", 30, method="mhd")

# Any value can be ballistically propagated client-side
midl.load("2024-05-10 00:00", "2024-05-11 01:00", 20.25, method="ballistic") 

# Data at L1 can be downloaded directly as well 
midl.load("2024-05-10 00:00", "2024-05-11 01:00", "L1")

Client-side MHD propagation is not supported.

Coordinate systems

MIDL data is native GSM. Pass coords="GSE" or coords="SM" (case-insensitive, default "GSM") to rotate the vector variables (Bx, By, Bz, Ux, Uy, Uz) per minute using the server's published angle files, where psi = gsm_gse_angle_deg and mu = dipole_tilt_deg:

midl.load("2024-05-10 00:00", "2024-05-11 01:00", 32, coords="GSE")
midl.load("2024-05-10 00:00", "2024-05-11 01:00", "L1", coords="SM")
By_gse = cos(psi)*By_gsm - sin(psi)*Bz_gsm     # Bx unchanged
Bz_gse = sin(psi)*By_gsm + cos(psi)*Bz_gsm

Bx_sm  = cos(mu)*Bx_gsm - sin(mu)*Bz_gsm       # By unchanged
Bz_sm  = sin(mu)*Bx_gsm + cos(mu)*Bz_gsm

Vector components are rotated in each minute's instantaneous frame orientation (standard convention, same as OMNI). Scalars (rho, T) and provenance columns are untouched, and the L1 X variable always remains the reference satellite X_GSM position regardless of coords.

Saving to file:

midl.to_csv(data, "storm.csv")
midl.to_dat(data, "storm.dat")

Data is cached locally after the first download.

Using with spacepy

MIDL Datasets convert to a spacepy SpaceData in a few lines:

import midl
from spacepy.datamodel import SpaceData, dmarray

ds = midl.load("2005-01-01 00:00", "2005-01-01 01:00", 32)

sd = SpaceData(attrs=dict(ds.attrs))
sd["Epoch"] = dmarray(ds["time"].values, attrs={"units": "UTC"})
for name, da in ds.data_vars.items():
    sd[name] = dmarray(da.values, attrs=dict(da.attrs))

Tutorials

  • Merging MIDL with IMP-8 — merge MIDL L1 with external satellite data to fill gaps in the 1998–2004 ACE-only era

See also

  • MIDL-Pipeline — the code that produces the MIDL dataset
  • MSWIM2D — 2-D MHD solar wind model (1–75 AU) driven by MIDL L1 data; Python client mswim2d

Metadata

Release files for csem-midl 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csem-midl 1.0.1
File Size Uploaded
csem_midl-1.0.1.tar.gz 7.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for csem-midl 1.0.1
File Interpreter ABI Platform
csem_midl-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.6 MB

Release files / csem_midl-1.0.1.tar.gz

Download URL csem_midl-1.0.1.tar.gz
Size 7.6 MB
Tags Source
SHA-256 checksum
How to use checksums
62f0b428d54554bd4fa715edb0877724fcc50fac99e9de89fd1ead74b353f454
BLAKE2b-256 checksum
How to use checksums
fe8e2f35dfcbaae617a8a0c91188e89a0129fcd3d261d28f651da867b904c7d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release files / csem_midl-1.0.1-py3-none-any.whl

Download URL csem_midl-1.0.1-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
760f34b11e08719c2228181b962e4f356b2a7f47690db045335831597ec01686
BLAKE2b-256 checksum
How to use checksums
4119b30ada7d60dbaee155dab176d48a3bd511b29200728a4afac76767bdfd97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

This release

1.0.1 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page