Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-dfs
csst-dfs-commons
Commits
5738540b
Commit
5738540b
authored
Sep 10, 2022
by
Wei Shoulin
Browse files
cpic and bug
parent
45c11bec
Changes
2
Hide whitespace changes
Inline
Side-by-side
csst_dfs_commons/models/cpic.py
0 → 100644
View file @
5738540b
import
dataclasses
from
typing
import
Dict
from
.common
import
BaseModel
,
default_field
@
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
=
""
@
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
class
Level1Record
(
BaseModel
):
id
:
int
=
0
level0_id
:
str
=
""
data_type
:
str
=
""
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
=
""
refs
:
Dict
[
str
,
int
]
=
default_field
({})
@
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
=
""
csst_dfs_commons/utils/fits.py
View file @
5738540b
def
get_header_value
(
key
:
str
,
header
,
default_value
=
None
):
try
:
return
header
[
key
]
v
=
header
[
key
]
if
type
(
v
)
==
str
:
return
v
.
strip
()
return
v
except
Exception
as
e
:
return
default_value
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment