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

## homepage

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_common](https://csst-tb.bao.ac.cn/code/csst-l1/csst_common).
BO ZHANG's avatar
BO ZHANG committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23

## documentation

A sphinx-based documentation is available at
- [https://csst-proto.readthedocs.io/en/latest/](https://csst-proto.readthedocs.io/en/latest/)

## dependency

- numpy~=1.20.3
- joblib~=1.1.0
- astropy~=5.1

## installation

BO ZHANG's avatar
BO ZHANG committed
24
`csst_common` can be installed with the following shell command
BO ZHANG's avatar
BO ZHANG committed
25
26

```bash
BO ZHANG's avatar
BO ZHANG committed
27
28
git clone https://csst-tb.bao.ac.cn/code/csst-l1/csst_common.git
cd csst_common
BO ZHANG's avatar
BO ZHANG committed
29
30
31
32
33
34
35
pip install -r requirements.txt
python setup.py install
```

or a single-line command

```bash
BO ZHANG's avatar
BO ZHANG committed
36
sh -c "$(curl -fsSL https://csst-tb.bao.ac.cn/code/csst-l1/csst_common/-/raw/main/install.sh)"
BO ZHANG's avatar
BO ZHANG committed
37
38
39
40
```

## instruction

BO ZHANG's avatar
BO ZHANG committed
41
how to import CSST parameters:
BO ZHANG's avatar
BO ZHANG committed
42
```python
BO ZHANG's avatar
BO ZHANG committed
43
44
45
46
from csst_common.params import cp
print(cp)
print(cp.mbi.DETECTOR2FILTER)
```
BO ZHANG's avatar
BO ZHANG committed
47

BO ZHANG's avatar
BO ZHANG committed
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
how to use data_manager
```python
from csst_common.data_manager import CsstMbiDataManager
dm = CsstMbiDataManager(...)
# access L0 directory
dm.dir_l0
# access L1 directory
dm.dir_l1
# access dir_pcref
dm.dir_pcref
# access path_aux
dm.path_aux
# access ver_sim
dm.ver_sim
# access target detectors
dm.target_detectors
# access available detectors
dm.available_detectors
# define an L1 file (detector-specified)
dm.l1_detector(detector=6)
# define an L1 file (non-detector-specified)
dm.l1_file("flipped_image.fits")
BO ZHANG's avatar
BO ZHANG committed
70
71
72
73
```

## algorithm description

BO ZHANG's avatar
BO ZHANG committed
74
75
76
77
The `csst_common` provides some common modules for CSST pipeline.

- `csst_common.parameters`
- `csst_common.data_manager`