deepCR
deepCR: Cosmic Ray Rejection with Deep Learning - Published in JOSS (2019)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: arxiv.org, iop.org, joss.theoj.org -
✓Committers with academic emails
2 of 5 committers (40.0%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Repository
Deep Learning Based Cosmic Ray Removal for Astronomical Images
Basic Info
Statistics
- Stars: 45
- Watchers: 6
- Forks: 13
- Open Issues: 5
- Releases: 5
Topics
Metadata Files
README.md
deepCR: Deep Learning Based Cosmic Ray Removal for Astronomical Images
Identify and remove cosmic rays from astronomical images using trained convolutional neural networks. Currently supports Hubble Space Telescope ACS-WFC and WFC3-UVIS cameras.
This package is implements the method described in the paper:
deepCR: Cosmic Ray Rejection with Deep Learning\ Keming Zhang & Joshua Bloom 2020\ Published in the Astrophysical Journal\ arXiv:1907.09500

Currently Available Models
ACS-WFC: Kwon, Zhang & Bloom 2021
WFC3-UVIS: Chen et al. 2024
Installation
bash
pip install deepCR
Or you can install from source:
bash
git clone https://github.com/profjsb/deepCR.git
cd deepCR/
pip install .
Quick Start
Quick download of a HST ACS/WFC and a WFC3/UVIS image
bash
wget -O jdba2sooq_flc.fits https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/jdba2sooq_flc.fits
wget -O ietx1ab1q_flc.fits https://mast.stsci.edu/api/v0.1/Download/file?uri=mast:HST/product/ietx1ab1q_flc.fits
```python from deepCR import deepCR from astropy.io import fits image = fits.getdata("jdba2sooq_flc.fits")[:512,:512]
Create an instance of deepCR for ACS-WFC
mdl = deepCR(mask="ACS-WFC")
mdl = deepCR(mask="WFC3-UVIS") for WFC3-UVIS
Apply the model
mask = mdl.clean(image, threshold = 0.5)
0.5 threshold usually works for ACS/WFC
0.1-0.2 for WFC3/UVIS (see Chen et al. 2024)
Probabilistic mask could be helpful in determining threshold
prob_mask = mdl.clean(image, binary=False)
Optional inpainting with median filtering
mask, cleaned_image = mdl.clean(image, threshold = 0.5, inpaint=True) ```
For larger images you may want to enable mdl.clean(..., segment=True, patch=512) option to prevent memory
overflow. This option segment your input image into small squares of 512 by 512 for input into the model,
where the CR masks are stitched back together. In this case,
you may also enable multiprocessing by specifying n_jobs>1. Note that this won't speed things up
if you're using GPU!
Contributing
We are very interested in getting bug fixes, new functionality, and new trained models from the community (especially for ground-based imaging and spectroscopy). Please fork this repo and issue a PR with your changes. It will be especially helpful if you add some tests for your changes.
Owner
- Name: Joshua Bloom
- Login: profjsb
- Kind: user
- Location: Berkeley, CA
- Company: UC Berkeley
- Website: jøsh.org
- Twitter: profjsb
- Repositories: 19
- Profile: https://github.com/profjsb
Astro prof @ UC Berkeley; CTO & co-founder of Wise.io, acquired by GE Digital (former VP of Data & Analytics). Kinda into ML for science & Python in general.
JOSS Publication
deepCR: Cosmic Ray Rejection with Deep Learning
Authors
Tags
Pytorch astronomy image processing cosmic ray deep learningGitHub Events
Total
- Watch event: 2
- Fork event: 2
Last Year
- Watch event: 2
- Fork event: 2
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Keming Zhang | k****g@c****u | 103 |
| jbloom | p****b@g****m | 57 |
| Kyubin James Kwon | k****5@b****u | 13 |
| cy-xu | h****u@g****m | 2 |
| Arfon Smith | a****n | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 7
- Total pull requests: 18
- Average time to close issues: 2 days
- Average time to close pull requests: about 1 month
- Total issue authors: 4
- Total pull request authors: 7
- Average comments per issue: 1.0
- Average comments per pull request: 0.78
- Merged pull requests: 13
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- kmzzhang (2)
- profjsb (2)
- DanielLenz (2)
- srinadh99 (1)
Pull Request Authors
- kgb0255 (6)
- kmzzhang (4)
- zhuochen-ucla (4)
- profjsb (3)
- cy-xu (2)
- arfon (1)
- James-E-A (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- joblib *
- pytest *
