facility.py 1.92 KB
Newer Older
Wei Shoulin's avatar
Wei Shoulin committed
1
2
3
4
5
6
7
import dataclasses
from typing import List
from .common import BaseModel

@dataclasses.dataclass
class Observation(BaseModel):
    id: int = 0
Wei Shoulin's avatar
Wei Shoulin committed
8
    obs_id: str = ""
Wei Shoulin's avatar
Wei Shoulin committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    obs_time: str = ""
    exp_time : float = 0
    module_id: str=""
    obs_type: str=""
    facility_status_id: int = 0
    module_status_id: int = 0
    qc0_status: int = 0
    qc0_time: str=""
    prc_status: int = 0
    prc_time: str=""
    create_time: str=""
    import_status: int = 0

@dataclasses.dataclass
class Detector(BaseModel):
    no: str = ""
    detector_name: str = ""
    module_id: str=""
    filter_id: float = 0
    create_time: str=""
    update_time: str=""


@dataclasses.dataclass
class DetectorStatus(BaseModel):
    id: int = 0
    detector_no: str = ""
    status: str=""
    create_time: str=""
Wei Shoulin's avatar
Wei Shoulin committed
38
39
    status_time: str=""

Wei Shoulin's avatar
brick    
Wei Shoulin committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@dataclasses.dataclass
class Brick(BaseModel):
    id: int = 0
    ra: float = 0.0
    dec: float = 0.0
    boundingbox: str=""

@dataclasses.dataclass
class BrickObsStatus(BaseModel):
    brick_id: int = 0
    band: str=""
    cover_num: int = 0
    update_time: str=""

@dataclasses.dataclass
class BrickLevel1(BaseModel):
    brick_id: int = 0
    level1_id: int = 0
    obs_id: str=""
    module: str=""
    obs_time: str=""

@dataclasses.dataclass
class Level2Producer(BaseModel):
    id: int = 0
    name: str=""
    priority: int = 0
    gitlink: str=""
    paramfiles: str=""
    pre_producers: list = dataclasses.field(default_factory=list)
    create_time: str=""
    update_time: str=""      

@dataclasses.dataclass
class Level2Job(BaseModel):
    id: int = 0
    dag: str=""
    status: int = 0
    create_time: str=""
    update_time: str=""     

@dataclasses.dataclass
class Level2ProducerRuning(BaseModel):
    id: int = 0
    job_id: int = 0
    producer_id: int = 0
    brick_id: int = 0
    start_time: str=""
    end_time: str=""
    prc_status: int = 0
    prc_result: str=""
    create_time: str=""
    update_time: str=""