algorithm.rst 5.5 KB
Newer Older
Wang Xia's avatar
Wang Xia committed
1
2
3
.. role:: raw-math(raw)
    :format: latex html

BO ZHANG's avatar
tweaks    
BO ZHANG committed
4
5
SLS pipeline
============
BO ZHANG's avatar
BO ZHANG committed
6
7
8
9
10


Instrument correction
---------------------

Wang Xia's avatar
Wang Xia committed
11
Description
Wang Xia's avatar
Wang Xia committed
12
``````````````````
Wang Xia's avatar
Wang Xia committed
13
`csst_ms_sls_instrument` 程序包是应用于CSST无缝光谱模块的仪器效应改正程序,无缝光谱模块包含12块9k×9k探测器,每4块探测器对应1个波段,每个波段的部分仪器参数如下:
Wang Xia's avatar
Wang Xia committed
14

Wang Xia's avatar
Wang Xia committed
15
16
17
    - GU: 660×660″ field of view from 255-400nm with a plate scale of 0.074″/pixel
    - GV: 660×660″ field of view from 400-620nm with a plate scale of 0.074″/pixel
    - GI: 660×660″ field of view from 620-1000nm with a plate scale of 0.074″/pixel
Wang Xia's avatar
Wang Xia committed
18
`csst_ms_sls_instrument` 将顺序执行一系列的探测器效应改正,生成单次曝光图像预处理后的数据产品。该程序是用Python语言实现,代码地址:code_。
Wang Xia's avatar
Wang Xia committed
19

Wang Xia's avatar
Wang Xia committed
20
.. _code: https://csst-tb.bao.ac.cn/code/csst-l1/sls/csst_ms_sls_instrument
Wang Xia's avatar
Wang Xia committed
21
22
23
Input
``````````````````
`csst_ms_sls_instrument` 将从csst_common.CsstMsDataManager获取0级数据和参考文件。
Wang Xia's avatar
Wang Xia committed
24

Wang Xia's avatar
Wang Xia committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
1. 0级数据: 包含一个扩展的fits文件,头文件中存放着观测天区、曝光信息、探测器信息等,具体关键字说明参见 DataModel_,扩展的数据单元存放着原始观测图像。
#. 参考文件: 仪器效应改正中所需的参考文件如下表所示。

+-----------------+----------------------------+
| Reference file  | Description                |
+=================+============================+
| Gain map        | gain array(9k×9k)          | 
+-----------------+----------------------------+
| Superbias       | superbias file(9k×9k)      | 
+-----------------+----------------------------+
| Superdark       | superdark file(9k×9k)      |
+-----------------+----------------------------+
| Superflat       | super flatfield file(9k×9k)|
+-----------------+----------------------------+
| Badpixel table  | Bad/hot Pixel table or map |
+-----------------+----------------------------+
Wang Xia's avatar
Wang Xia committed
41
42

.. _DataModel: https://csst-tb.bao.ac.cn/code/csst-l1/csst-l1doc/-/blob/main/docs/source/sls/data_model.md
BO ZHANG's avatar
BO ZHANG committed
43

Wang Xia's avatar
Wang Xia committed
44
Output
Wang Xia's avatar
Wang Xia committed
45
``````````````````
Wang Xia's avatar
Wang Xia committed
46
`csst_ms_sls_instrument` 生成的数据产品是包含三个扩展的fits文件,扩展内容如下表所示:
Wang Xia's avatar
Wang Xia committed
47

Wang Xia's avatar
Wang Xia committed
48
49
50
+-----------------+---------+-------------------+
| Extension name  |  Bunit  | Comment           |
+=================+=========+===================+
Wang Xia's avatar
Wang Xia committed
51
| SCI             | e-/s    | Science image     |
Wang Xia's avatar
Wang Xia committed
52
+-----------------+---------+-------------------+
Wang Xia's avatar
Wang Xia committed
53
| ERR             | e-/s    | Error array       |
Wang Xia's avatar
Wang Xia committed
54
+-----------------+---------+-------------------+
Wang Xia's avatar
Wang Xia committed
55
| DQ              | unitless| Data quality array|
Wang Xia's avatar
Wang Xia committed
56
+-----------------+---------+-------------------+
Wang Xia's avatar
Wang Xia committed
57

Wang Xia's avatar
Wang Xia committed
58
第一个扩展(SCI)的数据单元存放着仪器效应改正后的光谱图像,第二扩展(ERR)的数据单元存放着光谱图像误差,第三个扩展(DQ)的数据单元存放着光谱图像每个像素的数据质量标志位,具体参见 DQFlags_,DQFlags应包含下表的三项。仪器效应改正过程中,同时会记录下处理时间、状态信息等关键字,具体参见 DataModel_。
Wang Xia's avatar
Wang Xia committed
59

Wang Xia's avatar
Wang Xia committed
60
.. _DQFlags: https://?
Wang Xia's avatar
Wang Xia committed
61

Wang Xia's avatar
Wang Xia committed
62
63
64
65
66
67
68
69
70
+----------------+---------+---------------------------------------------+
| TTYPE          | TFORM   |  Description                                |
+================+=========+=============================================+
| BIT            | integer | The bit number, starting at zero            |
+----------------+---------+---------------------------------------------+
| VALUE          | integer | The equivalent base-10 value of BIT         |
+----------------+---------+---------------------------------------------+
| DESCRIPTION    | string  |  A description of the data quality condition|
+----------------+---------+---------------------------------------------+
Wang Xia's avatar
Wang Xia committed
71

Wang Xia's avatar
Wang Xia committed
72
73
74
Data Calibration Steps
``````````````````
仪器效应改正包括以下步骤:
Wang Xia's avatar
Wang Xia committed
75

Wang Xia's avatar
Wang Xia committed
76
**DQ Initialization**
Wang Xia's avatar
Wang Xia committed
77

Wang Xia's avatar
Wang Xia committed
78
class: csst_ms_sls_instrument.steps.DQIstep
Wang Xia's avatar
Wang Xia committed
79

Wang Xia's avatar
Wang Xia committed
80
81
reference file: Badpixel table(map)、Saturation file

Wang Xia's avatar
Wang Xia committed
82
DQ Initialization实现两部分内容,一是利用参考文件Badpixel table或是Badpixel map对DQ扩展进行标记,该参考文件记录着存在问题的像素点,可能是探测器的坏点、热像素。二是根据Saturation file对观测数据进行判定,并在DQ扩展中标记。Saturation file的形式需要根据后续测试结果来定,如果能测出每个像素的饱和值即可做成map,现阶段用的是常值。DQ标记的详情参见 DQFlags_。
Wang Xia's avatar
Wang Xia committed
83

Wang Xia's avatar
Wang Xia committed
84
85
86
87
**Bias correction**

class: csst_ms_sls_instrument.steps.BiasCorrStep

Wang Xia's avatar
Wang Xia committed
88
89
reference file:Superbias

Wang Xia's avatar
Wang Xia committed
90
Bias correction通过减去superbias的操作,去除掉原始科学数据中的探测器本底。Superbias的文件格式与输出文件一致,为包含三个扩展的fits。该步会对superbias的误差和DQ进行传递。
Wang Xia's avatar
Wang Xia committed
91

Wang Xia's avatar
Wang Xia committed
92
**To electrons**
Wang Xia's avatar
Wang Xia committed
93

Wang Xia's avatar
Wang Xia committed
94
class: csst_ms_sls_instrument.steps.ToElectronsStep
Wang Xia's avatar
Wang Xia committed
95

Wang Xia's avatar
Wang Xia committed
96
97
98
99
reference file: Gain map

数据乘以增益,SCI数据单元和ERR数据单元的单位由ADU转换为电子。

Wang Xia's avatar
Wang Xia committed
100
101
102
103
**Uncertainty Initialization**

class: csst_ms_sls_instrument.steps.UncertaintyInitStep

Wang Xia's avatar
Wang Xia committed
104
105
106
107
reference file: readnoise file

ERR数据单元构造误差数据,该步误差公式:

Wang Xia's avatar
Wang Xia committed
108
:raw-math:`$$ \sigma = \sqrt{(SCI-bias)+{\sigma_bias}^2 + readnoise^2)} $$`
Wang Xia's avatar
Wang Xia committed
109

Wang Xia's avatar
Wang Xia committed
110

Wang Xia's avatar
Wang Xia committed
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
**Dark correction**

class: csst_ms_sls_instrument.steps.DarkCorrStep

**Flatfield correction**

class: csst_ms_sls_instrument.steps.FlatCorrStep

**CR rejection**

class: csst_ms_sls_instrument.steps.CRrejStep

**To electrons/sec**

class: csst_ms_sls_instrument.steps.CPSStep

Wang Xia's avatar
Wang Xia committed
127

BO ZHANG's avatar
BO ZHANG committed
128
129
130
131
132
133
134
135
136
137
Position calibration
---------------------

`csst_ms_sls_position` package.


API
---

TODO