ifs.py 1.93 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
6
7
8
9
10
11
12
13
14
15

@dataclasses.dataclass
class Level0PrcRecord(BaseModel):
    id: int = 0
    level0_id: str = ""
    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
ifs ver    
Wei Shoulin committed
16
17
18
19
20
21
22
23
@dataclasses.dataclass
class Level0HeaderRecord(BaseModel):
    id: int = 0
    object_name: str = ""
    ra: float = 0
    dec: float = 0
    version: str = ""

Wei Shoulin's avatar
Wei Shoulin committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@dataclasses.dataclass
class Level0Record(BaseModel):
    id: int = 0
    level0_id: str = ""
    obs_id: str = ""
    detector_no: str = ""
    obs_type: str = ""
    obs_time: str=""
    exp_time: float = 0
    detector_status_id: int = 0
    filename: str=""
    file_path: str=""
    qc0_status: int = 0
    qc0_time: str=""
    prc_status: int = 0
    prc_time: str=""
    create_time: str=""

@dataclasses.dataclass
class CalMergeRecord(BaseModel):
    id: int = 0
    cal_id: str = ""
    detector_no: str = ""
    ref_type: str = ""
    obs_time: str=""
    exp_time: float = 0
    filename: str=""
    file_path: str=""
    qc1_status: int = 0
    qc1_time: str=""
    prc_status: int = 0
    prc_time: str=""
    prc_time: str=""
    create_time: str=""
    level0_ids: list = dataclasses.field(default_factory=list)
@dataclasses.dataclass
Wei Shoulin's avatar
Wei Shoulin committed
60
61
class Level1Record(BaseModel):
    id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
62
    level0_id : str = ""
Wei Shoulin's avatar
Wei Shoulin committed
63
    data_type: str=""
Wei Shoulin's avatar
mc3    
Wei Shoulin committed
64
    cor_sci_id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
65
66
67
68
69
70
71
72
73
    prc_params: str=""
    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
74
    refs: Dict[str,int] = default_field({})
Wei Shoulin's avatar
Wei Shoulin committed
75

Wei Shoulin's avatar
Wei Shoulin committed
76
77
78
79
80
81
82
83
84
85
@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=""