Skip to content
Speedy Cosmic Ray Annihilation Package in Python
Python C C++
Branch: master
Clone or download
Pull request Compare This branch is 9 commits behind astropy:master.
cmccully Merge pull request astropy#37 from cmccully/cflags
Default to CFLAGS environment variable for setup if it exists.
Latest commit 3ed58dd Mar 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
astropy_helpers @ d23a53f Updated astropy-helpers to v2.0.2 Oct 15, 2017
astroscrappy Default to CFLAGS environment variable for setup if it exists. Mar 23, 2018
docs Finished merging in new version of astropy package template. Mar 15, 2018
licenses
.gitignore Finished merging in new version of astropy package template. Mar 15, 2018
.gitmodules Updating to the actual astropy-helpers May 19, 2014
.rtd-environment.yml Moving changes from the cookiecutter branch Oct 3, 2017
.travis.yml Fixed packagename in travis file for pep8 check. Mar 16, 2018
CHANGES.rst Back to development: 1.1 Aug 16, 2016
MANIFEST.in
README.rst Finished merging in new version of astropy package template. Mar 15, 2018
TEMPLATE_CHANGES.md Define install_requires in setup.cfg Nov 26, 2016
ah_bootstrap.py Updated astropy-helpers to v2.0.6 Feb 25, 2018
appveyor.yml Backporting #276 Oct 3, 2017
ez_setup.py Updated astropy-helpers to v2.0.2 Oct 13, 2017
readthedocs.yml Changing rtd config, so conda installs will become the default Jul 28, 2016
setup.cfg Finished merging in new version of astropy package template. Mar 15, 2018
setup.py Finished merging in new version of astropy package template. Mar 15, 2018

README.rst

Astro-SCRAPPY: The Speedy Cosmic Ray Annihilation Package in Python

Name : Astro-SCRAPPY

Author : Curtis McCully

Date : October 2014

Optimized cosmic ray detector

Astro-SCRAPPY is designed to detect cosmic rays in images (numpy arrays), based on Pieter van Dokkum's L.A.Cosmic algorithm.

Much of this was originally adapted from cosmics.py written by Malte Tewes. I have ported all of the slow functions to Cython/C, and optimized where I can. This is designed to be as fast as possible so some of the readability has been sacrificed, specifically in the C code.

If you use this code, please consider adding this repository address in a footnote: https://github.com/astropy/astroscrappy

Please cite the original paper which can be found at: http://www.astro.yale.edu/dokkum/lacosmic/

van Dokkum 2001, PASP, 113, 789, 1420 (article : http://adsabs.harvard.edu/abs/2001PASP..113.1420V)

This code requires Cython, preferably version >= 0.21.

Parallelization is achieved using OpenMP. This code should compile (although the Cython files may have issues) using a compiler that does not support OMP, e.g. clang.

Notes

There are some differences from original LA Cosmic:

  • Automatic recognition of saturated stars. This avoids treating such stars as large cosmic rays.
  • I have tried to optimize all of the code as much as possible while maintaining the integrity of the algorithm. One of the key speedups is to use a separable median filter instead of the true median filter. While these are not identical, they produce comparable results and the separable version is much faster.
  • This implementation is much faster than the Python by as much as a factor of ~17 depending on the given parameters, even without running multiple threads. With multiple threads, this can be increased easily by another factor of 2. This implementation is much faster than the original IRAF version, improvment by a factor of ~90.

The arrays always must be C-contiguous, thus all loops are y outer, x inner. This follows the astropy.io.fits (pyfits) convention.

scipy is required for certain tests to pass, but the code itself does not depend on scipy.

https://travis-ci.org/astropy/astroscrappy.png Travis Status

License

This project is Copyright (c) Astropy Developers and licensed under the terms of the BSD 3-Clause license. See the licenses folder for more information.

You can’t perform that action at this time.