https://github.com/quatrope/astroalign
A tool to align astronomical images based on asterism matching
https://github.com/quatrope/astroalign
alignment asterism-matching astronomy registration stellar-astronomical-images transformations
Last synced: 6 months ago
JSON representation
A tool to align astronomical images based on asterism matching
- Host: GitHub
- URL: https://github.com/quatrope/astroalign
- Owner: quatrope
- License: mit
- Created: 2016-01-05T21:52:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T06:42:30.000Z (over 1 year ago)
- Last Synced: 2024-04-29T17:09:17.336Z (over 1 year ago)
- Topics: alignment, asterism-matching, astronomy, registration, stellar-astronomical-images, transformations
- Language: Python
- Size: 36.6 MB
- Stars: 133
- Watchers: 15
- Forks: 39
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

***
[](https://quatrope.github.io/)
[](https://github.com/quatrope/astroalign/actions/workflows/aa-ci.yml)
[](https://codecov.io/github/quatrope/astroalign)
[](http://astroalign.readthedocs.org/en/latest/?badge=latest)
[](https://pypi.org/project/astroalign/)

[](http://ascl.net/1906.001)**ASTROALIGN** is a python module that will try to align two stellar astronomical images, especially when there is no WCS information available.
It does so by finding similar 3-point asterisms (triangles) in both images and deducing the affine transformation between them.
Generic registration routines try to match feature points, using corner
detection routines to make the point correspondence.
These generally fail for stellar astronomical images, since stars have very
little stable structure and so, in general, indistinguishable from each other.
Asterism matching is more robust, and closer to the human way of matching stellar images.Astroalign can match images of very different field of view, point-spread function, seeing and atmospheric conditions.
It may not work, or work with special care, on images of extended objects with few point-like sources or in very crowded fields.
You can find a Jupyter notebook example with the main features at [http://quatrope.github.io/astroalign/](http://quatrope.github.io/astroalign/).
**Full documentation:** https://astroalign.readthedocs.io/
# Installation
Install from PyPI
```bash
$ pip install astroalign
```## Running Tests
```bash
python tests/test_align.py
```or using pytest:
```bash
pytest -v
```# Usage example
```
>>> import astroalign as aa
>>> aligned_image, footprint = aa.register(source_image, target_image)
```In this example `source_image` will be interpolated by a transformation to coincide pixel to pixel with `target_image` and stored in `aligned_image`.
If we are only interested in knowing the transformation and the correspondence of control points in both images, use `find_transform` will return the transformation in a [Scikit-Image](https://scikit-image.org/) `SimilarityTransform` object and a list of stars in source with the corresponding stars in target.
```
>>> transf, (s_list, t_list) = aa.find_transform(source, target)
````source` and `target` can each either be the numpy array of the image (grayscale or color),
or an iterable of (x, y) pairs of star positions on the image.The returned `transf` object is a scikit-image [`SimilarityTranform`](http://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.SimilarityTransform) object that contains the transformation matrix along with the scale, rotation and translation parameters.
`s_list` and `t_list` are numpy arrays of (x, y) point correspondence between `source` and `target`. `transf` applied to `s_list` will approximately render `t_list`.
# Related Software
There are other related software that may offer similar functionality as astroalign.
This list is not exhaustive and may be others.* [astrometry.net](https://github.com/dstndstn/astrometry.net)
* [reproject](https://github.com/astropy/reproject)
* [Watney Astrometry Engine](https://github.com/Jusas/WatneyAstrometry)
* [Stellar Solver](https://github.com/rlancaste/stellarsolver)
* [THRASTRO](https://github.com/THRASTRO/astrometrylib)
* [Montage](https://github.com/Caltech-IPAC/Montage)
* [Aafitrans](https://github.com/prajwel/aafitrans)
* [astrometry](https://github.com/neuromorphicsystems/astrometry)# Citation
If you use astroalign in a scientific publication, we would appreciate citations to the following [paper](https://www.sciencedirect.com/science/article/pii/S221313372030038X):
Astroalign: A Python module for astronomical image registration.
Beroiz, M., Cabral, J. B., & Sanchez, B.
Astronomy & Computing, Volume 32, July 2020, 100384.***