Skip to content
README.md 3.21 KiB
Newer Older
BO ZHANG's avatar
BO ZHANG committed
## csst_proto 
BO ZHANG's avatar
BO ZHANG committed
[![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
 
BO ZHANG's avatar
BO ZHANG committed
CSST L1 pipeline prototype.
BO ZHANG's avatar
BO ZHANG committed

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

BO ZHANG's avatar
BO ZHANG committed
This code is available at *CSST GitLab*:
BO ZHANG's avatar
BO ZHANG committed
- [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

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

BO ZHANG's avatar
BO ZHANG committed
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

## installation
BO ZHANG's avatar
BO ZHANG committed

BO ZHANG's avatar
BO ZHANG committed
`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
cd csst_proto
BO ZHANG's avatar
BO ZHANG committed
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
```

BO ZHANG's avatar
BO ZHANG committed
## instruction

A simple example on how to use this package:

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

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

BO ZHANG's avatar
BO ZHANG committed
## algorithm description
BO ZHANG's avatar
BO ZHANG committed

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


## timeline

BO ZHANG's avatar
BO ZHANG committed
| 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

BO ZHANG's avatar
BO ZHANG committed
## 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
## useful links
BO ZHANG's avatar
BO ZHANG committed

- 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
- readthedoc: https://readthedocs.io/ or https://rtfd.io/
-