midas-distortion
Canonical MIDAS radial-distortion model — the single source of truth for the detector distortion layout and the v1↔v2 coefficient mapping, shared by:
- midas-calibrate-v2 — fits the distortion (v2 canonical names).
- midas-peakfit — applies it to spot geometry (numpy).
- midas-transforms — applies it to spot geometry (torch).
Model
Multiplicative factor on the projected radius R (with ρ = R / RhoD,
η' = 90° − η):
D(ρ, η) = 1
+ iso_R2·ρ² + iso_R4·ρ⁴ + iso_R6·ρ⁶ (isotropic)
+ a1·ρ⁴·cos( η' + phi1) (1-fold; ρ⁴ is a v1 quirk)
+ a2·ρ²·cos(2η' + phi2)
+ a3·ρ³·cos(3η' + phi3)
+ a4·ρ⁴·cos(4η' + phi4)
+ a5·ρ⁵·cos(5η' + phi5)
+ a6·ρ⁶·cos(6η' + phi6)
The legacy v1 ordering (p0..p14, phases scattered) is v1_term_layout();
v1↔v2 reindexing is exact (v1_to_v2_coeffs / v2_to_v1_coeffs).
Backend-agnostic kernel
distortion_factor(R_norm, eta_deg, p_coeffs, terms=...) dispatches cos /
ones_like on the input's own array library, so numpy and torch consumers
evaluate bit-for-bit the same model (up to floating-point reassociation).
import numpy as np
from midas_distortion import distortion_factor, v1_term_layout, v1_to_v2_coeffs
p_v1 = np.zeros(15) # legacy paramstest p0..p14
D = distortion_factor(R/RhoD, eta_deg, p_v1, terms=v1_term_layout())
# …or convert once and use the v2 layout (default):
D = distortion_factor(R/RhoD, eta_deg, v1_to_v2_coeffs(p_v1))
Metadata
Release files for midas-distortion 0.2.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 | |
|---|---|---|---|
| midas_distortion-0.2.0.tar.gz | 11.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| midas_distortion-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / midas_distortion-0.2.0.tar.gz
| Download URL | midas_distortion-0.2.0.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90d03683f22a635fbd12a5ad101174b2e286f47e00b3f46269bff91b41823224
|
|
BLAKE2b-256 checksum How to use checksums |
b3d092fef153d06f5cb99b4c80b60abe04acd8769418cbc72b76adcb6ea90f20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 22, 2026.
Transparency logRelease files / midas_distortion-0.2.0-py3-none-any.whl
| Download URL | midas_distortion-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93b843d47241088c31fd01bb334ceed79e68a32f65db9624d24813d4686b0311
|
|
BLAKE2b-256 checksum How to use checksums |
9d2f52ff7244bc370f64a2595f5812693fdfce74c1d9b10f57ec85aa6a29815e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 22, 2026.
Transparency log