English

dfcosmic: A Python package for cosmic ray removal

Instrumentation and Methods for Astrophysics 2026-02-23 v1 Astrophysics of Galaxies

Abstract

Astronomical images often show sharp features that are caused by cosmic ray (CR) hits, hot pixels, or non-Gaussian noise. L.A.Cosmic (van Dokkum 2001) is a widely used edge detection algorithm that identifies and replaces such features. Here we describe dfcosmic, a direct python port of L.A.Cosmic utilizing PyTorch and C++ to enable efficient performance on both CPUs and GPUs. The code was developed for the MOTHRA array, which is projected to produce more than 1000 large format CMOS images every 15 minutes. Compared to previous python implementations, dfcosmic achieves a speed gain of at least 20%.

Keywords

Cite

@article{arxiv.2602.17938,
  title  = {dfcosmic: A Python package for cosmic ray removal},
  author = {Carter Lee Rhea and Pieter van Dokkum and Steven R. Janssens and Imad Pasha and Roberto Abraham and William P. Bowman and Deborah Lokhorst and Seery Chen},
  journal= {arXiv preprint arXiv:2602.17938},
  year   = {2026}
}

Comments

Submitted to JOSS

R2 v1 2026-07-01T10:43:46.569Z