Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kmzzhang committed Jul 23, 2019
1 parent 1d9b24f commit 8f606ca
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
## deepCR: Deep Learning Based Cosmic Ray Removal for Astronomical Images

Identify and remove cosmic rays from astronomical images using trained convolutional neural networks.
Fast on both CPU and GPU.

This is the installable package which implements the methods described in the paper: Zhang & Bloom (2019), submitted to AAS Journals.
This is the installable package which implements the methods described in the paper: Zhang & Bloom (2019), submitted.

Code to reproduce benchmarking results in the paper is at: https://github.com/kmzzhang/deepCR-paper

If you use this package, please cite Zhang & Bloom (2019): www.arxiv.org/XXX
If you use this package, please cite Zhang & Bloom (2019): url TBA

<img src="https://raw.githubusercontent.com/profjsb/deepCR/master/imgs/postage-sm.jpg" wdith="90%">

Expand Down Expand Up @@ -39,11 +38,13 @@ image = fits.getdata("example_flc.fits")

# create an instance of deepCR with specified model configuration
mdl = deepCR(mask="ACS-WFC-F606W-2-32",
inpaint="ACS-WFC-F606W-3-32",
inpaint="ACS-WFC-F606W-3-32",
device="CPU")

# apply to input image
mask, cleaned_image = mdl.clean(image, threshold = 0.5)
# examine those outputs to choose an adequate threshold
# visualize those outputs to choose an adequate threshold
# note that deepCR-inpaint would be inaccurate if mask does not fully cover CR

# if you only need CR mask you may skip image inpainting for shorter runtime
mask = mdl.clean(image, threshold = 0.5, inpaint=False)
Expand All @@ -52,14 +53,11 @@ mask = mdl.clean(image, threshold = 0.5, inpaint=False)
prob_mask = mdl.clean(image, binary=False)
```

To reduce memory consumption (recommended for image larger than 1k x 1k), you can tell deepCR to segment input image to smaller patches of seg * seg.
To reduce memory consumption (recommended for images larger 0.5 Mpix), you can tell deepCR to segment the input image into 256*256 patches, and process one patch at a time.
```python
mask, cleaned_image = mdl.clean(image, threshold = 0.5, seg = 256)
mask = mdl.clean(image, threshold = 0.5, seg = 256)
mask, cleaned_image = mdl.clean(image, threshold = 0.5, seg = True)
mask = mdl.clean(image, threshold = 0.5, seg = True)
```
deepCR perform CR rejection on small patches one at a time. It then stitches the predictions back to the original image size.

We recommend using patch size (seg) no smaller than 64. seg is by default 256.

### Currently available models

Expand All @@ -75,14 +73,14 @@ inpaint:

ACS-WFC-F606W-3-32(*)

Recommended models are marked in (*).
Recommended models are marked in (*). Larger number indicate larger capacity and better performance.

Input images should come from _flc.fits files which are in units of electrons.
Larger number indicate larger capacity and better performance.


### API Documentation

Documentation is under development at: https://deepcr.readthedocs.io/en/latest/deepCR.html
Full documentation is under development at: https://deepcr.readthedocs.io/en/latest/deepCR.html

### Limitations and Caveats

Expand Down

0 comments on commit 8f606ca

Please sign in to comment.