Skip to main content

koffi

Known Objects From Fits Indices

PyPI version

Template

GitHub Workflow Status codecov GitHub issue custom search in repo

A 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.

This package is based off of code developed by Jeremy Kubica for the KBMOD package.

Setup

Install from PyPI

koffi is now pip installable! To get the latest version, just run:

pip install koffi

Install from source

In python virtual environment of your choice:

git clone https://github.com/lincc-frameworks/koffi.git
cd koffi
pip install .
python setup.py build

Usage

At the most basic level, koffi can be used to find all the known objects based on FITS image metadata.

import koffi

filename = 'path/to/image/data.fits'
image = koffi.ImageMetadata(filename)

# SkyBoT - get all possible objects in given image.
skybot_objects = koffi.skybot_search_frame(image)

# JPL Horizons = get all possible objects in given image.
jpl_objects = koffi.jpl_search_frame(image)

We can also use koffi to check against a list of provided sources; the search functions will return a list of matches.

# a possible observation in ra dec + the observation time in mjd.
position = [200.501562, -14.166247]
time = image.get_epoch().mjd

# the PotentialSource class is our interface for checking possible discoveries against known objects.
# position at time can be access by ps[time]
ps = koffi.PotentialSource()
ps.build_from_times_and_known_positions([position], [time])

# return a list of possible matches, attached to the index of a potential source.
skybot_observations = koffi.skybot_query_known_objects([ps], image, tolerance = 0.25)

jpl_observations = koffi.jpl_query_known_objects([ps], image, tolerance = 0.25)

At 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! We do this by making use of the ImageMetadataStack class.

filenames = [
	'/path/to/data/434593.fits', 
	'/path/to/data/434601.fits', 
	'/path/to/data/435478.fits', 
	'/path/to/data/435486.fits', 
	'/path/to/data/435494.fits'
]
# ImageMetadataStack will build the stack for you, just provide it with
# a list of filenames!
images = koffi.ImageMetadataStack(filenames)

# now let's make 2 PotentialSource objects, 2 different ways.
# we can build for a list of ra dec pairs...
positions1 = [
	[200.501433, -14.166194],
	[200.502433, -14.166194],
	[200.503433, -14.166194],
	[200.504433, -14.166194],
	[200.505433, -14.166194]
]
# or from a list of x and y coordinates in the image(s)!
positions2 = [
  [97, 200],
  [101, 204],
  [105, 208],
  [109, 212],
  [113, 216]
]

ps1 = koffi.PotentialSource()
ps2 = koffi.PotentialSource()

# it's highly recommended that you associated your potential source positions with times in mjd given
# from the ImageMetadataStack.get_mjds() method!
mjds = images.get_mjds()

ps1.build_from_times_and_known_positions(positions1, mjds)
ps2.build_from_images_and_xy_positions(positions2, mjds)
sources = [ps1, ps2]

# stack search functions will return a count of each object that it was able to be associated with a potential source.
# key for the dict is the index of potential sources.
possible_detections_skybot = koffi.skybot_query_known_objects_stack(sources, images)
possible_detections_jpl = koffi.jpl_query_known_objects_stack(sources, images)

Acknowledgements

This project is supported by Schmidt Sciences.

The 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.

Release files for koffi 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for koffi 0.1.2
File Size Uploaded
koffi-0.1.2.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for koffi 0.1.2
File Interpreter ABI Platform
koffi-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 39.6 kB

Release files / koffi-0.1.2.tar.gz

Download URL koffi-0.1.2.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9fbb07a2378344457ab4927385a12459287476d3f70d7585a1649ccfc556f256
BLAKE2b-256 checksum
How to use checksums
958497c3bdc739b0400f5582b51343ce919c4e955fa6639f08f30386971b55e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / koffi-0.1.2-py3-none-any.whl

Download URL koffi-0.1.2-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a6b7376632b8cdb2c9ee7dca3b164547a52a221323f06e4fcd5addeec670cf6
BLAKE2b-256 checksum
How to use checksums
616fc125b3a407f518e2a2160e80e00a6c0ecef482c2d4024cf3e06fbf466dda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page