README.md 2.22 KB
Newer Older
Yi Hu's avatar
Yi Hu committed
1
# CSST-COMMOM-CRMASK - Introduction
Hu Yi's avatar
Hu Yi committed
2

Yi Hu's avatar
Yi Hu committed
3
**CRMask** is a module for detecting cosmic rays on the CSST images using state-of-art models. It should be also applied for images from other telescopes, as long as the images have the same data structure as that of CSST.
Hu Yi's avatar
Hu Yi committed
4

Yi Hu's avatar
Yi Hu committed
5
# Python package dependencies
Hu Yi's avatar
Hu Yi committed
6

Yi Hu's avatar
Yi Hu committed
7
The following python packages are needed to **CRMask**:
Hu Yi's avatar
Hu Yi committed
8

Yi Hu's avatar
Yi Hu committed
9
10
11
12
13
14
15
* astropy == 4.x (>= 5.0 will be tested in the future) 
* ccdproc >= 2.1.0
* deepCR >= 0.1.5
* matplotlib >= 3.1.2
* numpy >= 1.19.5
* pytorch >= 1.8.1
* scipy >= 1.3.3
Hu Yi's avatar
Hu Yi committed
16

Yi Hu's avatar
Yi Hu committed
17
Install these package under Ubuntu 20.04 LTS:
Hu Yi's avatar
Hu Yi committed
18

Yi Hu's avatar
Yi Hu committed
19
20
        sudo apt install python3-numpy python3-scipy python3-matplotlib python3-astropy python3-ccdproc
        python3 -m pip install pytorch deepCR
Hu Yi's avatar
Hu Yi committed
21

Yi Hu's avatar
Yi Hu committed
22
# Usage
Hu Yi's avatar
Hu Yi committed
23

Yi Hu's avatar
Yi Hu committed
24
25
26
Download crmask.py and crmask.ini, put them in the same directory.

Running it:
Yi Hu's avatar
Yi Hu committed
27

Yi Hu's avatar
Yi Hu committed
28
        ./crmask.py your_file.fits your_model
Yi Hu's avatar
Yi Hu committed
29

Yi Hu's avatar
Yi Hu committed
30
where **your\_file.fits** is the filename of the image which you want to do cosmic ray detection, and **your\_model** is the algorithm you select. Available algorithms are _deepCR_ and _lacosmic_.
Yi Hu's avatar
Yi Hu committed
31
32

<!--
Hu Yi's avatar
Hu Yi committed
33
34
35
36
37
38
下载crmask.py,crmask.ini这两个文件。

./crmask.py your_file.fits your_model

其中your_file.fits是输入fits文件,your_model是扣除宇宙线的方法,可以是deepCR或者lacosmic。

Hu Yi's avatar
Hu Yi committed
39
如果需要使用CSST仿真数据训练得到的模型扣除宇宙线,下载CSST_2021-12-30_CCD23_epoch20.pth,该模型隐藏层数为50。
Yi Hu's avatar
Yi Hu committed
40
-->
Hu Yi's avatar
Hu Yi committed
41

Yi Hu's avatar
Yi Hu committed
42
43
44
45
46
47
48
49
# Warning

* The default training model of deepCR are obtained from HST/ACS data by Zhang and Bloom (2020). If you would like to use the native model rather than the model **CSST\_2021-12-30\_CCD23\_epoch20.pth** obtained from CSST simulated data by **Hu Yi**, you must also change the **hidden** parameters in the configuration file **crmask.ini** to 32. 

* The input images must be **bias-substracted** (either by bias reference fram or overscan region) no matter which algorithm selected, otherwise you will get very inefficient detection rate thus wrong results. Flat-field corrected images are preferable, but not necessary. 
<!--
If you would like use the native training model of deepCR, which are obtained from HST/ACS
如果使用deepCR自带用HST/ACS数据训练得到的模型,在配置文件中,要将hidden这个配置参数改为32。-->
Hu Yi's avatar
Hu Yi committed
50
51


Hu Yi's avatar
Hu Yi committed
52