deepCR

deepCR: Cosmic Ray Rejection with Deep Learning - Published in JOSS (2019)

https://github.com/profjsb/deepcr

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

astronomical-images astronomy convolutional-neural-networks deep-learning python3 pytorch
Last synced: 4 months ago · JSON representation

Repository

Deep Learning Based Cosmic Ray Removal for Astronomical Images

Basic Info
  • Host: GitHub
  • Owner: profjsb
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 22.5 MB
Statistics
  • Stars: 45
  • Watchers: 6
  • Forks: 13
  • Open Issues: 5
  • Releases: 5
Topics
astronomical-images astronomy convolutional-neural-networks deep-learning python3 pytorch
Created over 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.md

Build Status codecov Documentation Status DOI arXiv

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

Documentation and tutorials

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

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
Published
September 02, 2019
Volume 4, Issue 41, Page 1651
Authors
Keming Zhang ORCID
Department of Astronomy, University of California, Berkeley
Joshua S. Bloom ORCID
Department of Astronomy, University of California, Berkeley, Lawrence Berkeley National Laboratory
Editor
Yuan Tang ORCID
Tags
Pytorch astronomy image processing cosmic ray deep learning

GitHub Events

Total
  • Watch event: 2
  • Fork event: 2
Last Year
  • Watch event: 2
  • Fork event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 176
  • Total Committers: 5
  • Avg Commits per committer: 35.2
  • Development Distribution Score (DDS): 0.415
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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
enhancement (2)
Pull Request Labels

Dependencies

docs/requirements.txt pypi
  • joblib *
  • pytest *
docs/environment.yml pypi
setup.py pypi