Commit 62dd2aec authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

updated README.md

parent 483f9f91
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -94,3 +94,35 @@ The `csst_proto` uses an awesome algorithm based on `numpy.ndarray` indices to f
- markdown: https://www.markdownguide.org/
- restructured text: https://docutils.sourceforge.io/rst.html
- readthedocs: https://readthedocs.io/ or https://rtfd.io/

## `data manager`

```python
import os
from csst.ms.data_manager import CsstMscDataManager
from csst.ms.backbone import CCD_ID_LIST

# initialize data manager
dm = CsstMscDataManager(
    ver_sim="C5.1", dir_l0="/data/sim_data/MSC_0000100", dir_l1="/home/user/L1Pipeline/msc/work")
# process all CCDs
dm.set_ccd_ids(CCD_ID_LIST)

print("----- available ccd_ids -----")
print(dm.available_ccd_ids)
for ccd_id in dm.target_ccd_ids:
    print("----- L0 images -----")
    print(dm.l0_ccd(ccd_id=ccd_id))
    print(os.path.exists(dm.l0_ccd(ccd_id=ccd_id)))
    print("----- L0 crs -----")
    print(dm.l0_crs(ccd_id=ccd_id))
    print(os.path.exists(dm.l0_ccd(ccd_id=ccd_id)))
    print("----- L0 input cat -----")
    print(dm.l0_cat(ccd_id=ccd_id))
    print(os.path.exists(dm.l0_cat(ccd_id=ccd_id)))
    print("----- L0 input log -----")
    print(dm.l0_log(ccd_id=ccd_id))
    print(os.path.exists(dm.l0_log(ccd_id=ccd_id)))
    print("----- L1 images -----")
    print(dm.l1_ccd(ccd_id, post="img.fits"))
```
 No newline at end of file