{"id":38508060,"url":"https://github.com/lincc-frameworks/koffi","last_synced_at":"2026-01-17T06:17:53.866Z","repository":{"id":155305127,"uuid":"565999875","full_name":"lincc-frameworks/koffi","owner":"lincc-frameworks","description":"Known Objects From Fits Indices","archived":false,"fork":false,"pushed_at":"2025-02-11T21:18:54.000Z","size":91,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T09:15:49.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lincc-frameworks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-11-14T19:10:14.000Z","updated_at":"2025-02-11T21:18:55.000Z","dependencies_parsed_at":"2025-02-11T01:32:06.820Z","dependency_job_id":null,"html_url":"https://github.com/lincc-frameworks/koffi","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lincc-frameworks/koffi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincc-frameworks%2Fkoffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincc-frameworks%2Fkoffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincc-frameworks%2Fkoffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincc-frameworks%2Fkoffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lincc-frameworks","download_url":"https://codeload.github.com/lincc-frameworks/koffi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lincc-frameworks%2Fkoffi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28502139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T04:31:57.058Z","status":"ssl_error","status_checked_at":"2026-01-17T04:31:45.816Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-17T06:17:48.692Z","updated_at":"2026-01-17T06:17:53.843Z","avatar_url":"https://github.com/lincc-frameworks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koffi\nKnown Objects From Fits Indices\n\n[![PyPI version](https://badge.fury.io/py/KOFFI.svg)](https://badge.fury.io/py/KOFFI)\n\n[![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/)\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lincc-frameworks/koffi/smoke-test.yml)](https://github.com/lincc-frameworks/koffi/actions/workflows/smoke-test.yml)\n[![codecov](https://codecov.io/gh/lincc-frameworks/koffi/graph/badge.svg?token=XS58T19IRJ)](https://codecov.io/gh/lincc-frameworks/koffi)\n[![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/lincc-frameworks/koffi?color=purple\u0026label=Good%20first%20issues\u0026query=is%3Aopen%20label%3A%22good%20first%20issue%22)](https://github.com/lincc-frameworks/koffi/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)\n\n\nA package that should hopefully be helpful to people working with shift-and-stack algorithms and other solar system science use cases. Given an input of possible solar system objects (PotentialSources) relating either to an x and y coordinate of a FITS image or an RA and Dec coordinate with a timestamp, we provide an easy API for converting x and y coordinates into RA and Dec and querying the most well known solar system dynamics api services. Uses the IMCCE's SkyBoT VO tool (Berthier et. al. 2006) and JPL’s SSD (Solar System Dynamics) [API service](https://ssd.jpl.nasa.gov/).\n\nThis package is based off of code developed by Jeremy Kubica for the [KBMOD](https://github.com/dirac-institute/kbmod) package.\n\n## Setup\n### Install from PyPI\nkoffi is now pip installable! To get the latest version, just run:\n```bash\npip install koffi\n```\n### Install from source\nIn python virtual environment of your choice:\n```bash\ngit clone https://github.com/lincc-frameworks/koffi.git\ncd koffi\npip install .\npython setup.py build\n```\n\n## Usage\nAt the most basic level, koffi can be used to find all the known objects based on FITS image metadata.\n```python\nimport koffi\n\nfilename = 'path/to/image/data.fits'\nimage = koffi.ImageMetadata(filename)\n\n# SkyBoT - get all possible objects in given image.\nskybot_objects = koffi.skybot_search_frame(image)\n\n# JPL Horizons = get all possible objects in given image.\njpl_objects = koffi.jpl_search_frame(image)\n```\n\nWe can also use koffi to check against a list of provided sources; the search functions will return a list of matches.\n```python\n# a possible observation in ra dec + the observation time in mjd.\nposition = [200.501562, -14.166247]\ntime = image.get_epoch().mjd\n\n# the PotentialSource class is our interface for checking possible discoveries against known objects.\n# position at time can be access by ps[time]\nps = koffi.PotentialSource()\nps.build_from_times_and_known_positions([position], [time])\n\n# return a list of possible matches, attached to the index of a potential source.\nskybot_observations = koffi.skybot_query_known_objects([ps], image, tolerance = 0.25)\n\njpl_observations = koffi.jpl_query_known_objects([ps], image, tolerance = 0.25)\n```\n\nAt the highest level, we can pass in a stack of images and potential sources and count the number of times they potentially appear in each image!\nWe do this by making use of the ImageMetadataStack class.\n```python\nfilenames = [\n\t'/path/to/data/434593.fits', \n\t'/path/to/data/434601.fits', \n\t'/path/to/data/435478.fits', \n\t'/path/to/data/435486.fits', \n\t'/path/to/data/435494.fits'\n]\n# ImageMetadataStack will build the stack for you, just provide it with\n# a list of filenames!\nimages = koffi.ImageMetadataStack(filenames)\n\n# now let's make 2 PotentialSource objects, 2 different ways.\n# we can build for a list of ra dec pairs...\npositions1 = [\n\t[200.501433, -14.166194],\n\t[200.502433, -14.166194],\n\t[200.503433, -14.166194],\n\t[200.504433, -14.166194],\n\t[200.505433, -14.166194]\n]\n# or from a list of x and y coordinates in the image(s)!\npositions2 = [\n  [97, 200],\n  [101, 204],\n  [105, 208],\n  [109, 212],\n  [113, 216]\n]\n\nps1 = koffi.PotentialSource()\nps2 = koffi.PotentialSource()\n\n# it's highly recommended that you associated your potential source positions with times in mjd given\n# from the ImageMetadataStack.get_mjds() method!\nmjds = images.get_mjds()\n\nps1.build_from_times_and_known_positions(positions1, mjds)\nps2.build_from_images_and_xy_positions(positions2, mjds)\nsources = [ps1, ps2]\n\n# stack search functions will return a count of each object that it was able to be associated with a potential source.\n# key for the dict is the index of potential sources.\npossible_detections_skybot = koffi.skybot_query_known_objects_stack(sources, images)\npossible_detections_jpl = koffi.jpl_query_known_objects_stack(sources, images)\n```\n\n## Acknowledgements\n\nThis project is supported by Schmidt Sciences.\n\nThe team acknowledges support from the DIRAC Institute in the Department of Astronomy at the University of Washington. The DIRAC Institute is supported through generous gifts from the Charles and Lisa Simonyi Fund for Arts and Sciences, and the Washington Research Foundation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flincc-frameworks%2Fkoffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flincc-frameworks%2Fkoffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flincc-frameworks%2Fkoffi/lists"}