Cosmic-CoNN: A Cosmic Ray Detection Deep Learning Framework, Dataset, and Toolkit
Project description
Cosmic-CoNN
A Cosmic Ray Detection Deep Learning Framework, Dataset, and Toolkit
Github • Quick Start • Publication • Documentation • LCO CR Dataset
About
Cosmic-CoNN is an end-to-end solution to help tackle the cosmic ray (CR) detection problem in CCD-captured astronomical images. It includes a deep-learning framework, high-performance CR detection models, a new dataset, and a suite of tools to use to the models, shown in the figure above:
-
LCO CR dataset, a large, diverse cosmic ray dataset consists of over 4,500 scientific images from Las Cumbres Observatory (LCO) global telescope network's 23 instruments. CRs are labeled accurately and consistently across many diverse observations from various instruments. To the best of our knowledge, this is the largest dataset of its kind.
-
A PyTorch deep-learning framework that trains generic, robust CR detection models for ground- and space-based imaging data, as well as spectroscopic observations.
-
A suite of tools includings console commands, a web app, and Python APIs to make deep-learning models easily accessible to astronomers.
Visual inspection of Cosmic-CoNNCR detection results. Detecting CRs in a Gemini GMOS-N 1×1 binning image with our generic ground-imaging
model. The model was trained entirely on LCO data yet all visible CRs in the image stamp are correctly detected regardless of their shapes or sizes.
The Cosmic-CoNN NRES
model detects CRs over the spectrum robustly on a LCO NRES spectroscopic image. The horizontal bands in the left image are the spectroscopicorders, which are left out of the CR mask.
Publication
This repository is supplement to our Cosmic-CoNN research paper, a thorough evaluation of the models' performance can be found in our paper link pending. If you used the Cosmic-CoNN or the LCO CR dataset for your research, pleaes cite our paper:
Papaer's bibtex penidng
Please also cite the LCO CR datset if you used the Cosmic-CoNN ground_imaging
model or the data in your research:
Xu, Chengyuan, McCully, Curtis, Dong, Boning, Howell, D. Andrew, & Sen, Pradeep. (2021). Cosmic-CoNN LCO CR Dataset (Version 0.1.0) [Data set]. Zenodo. http://doi.org/10.5281/zenodo.5034763
Installation
We recommend installing Cosmic-CoNN in a new virutal enviroment, see step-by-step installation guide.
$ pip install cosmic-conn
Command line interface
After installation, you can start detecting CRs in your FITS files right from the command line:
$ cosmic-conn -m ground_imaging -e SCI -i input_dir
This command launches a generic gorund_imaging
model to detect cosmic rays. It reads data from the SCI extention in a FITS file and process all files in the input_dir. We also provide the NRES
model for CR detection in spectroscopic data and the HST_ACS_WFC
model for Hubble ACS/WFC imaging data. You could also find more Hubble Space Telescope CR detection and inpainting models trained by deepCR.
Python APIs
It is also easy to integrate Cosmic-CoNN CR detection into your data workflow. Let image
be a two-dimensional float32 numpy
array of any size:
from cosmic_conn import init_model
# initialize a Cosmic-CoNN model
cr_model, opt = init_model("ground_imaging")
# the model outputs a CR probability map in np.float32
cr_prob = cr_model.detect_cr(image)
# convert the probability map to a boolean mask with a 0.5 threshold
cr_mask = cr_prob > 0.5
Web app
The Cosmic-CoNN web app automatically finds large CRs for close inspection. It supports live CR mask editing and is especially useful to find the suitable threshold for different types of observations:
The Cosmic-CoNN web app interface.
Train new model with Cosmic-CoNN
See documentation for complete user and developler guides.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cosmic_conn-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff59e8aa63f458194372be69be33a292f93ab116c45fc37f9d304e270de47b2e |
|
MD5 | 3b547b11855808e88e1c6bc03764408f |
|
BLAKE2b-256 | c67c2a60d199bdf3589dec74b10ce2e8eb1a9b9083256d9f165a3649721c669a |