/kbmod

KBMOD (Kernel-Based Moving Object Detection)

Primary LanguageJupyter NotebookBSD 2-Clause "Simplified" LicenseBSD-2-Clause

logo

An image processing library for moving object detection implemented with GPUs.
Based on a Maximum Likelihood detection algorithm for moving astronomical objects.

Build Status LicenseDOI

KBMOD is a set of Python tools to search astronomical images for moving objects based upon method of maximum likelihood detection.

Setup

Requirements

The packages required to build the code are:

  • python3 development headers
  • Scipy (Numpy, Matplotlib)
  • Scikit-learn
  • Cuda 8.0
  • CMake 3

To install:
Open search/pybinds/CmakeLists.txt and verify in the "include_directories" section that the paths to the python headers and to the cuda installation are correct.

Then run source install.bash This will build the python library and run the tests.

If you log out, next time run source setup.bash to reappend the library to the python path

Usage

A short example injecting a simulated object into a stack of images, and then recovering it.

from kbmodpy import kbmod as kb
import numpy as np

# Create a point spread function
psf = kb.psf(1.5)

# load images from list of file paths
imgs =  [ kb.layered_image(file) for file in example_files ]

# Specify an artificial object
flux = 175.0
position = (100.7, 150.3)
velocity = (50, 35)

# Inject object into images
for im in imgs:
    im.add_object(position[0]+im.get_time()*velocity[0], 
                  position[1]+im.get_time()*velocity[1], 
                  flux, psf)

# Recover the object by searching a wide region
velocity_guess = (40, 40)
radius = 20
min_lh = 9.0
min_obs = 10
stack = kb.image_stack(imgs)
search = kb.stack_search(stack, psf)
results = search.region_search(*velocity_guess, radius, min_lh, min_obs)

Short Demonstration

Processing Real Images

Reference

API Reference.

License

The software is open source and available under the BSD license.