Skip to main content

Optimal Image Subtraction

Project description

Optimal Image Subtraction (OIS)

Build Status codecov.io Documentation Status DOI Updates Python 3 PyPI version

OIS is a Python package to perform optimal image subtraction on astronomical images. It also has a companion command-line program written entirely in C.

OIS offers different methods to subtract images:

Each method can (optionally) simultaneously fit and remove common background.

You can find a Jupyter notebook example with the main features at http://toros-astro.github.io/ois.


Installation

To install the Python module:

$ pip install ois

To instal and run the C command-line program, download this repo to your local machine and execute:

$ git clone https://github.com/toros-astro/ois.git
$ cd ois
$ make ois
$ ./ois --help

The C command-line program is somewhat limited in functionality compared to the Python module. Please see the documentation for more information.


Minimal usage example

>>> from ois import optimal_system
>>> diff = optimal_system(image, image_ref)[0]

Check the documentation for a full tutorial.


Other Parameters:

kernelshape: shape of the kernel to use. Must be of odd size.

bkgdegree: degree of the polynomial to fit the background. To turn off background fitting set this to None.

method: One of the following strings

  • Bramich: A Delta basis for the kernel (all pixels fit independently). Default method.

  • AdaptiveBramich: Same as Bramich, but with a polynomial variation across the image. It needs the parameter poly_degree, which is the polynomial degree of the variation.

  • Alard-Lupton: A modulated multi-Gaussian kernel. It needs the gausslist keyword. gausslist is a list of dictionaries containing data of the gaussians used in the decomposition of the kernel. Dictionary keywords are: center, sx, sy, modPolyDeg

Extra parameters are passed to the individual methods.

poly_degree: needed only for AdaptiveBramich. It is the degree of the polynomial for the kernel spatial variation.

gausslist: needed only for Alard-Lupton. A list of dictionaries with info for the modulated multi-Gaussian. Dictionary keys are:

  • center: a (row, column) tuple for the center of the Gaussian. Default: kernel center.
  • modPolyDeg: the degree of the modulating polynomial. Default: 2
  • sx: sigma in x direction. Default: 2.
  • sy: sigma in y direction. Deafult: 2.

Author: Martin Beroiz

martinberoiz@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ois, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size ois-0.2.tar.gz (11.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page