fastmag1c
MAG1C methane retrieval with an exact rank-2 covariance update.
MAG1C recomputes the background covariance of each CCD column at every iteration, which costs O(Ns²) per step. The update is a rank-2 change of a fixed base covariance, so it can be done in O(Ns) with the same result.
Installation
pip install "fastmag1c[emit]"
pip install earthaccess # only to download the example granule
Quick start
import earthaccess
import fastmag1c
# EMIT L1B radiance from NASA LP DAAC, needs a free Earthdata account
earthaccess.login()
granule = earthaccess.search_data(short_name="EMITL1BRAD", granule_name="*20240604T140353_2415609_030*")
url = [u for u in granule[0].data_links() if "EMIT_L1B_RAD" in u]
path = earthaccess.download(url, ".")[0]
rad, wl = fastmag1c.read_emit(path)
fastmag1c.compare(rad, wl, reference=True)
compare runs both filters, times them (mean of 3 runs after a warm-up) and
reports the difference over all pixels and over plume pixels. With reference=True it also runs MAG1C in
float64, to show the float32 error of each method.
To get only the map:
ch4 = fastmag1c.retrieve(rad, wl) # (downtrack, crosstrack) in ppm·m
# lat/lon grid, GDAL geotransform and CRS (WKT) of the granule
ch4_map, transform, crs = fastmag1c.orthorectify(ch4, path)
Results on EMIT
Granule 20240604T140353_2415609_030 (2528 × 1242 pixels, 50 bands in
2122–2488 nm, 30 iterations). Times are the mean of 3 runs after a warm-up.
Differences are in ppm·m, measured on the RTX A5500 (the A100 gives nearly the
same values), and plume pixels are the 185,015 pixels above 500 ppm·m.
| GPU | dtype | MAG1C (s) | FastMAG1C (s) | Speedup |
|---|---|---|---|---|
| RTX A5500 | float64 | 3.29 | 1.22 | 2.70× |
| RTX A5500 | float32 | 0.89 | 0.78 | 1.15× |
| A100 | float64 | 0.71 | 0.54 | 1.30× |
| A100 | float32 | 0.66 | 0.35 | 1.90× |
| Difference | dtype | max | P99 | P99, plume |
|---|---|---|---|---|
| FastMAG1C − MAG1C | float64 | 2.7e-4 | 2.8e-8 | 2.4e-7 |
| FastMAG1C − MAG1C | float32 | 6.4e3 | 17.9 | 146 |
| MAG1C float32 − MAG1C float64 | 5.9e3 | 11.0 | 79 | |
| FastMAG1C float32 − MAG1C float64 | 6.0e3 | 14.9 | 128 |
In float64 both methods give the same map. In float32 MAG1C itself already departs from its float64 result by a similar amount, so use float64 when the values matter.
Citation
@article{aybar2026fastmag1c,
title = {Fast Iterative Methane Retrieval Through Algebraically Exact Rank-2 Acceleration},
author = {Aybar, Cesar and Contreras, Julio and G{\'o}mez-Chova, Luis},
journal = {IEEE Geoscience and Remote Sensing Letters},
year = {2026}
}
License
MIT. See LICENSE.
Metadata
Release files for fastmag1c 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastmag1c-0.1.0.tar.gz | 8.5 kB | With provenance | Details for fastmag1c-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastmag1c-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fastmag1c-0.1.0-py3-none-any.whl |
Total release size: 18.1 kB
Release files / fastmag1c-0.1.0.tar.gz
| Download URL | fastmag1c-0.1.0.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39674a1d2e350ef3c7de5bb4f7b3d636e1be36142db0bccaff0c99b644e3cbd3
|
|
BLAKE2b-256 checksum How to use checksums |
e296fa404462e4a44cddee324bb4298a4addb4c5869ecbef5583f419134ba779
|
| 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 Oct 15, 2026.
Transparency logRelease files / fastmag1c-0.1.0-py3-none-any.whl
| Download URL | fastmag1c-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b262ef8f09e4f889e9dd0833b09f2b6a4bd61f923004b1b147b964aaa552e056
|
|
BLAKE2b-256 checksum How to use checksums |
aea8d09b59d17479f074349ab24218da6397d1b3d5737be3390d921033e26dc4
|
| 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 Oct 15, 2026.
Transparency logSecurity for fastmag1c 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fastmag1c-0.1.0.tar.gz
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 Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.