align_frames — ASTROSTACK align op

Data kinds: imagesimages

Call: import astrostack; astrostack.align_frames(frames, reference=0, order=3, **align_kw) (or opsastrostack.get("align_frames"))

Usage

Register a series of frames onto one reference.

> The detailed description below is the original text — the summary and the headings are translated.

各フレームについて :func:frame_align で変換を推定し、

:func:scipy.ndimage.affine_transform で逆写像・再標本化する。

正直な注意: 補間は像を保存しない。ノイズ無しの 64x64 / 12 星を

`(0.5, 0.5)` px だけずらして戻した実測::

order=1 (双一次) 総フラックス -0.016 % 星のピーク -11.437 %

order=3 (スプライン) 総フラックス -0.016 % 星のピーク -0.312 %

総フラックスはどちらでもほぼ保たれるのに、**星のピークは双一次だと 1 割

以上落ちる** —— 0.5 px ずらしは双一次にとって最悪の位相で、隣り合う

4 画素の単純平均になるからである。既定を `order=3` にしてあるのはこの

実測による(`order=3` は星の周りに極小の負の縁を作るが、上の測定では

最小値 -0.0000 で目に見える量ではなかった)。

フラックスもピークも厳密に保ちたいなら補間せず :func:drizzle_resample

へ渡すこと —— 補間しないことが drizzle の存在理由そのもの。ただし

推定シフトをそのまま渡してはいけない: ここで返す `matrices` の並進は

「基準へ戻す」向きで、drizzle が要る向きとは符号が逆。

:func:drizzle_shifts を通すこと::

aligned, mats = align_frames(frames)

sci, wht = drizzle_resample(frames, drizzle_shifts(mats), scale=2.0)

Returns `(aligned, matrices)`:

• `aligned —— 長さ N の list、各 (H, W) float64(images` 語彙)。

基準フレームは変換を通さずそのまま返す(恒等変換でも補間は像を鈍らせる

ので、通す理由が無い)。

• `matrices —— 長さ N の list、各 (3, 3)`。基準は単位行列。

Raises `ValueError`: *frames* が list / tuple でない / 枚数が 2 未満 /

*reference* が範囲外 / *order* が 0〜5 の外 / :func:frame_align

どれか 1 枚で失敗した場合(失敗を黙って恒等変換に落とさない)。

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

astro_stackingpy -3.11 examples/astro_stacking.py

Ops the type connects to (they accept images as input)

lucky_select · sigma_clip_stack · drizzle_resample · cosmic_ray_reject_stack

Same category (align)

frame_align


*Provenance: astrostack.py — ASTROSTACK operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.