msc.py 7.75 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
import dataclasses
Wei Shoulin's avatar
Wei Shoulin committed
2
3
from typing import Dict
from .common import BaseModel, default_field
Wei Shoulin's avatar
Wei Shoulin committed
4
5

@dataclasses.dataclass
Wei Shoulin's avatar
Wei Shoulin committed
6
7
class Level1Record(BaseModel):
    id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
8
    level0_id : str = ""
Wei Shoulin's avatar
Wei Shoulin committed
9
    data_type: str=""
Wei Shoulin's avatar
mc3    
Wei Shoulin committed
10
    cor_sci_id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
11
    prc_params: str=""
Wei Shoulin's avatar
hstdm    
Wei Shoulin committed
12
    filter: str=""
Wei Shoulin's avatar
Wei Shoulin committed
13
14
15
16
17
18
19
20
    filename : str=""
    file_path: str=""
    qc1_status: int = 0
    qc1_time: str=""
    prc_status: int = 0
    prc_time: str=""
    create_time: str=""
    pipeline_id: str=""
Wei Shoulin's avatar
Wei Shoulin committed
21
    refs: Dict[str,int] = default_field({})
Wei Shoulin's avatar
Wei Shoulin committed
22

Wei Shoulin's avatar
Wei Shoulin committed
23
24
25
26
27
28
29
30
31
32
33
@dataclasses.dataclass
class Level1PrcRecord(BaseModel):
    id: int = 0
    level1_id: int = 0
    pipeline_id: str = ""
    prc_module: str = ""
    params_file_path: str=""
    prc_status: int = 0
    prc_time: str=""
    result_file_path: str=""  

Wei Shoulin's avatar
Wei Shoulin committed
34
@dataclasses.dataclass
Wei Shoulin's avatar
Wei Shoulin committed
35
36
class Level2Record(BaseModel):
    id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
37
    level0_id: str = ''
Wei Shoulin's avatar
Wei Shoulin committed
38
39
40
41
    level1_id : int = 0
    data_type: str=""
    filename : str=""
    file_path: str=""
Wei Shoulin's avatar
Wei Shoulin committed
42
    obs_time: str=""
Wei Shoulin's avatar
Wei Shoulin committed
43
44
45
46
47
    qc2_status: int = 0
    qc2_time: str=""
    prc_status: int = 0
    prc_time: str=""
    create_time: str=""
Wei Shoulin's avatar
Wei Shoulin committed
48
    pipeline_id: str=""
Wei Shoulin's avatar
Wei Shoulin committed
49
50
51
52
53
54
55
56
57
58
59
60
61
    import_status: int = 0

@dataclasses.dataclass
class Level2CoRecord(BaseModel):
    id: int = 0
    data_type: str=""
    filename : str=""
    file_path: str=""
    qc2_status: int = 0
    qc2_time: str=""
    prc_status: int = 0
    prc_time: str=""
    create_time: str=""
Wei Shoulin's avatar
Wei Shoulin committed
62
    pipeline_id: str=""
Wei Shoulin's avatar
Wei Shoulin committed
63
    import_status: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
64
65
66

@dataclasses.dataclass
class Level2CatalogRecord(BaseModel):
Wei Shoulin's avatar
ifs ver    
Wei Shoulin committed
67
    level2_id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
68
    ID: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
69
    CCDNO: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
    objID: int = 0
    X: float = -1
    XErr: float = -1
    Y: float = -1
    YErr: float = -1
    RA: float = -1
    RAErr: float = -1
    DEC: float = -1
    DECErr: float = -1
    A: float = -1
    AErr: float = -1
    B: float = -1
    BErr: float = -1
    PA: float = -1
    PAErr: float = -1
    Flag: int = 0
    Flag_ISO: int = 0
    Flag_ISO_Num: int = 0
    FWHM: float = -1
    AB: float = -1
    E: float = -1
    Flux_Kron: float = -1
    FluxErr_Kron: float = -1
    Mag_Kron: float = -1
    MagErr_Kron: float = -1
    Radius_Kron: float = -1
    Sky: float = -1
    Flux_Aper1: float = -1
    FluxErr_Aper1: float = -1
    Mag_Aper1: float = -1
    MagErr_Aper1: float = -1
    Flux_Aper2: float = -1
    FluxErr_Aper2: float = -1
    Mag_Aper2: float = -1
    MagErr_Aper2: float = -1
    Flux_Aper3: float = -1
    FluxErr_Aper3: float = -1
    Mag_Aper3: float = -1
    MagErr_Aper3: float = -1
    Flux_Aper4: float = -1
    FluxErr_Aper4: float = -1
    Mag_Aper4: float = -1
    MagErr_Aper4: float = -1
    Flux_Aper5: float = -1
    FluxErr_Aper5: float = -1
    Mag_Aper5: float = -1
    MagErr_Aper5: float = -1
    Flux_Aper6: float = -1
    FluxErr_Aper6: float = -1
    Mag_Aper6: float = -1
    MagErr_Aper6: float = -1
    Flux_Aper7: float = -1
    FluxErr_Aper7: float = -1
    Mag_Aper7: float = -1
    MagErr_Aper7: float = -1
    Flux_Aper8: float = -1
    FluxErr_Aper8: float = -1
    Mag_Aper8: float = -1
    MagErr_Aper8: float = -1
    Flux_Aper9: float = -1
    FluxErr_Aper9: float = -1
    Mag_Aper9: float = -1
    MagErr_Aper9: float = -1
    Flux_Aper10: float = -1
    FluxErr_Aper10: float = -1
    Mag_Aper10: float = -1
    MagErr_Aper10: float = -1
    Flux_Aper11: float = -1
    FluxErr_Aper11: float = -1
    Mag_Aper11: float = -1
    MagErr_Aper11: float = -1
    Flux_Aper12: float = -1
    FluxErr_Aper12: float = -1
    Mag_Aper12: float = -1
    MagErr_Aper12: float = -1
    Type: int = 0
    R20: float = -1
    R50: float = -1
    R90: float = -1
    X_PSF: float = -1
    Y_PSF: float = -1
    RA_PSF: float = -1
    DEC_PSF: float = -1
    Chi2_PSF: float = -1
    Flux_PSF: float = -1
    FluxErr_PSF: float = -1
    Mag_PSF: float = -1
    MagErr_PSF: float = -1
    X_Model: float = -1
    Y_Model: float = -1
    RA_Model: float = -1
    DEC_Model: float = -1
    Chi2_Model: float = -1
    Flag_Model: int = 0
    Flux_Model: float = -1
    FluxErr_Model: float = -1
    Mag_Model: float = -1
    MagErr_Model: float = -1
    Flux_Bulge: float = -1
    FluxErr_Bulge: float = -1
    Mag_Bulge: float = -1
    MagErr_Bulge: float = -1
    Re_Bulge: float = -1
    ReErr_Bulge: float = -1
    E_Bulge: float = -1
    EErr_Bulge: float = -1
    PA_Bulge: float = -1
    PAErr_Bulge: float = -1
    Flux_Disk: float = -1
    FluxErr_Disk: float = -1
    Mag_Disk: float = -1
    MagErr_Disk: float = -1
    Re_Disk: float = -1
    ReErr_Disk: float = -1
    E_Disk: float = -1
    EErr_Disk: float = -1
    PA_Disk: float = -1
    PAErr_Disk: float = -1
    Ratio_Disk: float = -1
    RatioErr_Disk: float = -1
    Spread_Model: float = -1
    SpreadErr_Model: float = -1
Wei Shoulin's avatar
Wei Shoulin committed
192
    NS128HIdx: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
193
    
Wei Shoulin's avatar
Wei Shoulin committed
194
@dataclasses.dataclass
Wei Shoulin's avatar
Wei Shoulin committed
195
class Level2CoCatalogRecord(BaseModel):
Wei Shoulin's avatar
Wei Shoulin committed
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
    ID: int = 0
    X: float = -1
    XErr: float = -1
    Y: float = -1
    YErr: float = -1
    RA: float = -1
    RAErr: float = -1
    DEC: float = -1
    DECErr: float = -1
    A: float = -1
    AErr: float = -1
    B: float = -1
    BErr: float = -1
    PA: float = -1
    PAErr: float = -1
    Flag: int = 0
    Flag_ISO: int = 0
    Flag_ISO_Num: int = 0
    FWHM: float = -1
    AB: float = -1
    E: float = -1
    Flux_Kron: float = -1
    FluxErr_Kron: float = -1
    Mag_Kron: float = -1
    MagErr_Kron: float = -1
    Radius_Kron: float = -1
    Sky: float = -1
    Flux_Aper1: float = -1
    FluxErr_Aper1: float = -1
    Mag_Aper1: float = -1
    MagErr_Aper1: float = -1
    Flux_Aper2: float = -1
    FluxErr_Aper2: float = -1
    Mag_Aper2: float = -1
    MagErr_Aper2: float = -1
    Flux_Aper3: float = -1
    FluxErr_Aper3: float = -1
    Mag_Aper3: float = -1
    MagErr_Aper3: float = -1
    Flux_Aper4: float = -1
    FluxErr_Aper4: float = -1
    Mag_Aper4: float = -1
    MagErr_Aper4: float = -1
    Flux_Aper5: float = -1
    FluxErr_Aper5: float = -1
    Mag_Aper5: float = -1
    MagErr_Aper5: float = -1
    Flux_Aper6: float = -1
    FluxErr_Aper6: float = -1
    Mag_Aper6: float = -1
    MagErr_Aper6: float = -1
    Flux_Aper7: float = -1
    FluxErr_Aper7: float = -1
    Mag_Aper7: float = -1
    MagErr_Aper7: float = -1
    Flux_Aper8: float = -1
    FluxErr_Aper8: float = -1
    Mag_Aper8: float = -1
    MagErr_Aper8: float = -1
    Flux_Aper9: float = -1
    FluxErr_Aper9: float = -1
    Mag_Aper9: float = -1
    MagErr_Aper9: float = -1
    Flux_Aper10: float = -1
    FluxErr_Aper10: float = -1
    Mag_Aper10: float = -1
    MagErr_Aper10: float = -1
    Flux_Aper11: float = -1
    FluxErr_Aper11: float = -1
    Mag_Aper11: float = -1
    MagErr_Aper11: float = -1
    Flux_Aper12: float = -1
    FluxErr_Aper12: float = -1
    Mag_Aper12: float = -1
    MagErr_Aper12: float = -1
    Type: int = 0
    R20: float = -1
    R50: float = -1
    R90: float = -1
    X_PSF: float = -1
    Y_PSF: float = -1
    RA_PSF: float = -1
    DEC_PSF: float = -1
    Chi2_PSF: float = -1
    Flux_PSF: float = -1
    FluxErr_PSF: float = -1
    Mag_PSF: float = -1
    MagErr_PSF: float = -1
    X_Model: float = -1
    Y_Model: float = -1
    RA_Model: float = -1
    DEC_Model: float = -1
    Chi2_Model: float = -1
    Flag_Model: int = 0
    Flux_Model: float = -1
    FluxErr_Model: float = -1
    Mag_Model: float = -1
    MagErr_Model: float = -1
    Flux_Bulge: float = -1
    FluxErr_Bulge: float = -1
    Mag_Bulge: float = -1
    MagErr_Bulge: float = -1
    Re_Bulge: float = -1
    ReErr_Bulge: float = -1
    E_Bulge: float = -1
    EErr_Bulge: float = -1
    PA_Bulge: float = -1
    PAErr_Bulge: float = -1
    Flux_Disk: float = -1
    FluxErr_Disk: float = -1
    Mag_Disk: float = -1
    MagErr_Disk: float = -1
    Re_Disk: float = -1
    ReErr_Disk: float = -1
    E_Disk: float = -1
    EErr_Disk: float = -1
    PA_Disk: float = -1
    PAErr_Disk: float = -1
    Ratio_Disk: float = -1
    RatioErr_Disk: float = -1
    Spread_Model: float = -1
    SpreadErr_Model: float = -1
    NS128HIdx: int = 0