README.md 984 Bytes
Newer Older
BO ZHANG's avatar
BO ZHANG committed
1
## csst_proto 
BO ZHANG's avatar
BO ZHANG committed
2
 
BO ZHANG's avatar
BO ZHANG committed
3
CSST 流水线原型,用于展示示例代码。
BO ZHANG's avatar
BO ZHANG committed
4

BO ZHANG's avatar
BO ZHANG committed
5
6
## dependency

BO ZHANG's avatar
BO ZHANG committed
7
8
9
10
11
12
13
- numpy==1.23.3
- scipy==1.9.2
- joblib==1.2.0
- astropy==5.1
- pytest==7.2.1
- coverage==7.2.1
- toml==0.10.2
BO ZHANG's avatar
BO ZHANG committed
14

BO ZHANG's avatar
BO ZHANG committed
15
## installation
BO ZHANG's avatar
BO ZHANG committed
16

BO ZHANG's avatar
BO ZHANG committed
17
18
19
20
`csst_proto` can be installed with the following shell command

```bash
git clone https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto.git
BO ZHANG's avatar
BO ZHANG committed
21
cd csst_proto
BO ZHANG's avatar
BO ZHANG committed
22
23
24
25
pip install -r requirements.txt
python setup.py install
```

BO ZHANG's avatar
BO ZHANG committed
26
or a single-line command (the requirements are not installed automatically)
BO ZHANG's avatar
BO ZHANG committed
27
28
29

```bash
sh -c "$(curl -fsSL https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto/-/raw/main/install.sh)"
BO ZHANG's avatar
BO ZHANG committed
30
31
```

BO ZHANG's avatar
BO ZHANG committed
32
## tutorial
BO ZHANG's avatar
BO ZHANG committed
33
34
35
36

A simple example on how to use this package:

```python
BO ZHANG's avatar
BO ZHANG committed
37
from csst_proto import flip_image
BO ZHANG's avatar
BO ZHANG committed
38
39
40
from astropy.io import fits

# read an L0 image
BO ZHANG's avatar
BO ZHANG committed
41
img = fits.getdata("CSST_MS_SCI_06_L0_img.fits")
BO ZHANG's avatar
BO ZHANG committed
42
# flip the image
BO ZHANG's avatar
BO ZHANG committed
43
img_flipped = flip_image(image=img)
BO ZHANG's avatar
BO ZHANG committed
44
45
```

BO ZHANG's avatar
BO ZHANG committed
46
## algorithm description
BO ZHANG's avatar
BO ZHANG committed
47
48

The `csst_proto` uses an awesome algorithm based on `numpy.ndarray` indices to flip images.