{"id":19180596,"url":"https://github.com/prajwel/aafitrans","last_synced_at":"2025-05-07T22:28:39.458Z","repository":{"id":149903805,"uuid":"622480934","full_name":"prajwel/aafitrans","owner":"prajwel","description":"Match coordinate lists.","archived":false,"fork":false,"pushed_at":"2024-10-24T05:46:19.000Z","size":48,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T03:33:55.514Z","etag":null,"topics":["affine-transformation","astronomy","coordinate-mapping","coordinate-transformation","coordinates","euclidean-similarity","match","matching","pattern-matching","rotation","tracking","transform","translation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prajwel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-02T08:41:41.000Z","updated_at":"2024-10-24T05:46:23.000Z","dependencies_parsed_at":"2024-11-09T10:50:17.602Z","dependency_job_id":"8a2727e7-cae2-4ba7-bd63-3911a21ecc08","html_url":"https://github.com/prajwel/aafitrans","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"a598339e84315a1fcb7e1e84cbf9192e5af5e7e0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwel%2Faafitrans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwel%2Faafitrans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwel%2Faafitrans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prajwel%2Faafitrans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prajwel","download_url":"https://codeload.github.com/prajwel/aafitrans/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250976013,"owners_count":21516873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["affine-transformation","astronomy","coordinate-mapping","coordinate-transformation","coordinates","euclidean-similarity","match","matching","pattern-matching","rotation","tracking","transform","translation"],"created_at":"2024-11-09T10:50:14.606Z","updated_at":"2025-05-07T22:28:39.432Z","avatar_url":"https://github.com/prajwel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aafitrans (AstroAlign FInd TRANSform)\n\u003e Match coordinate lists.\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10041152.svg)](https://doi.org/10.5281/zenodo.10041152)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/aafitrans)\n\nAafitrans is a Python package that builds upon the capabilities of the Astroalign package's `find_transform` function. It incorporates several modifications to improve its functionality and performance:\n\n1. Enhanced RANSAC Algorithm: The RANSAC algorithm used in Aafitrans has been optimized to provide a solution that minimizes the sum of squared residuals. This improvement ensures a more accurate transformation estimation.\n\n2. Arun and Horn's Method: Aafitrans replaces Umeyama's method from `scikit-image` with Arun and Horn's method for estimating `'euclidean'` or `'similarity'` transformations. \n\n3. Reflection Support: Unlike Astroalign, Aafitrans enables the matching of coordinate lists that include reflection along one axis. This enhancement expands the range of transformations that can be accurately estimated.\n\n4. Extended Transformation Options: Aafitrans supports all transformations available in the `scikit-image` library, providing a comprehensive set of options for aligning and transforming images.\n\u003e Note: only `'euclidean'`, `'similarity'`, and `'affine'` transformations have been tested.\n\n5. Improved Matching Efficiency: The `kdtree_search_radius` parameter in Aafitrans allows users to set the search radius for matches, enabling faster and more efficient matching of corresponding points between images.\n\n6. Reproducible Results: Aafitrans introduces the `seed` parameter, which can be set during each run to ensure the reproducibility of results. This feature is particularly useful for research and debugging purposes.\n\n7. Dependency Optimization: Aafitrans eliminates the need for the `sep` and `bottleneck` packages as dependencies, streamlining the installation process and reducing potential compatibility issues.\n\nPlease see the original Astroalign software at https://github.com/quatrope/astroalign\n  \n## Citations:\nPlease cite both Aafitrans Python package and the [Astroalign article](https://doi.org/10.1016/j.ascom.2020.100384):\n\n* Aafitrans can be cited using Zenodo. Please see the link: https://doi.org/10.5281/zenodo.10041151\n\n* [Astroalign article](https://doi.org/10.1016/j.ascom.2020.100384) citation is provided below.\n\t```\n\tAstroalign: A Python module for astronomical image registration.\n\tBeroiz, M., Cabral, J. B., \u0026 Sanchez, B.\n\tAstronomy \u0026 Computing, Volume 32, July 2020, 100384.\n\t```\n\n\n## Installation\n```bash\npip install aafitrans\n```\n\n## Usage \nIt is similar to Astroalign's [`find_transform`](https://astroalign.quatrope.org/en/latest/tutorial.html#finding-the-transformation) function. However, there are many parameters available for the user to modify. \n```python\nfrom aafitrans import find_transform\ntransf, (matched_source_xy, matched_target_xy) = find_transform(source_xy, target_xy,\n                                                                max_control_points=50,\n                                                                ttype='similarity',\n                                                                pixel_tolerance=2,\n                                                                min_matches=4,\n                                                                num_nearest_neighbors=8,\n                                                                kdtree_search_radius=0.02,\n                                                                n_samples=1,\n                                                                get_best_fit=True,\n                                                                seed=None)\n\n```\n\n\n**WARNING:** The Astroalign [`find_transform`](https://astroalign.quatrope.org/en/latest/tutorial.html#finding-the-transformation)  function takes both coordinate lists and images as input, while the Aafitrans `find_transform` function only takes coordinate lists as input.\n\n## Documentation for `find_transform` function\n\nThe `find_transform` function estimates the transform between two sets of control points, source and target. It returns a GeometricTransform object `T` ([see scikit-image documentation for details](https://scikit-image.org/docs/stable/auto_examples/transform/plot_transform_types.html#sphx-glr-auto-examples-transform-plot-transform-types-py)) that maps pixel x, y indices from the source image s = (x, y) into the target (destination) image t = (x, y). \n\n### Parameters:\n- `source`: An iterable of (x, y) coordinates of the source control points.\n- `target`: An iterable of (x, y) coordinates of the target control points.\n- `max_control_points`: Default value is 50. The maximum number of control points to find the transformation.\n- `ttype`: Default value is `'similarity'`. The type of transform to be estimated. One of the following should be set: {`'euclidean'`, `'similarity'`, `'affine'`, `'piecewise-affine'`, `'projective'`, `'polynomial'`}. For details, see [scikit-image documentation](https://scikit-image.org/docs/stable/api/skimage.transform.html#skimage.transform.estimate_transform). \n- `pixel_tolerance`: The maximum residual error for the estimated tranform.            \n- `min_matches`: The minimum number of matches to be found. A value of 1 refers to 1 triangle, corresponding to 3 pairs of coordinates. \n- `num_nearest_neighbors`: The number of nearest neighbors of a given star (including itself) to construct the triangle invariants.                      \n- `kdtree_search_radius`: The default is 0.02. This radius is used to find nearest neighbours while conducting a KD tree search of invariant features. \n- `n_samples`: The minimum number of data points to fit the model to. A value of 1 refers to 1 triangle, corresponding to 3 pairs of coordinates. \n- `get_best_fit`: Whether to minimize the total error.                          \n- `seed`: Seed value for Numpy Random Generator.\n\n### Returns:\n- `T`: GeometricTransform object that maps pixel x, y indices from the source image s = (x, y) into the target (destination) image t = (x, y). It contains parameters of the transformation.\n- `(source_pos_array, target_pos_array)`: A tuple of corresponding star positions in source and target.\n\n### Raises:\n- `TypeError`: If input type of `source` or `target` is not supported.\n- `ValueError`: If it cannot find more than 3 stars on any input.\n- `MaxIterError`: If no transformation is found.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajwel%2Faafitrans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprajwel%2Faafitrans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajwel%2Faafitrans/lists"}