Canonical MIDAS radial-distortion model: layout tables, v1<->v2 coefficient mapping, and a backend-agnostic (numpy/torch) distortion kernel.
Project description
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))
Project details
Release history Release notifications | RSS feed
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 midas_distortion-0.2.0.tar.gz.
File metadata
- Download URL: midas_distortion-0.2.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90d03683f22a635fbd12a5ad101174b2e286f47e00b3f46269bff91b41823224
|
|
| MD5 |
4a04a61196beba6e459945b7a9d6e16a
|
|
| BLAKE2b-256 |
b3d092fef153d06f5cb99b4c80b60abe04acd8769418cbc72b76adcb6ea90f20
|
Provenance
The following attestation bundles were made for midas_distortion-0.2.0.tar.gz:
Publisher:
python-packages.yml on marinerhemant/MIDAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_distortion-0.2.0.tar.gz -
Subject digest:
90d03683f22a635fbd12a5ad101174b2e286f47e00b3f46269bff91b41823224 - Sigstore transparency entry: 1602456103
- Sigstore integration time:
-
Permalink:
marinerhemant/MIDAS@76361cb1903942a20bf77163e5e36f6bbef917bc -
Branch / Tag:
refs/tags/midas-distortion-v0.2.0 - Owner: https://github.com/marinerhemant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@76361cb1903942a20bf77163e5e36f6bbef917bc -
Trigger Event:
release
-
Statement type:
File details
Details for the file midas_distortion-0.2.0-py3-none-any.whl.
File metadata
- Download URL: midas_distortion-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93b843d47241088c31fd01bb334ceed79e68a32f65db9624d24813d4686b0311
|
|
| MD5 |
3589a52bd7bbcddc7847861053b8420e
|
|
| BLAKE2b-256 |
9d2f52ff7244bc370f64a2595f5812693fdfce74c1d9b10f57ec85aa6a29815e
|
Provenance
The following attestation bundles were made for midas_distortion-0.2.0-py3-none-any.whl:
Publisher:
python-packages.yml on marinerhemant/MIDAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_distortion-0.2.0-py3-none-any.whl -
Subject digest:
93b843d47241088c31fd01bb334ceed79e68a32f65db9624d24813d4686b0311 - Sigstore transparency entry: 1602456201
- Sigstore integration time:
-
Permalink:
marinerhemant/MIDAS@76361cb1903942a20bf77163e5e36f6bbef917bc -
Branch / Tag:
refs/tags/midas-distortion-v0.2.0 - Owner: https://github.com/marinerhemant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@76361cb1903942a20bf77163e5e36f6bbef917bc -
Trigger Event:
release
-
Statement type: