README.md 3.21 KB
Newer Older
BO ZHANG's avatar
BO ZHANG committed
1
## csst_proto 
BO ZHANG's avatar
BO ZHANG committed
2
[![Documentation Status](https://readthedocs.org/projects/csst-proto/badge/?version=latest)](https://csst-proto.readthedocs.io/en/latest/?badge=latest)
BO ZHANG's avatar
BO ZHANG committed
3
 
BO ZHANG's avatar
BO ZHANG committed
4
CSST L1 pipeline prototype.
BO ZHANG's avatar
BO ZHANG committed
5

BO ZHANG's avatar
BO ZHANG committed
6
## homepage
BO ZHANG's avatar
BO ZHANG committed
7

BO ZHANG's avatar
BO ZHANG committed
8
This code is available at *CSST GitLab*:
BO ZHANG's avatar
BO ZHANG committed
9
- [https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto](https://csst-tb.bao.ac.cn/code/csst-l1/csst_proto).
BO ZHANG's avatar
BO ZHANG committed
10

BO ZHANG's avatar
BO ZHANG committed
11
## documentation
BO ZHANG's avatar
BO ZHANG committed
12

BO ZHANG's avatar
BO ZHANG committed
13
14
A sphinx-based documentation is available at
- [https://csst-proto.readthedocs.io/en/latest/](https://csst-proto.readthedocs.io/en/latest/)
BO ZHANG's avatar
BO ZHANG committed
15
16

## installation
BO ZHANG's avatar
BO ZHANG committed
17

BO ZHANG's avatar
BO ZHANG committed
18
19
20
21
`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
22
cd csst_proto
BO ZHANG's avatar
BO ZHANG committed
23
24
25
26
27
28
29
30
pip install -r requirements.txt
python setup.py install
```

or a single-line command

```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
31
32
```

BO ZHANG's avatar
BO ZHANG committed
33
34
35
36
37
38
## instruction

A simple example on how to use this package:

```python
import numpy as np
BO ZHANG's avatar
BO ZHANG committed
39
from csst_proto.top_level_interface import flip_image, read_test_image
BO ZHANG's avatar
BO ZHANG committed
40
41
42
from astropy.io import fits

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

BO ZHANG's avatar
BO ZHANG committed
48
## algorithm description
BO ZHANG's avatar
BO ZHANG committed
49
50

The `csst_proto` uses an awesome algorithm based on `numpy.ndarray` indices to flip images.
BO ZHANG's avatar
BO ZHANG committed
51
52
53
54


## timeline

BO ZHANG's avatar
BO ZHANG committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
| file / directory   | description                     | urgent | C6  | C7  |
|--------------------|---------------------------------|--------|-----|-----|
| `csst_proto/`      | source code & data              | √√     | √   |     |
| `doc/`             | sphinx-based documentation      |        |     | √   |
| `example/`         | code examples                   | -      | -   | -   |
| `tests/`           | unit tests                      |        |     | √   |
| `.gitignore`       | git file                        |        | √   |     |
| `.gitlab-ci.yml`   | gitlab CI/CD pipeline           |        |     | √   |
| `LICENSE`          | code license                    |        | √   |     |
| `README.md`        | readme file                     | √√     | √   |     |
| `install.sh`       | single-line installation script |        | √   |     |
| `install_local.sh` | local installation script       |        | √   |     |
| `readthedocs.yml`  | readthedocs.io configuration    |        |     | √   |
| `requirements.txt` | code requirements               | √      | √   |     |
| `setup.py`         | sphinx-based documentation      | √√     | √   |     |
BO ZHANG's avatar
BO ZHANG committed
70

BO ZHANG's avatar
BO ZHANG committed
71
72
73
74
75
76
77
78
## important stages

1. **installation**: `source code` & `setup.py` -> `pip install <package_name>`
2. **a simple guide**: `README.md`
3. **unittest**: `pytest`
4. gitlab CI/CD pipeline: `.gitlab-ci.yml`
5. sphinx-based documentation: `doc/` & `readthedocs.yml`

BO ZHANG's avatar
BO ZHANG committed
79
## useful links
BO ZHANG's avatar
BO ZHANG committed
80
81
82
83
84
85
86
87
88

- git: https://git-scm.com/
  - Pro Git: https://git-scm.com/book/en/v2
- Numpydoc: https://numpydoc.readthedocs.io/en/latest/format.html
  - for C: https://peps.python.org/pep-0007/
  - for Python: https://peps.python.org/pep-0008/
- unittest: https://docs.python.org/3.8/library/unittest.html
- sphinx: https://www.sphinx-doc.org/en/master/index.html
- restructured text: https://docutils.sourceforge.io/rst.html
BO ZHANG's avatar
BO ZHANG committed
89
90
- readthedoc: https://readthedocs.io/ or https://rtfd.io/
-