https://github.com/quatrope/properimage
Proper Image utils for astronomy.
https://github.com/quatrope/properimage
astronomy coaad-images data-analysis-python dia image-difference image-processing image-subtraction psf-estimation python zogy
Last synced: 2 months ago
JSON representation
Proper Image utils for astronomy.
- Host: GitHub
- URL: https://github.com/quatrope/properimage
- Owner: quatrope
- License: bsd-3-clause
- Created: 2015-06-23T17:46:55.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T16:34:07.000Z (over 1 year ago)
- Last Synced: 2025-04-13T05:19:19.199Z (2 months ago)
- Topics: astronomy, coaad-images, data-analysis-python, dia, image-difference, image-processing, image-subtraction, psf-estimation, python, zogy
- Language: Python
- Homepage:
- Size: 150 MB
- Stars: 27
- Watchers: 4
- Forks: 6
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Proper image treatments
[](https://quatrope.github.io/)
[](https://github.com/quatrope/ProperImage/actions/workflows/python-properimage-ci.yml)
[](http://properimage.readthedocs.io/en/latest/?badge=latest)
[](https://codecov.io/gh/quatrope/ProperImage)
[](https://badge.fury.io/py/properimage)
[](https://tldrlegal.com/license/bsd-3-clause-license-(revised))
[](http://ascl.net/1904.025)
[](https://github.com/ambv/black)This code is inspired on [Zackay & Ofek 2017](http://arxiv.org/abs/1512.06872) papers *How to coadd images?* (see References below).
* It can perform a PSF estimation using [Karhunen-Löeve expansion](https://en.wikipedia.org/wiki/Karhunen–Loève_theorem), which is based on [Lauer 2002](https://doi.org/10.1117/12.461035) work.
* It can perform the statistical proper coadd of several images.
* It can also perform a proper-subtraction of images.
* Images need to be aligned and registered, or at least [astroalign](https://github.com/toros-astro/astroalign) must be installed.
* Contains a nice plot module for PSF visualization (_needs matplotlib_)
## Installation
To install from PyPI
```console
$ pip install properimage
```## Quick usage
### PSF estimation
```python
>>> from properimage import singleimage as si
>>> with si.SingleImage(frame, smooth_psf=False) as sim:
... a_fields, psf_basis = sim.get_variable_psf(inf_loss=0.15)
```### Proper-subtraction of images
To create a proper-subtraction of images:
```python
>>> from properimage.operations import subtract
>>> D, P, Scorr, mask = subtract(ref=ref_path, new=new_path, smooth_psf=False, fitted_psf=True,
... align=False, iterative=False, beta=False, shift=False)
```Where `D`, `P`, `Scorr` refer to the images defined by the same name in [Zackay & Ofek](https://iopscience.iop.org/article/10.3847/0004-637X/830/1/27/meta) paper.
For the full documentation refer to [readthedocs](https://properimage.readthedocs.io).
## Rerefences
> Zackay, B., & Ofek, E. O. (2017). How to Coadd Images. I. Optimal Source Detection and Photometry of Point Sources Using Ensembles of Images. The Astrophysical Journal, 836(2), 187. [Arxiv version](http://arxiv.org/abs/1512.06872)
>
> Zackay, B., & Ofek, E. O. (2017). How to Coadd Images. II. A Coaddition Image that is Optimal for Any Purpose in the Background-dominated Noise Limit. The Astrophysical Journal, 836(2), 188. [Arxiv version](http://arxiv.org/abs/1512.06879)
>
>Zackay, B., Ofek, E. O., & Gal-Yam, A. (2016). Proper Image Subtrraction-Optimal Transient Detection, Photometry, and Hypothesis Testing. [The Astrophysical Journal, 830(1), 27.](https://iopscience.iop.org/article/10.3847/0004-637X/830/1/27/meta)
>
>Lauer, T. (2002, December). Deconvolution with a spatially-variant PSF. In [Astronomical Data Analysis II (Vol. 4847, pp. 167-174). International Society for Optics and Photonics.](https://doi.org/10.1117/12.461035)