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-api
Commits
84ea0461
Commit
84ea0461
authored
Jul 28, 2021
by
Wei Shoulin
Browse files
get latest cal
parent
f7f0aa8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api/facility/calmerge.py
View file @
84ea0461
...
...
@@ -24,6 +24,17 @@ class CalMergeApi(object):
:returns: csst_dfs_common.models.Result
'''
return
self
.
stub
.
find
(
**
kwargs
)
def
get_latest_by_l0
(
self
,
**
kwargs
):
''' retrieve calibration merge records from database by level0 data
:param kwargs: Parameter dictionary, key items support:
level0_id: [str],
ref_type: [str]
:returns: csst_dfs_common.models.Result
'''
return
self
.
stub
.
get_latest_by_l0
(
**
kwargs
)
def
get
(
self
,
**
kwargs
):
''' fetch a record from database
...
...
tests/test_facility_cal_merge.py
View file @
84ea0461
...
...
@@ -15,6 +15,10 @@ class CalMergeApiTestCase(unittest.TestCase):
obs_time
=
(
"2021-06-01 11:12:13"
,
"2021-06-08 11:12:13"
))
print
(
'find:'
,
recs
)
def
test_get_latest_by_l0
(
self
):
rec
=
self
.
api
.
get_latest_by_l0
(
level0_id
=
'000001102'
,
ref_type
=
"bias"
)
print
(
'get_latest_by_l0:'
,
rec
)
def
test_get
(
self
):
rec
=
self
.
api
.
get
(
id
=
3
)
print
(
'get by id:'
,
rec
)
...
...
tests/test_facility_level0.py
View file @
84ea0461
...
...
@@ -30,9 +30,9 @@ class Level0DataTestCase(unittest.TestCase):
def
test_write
(
self
):
rec
=
self
.
api
.
write
(
level0_id
=
'00000110
2
'
,
level0_id
=
'00000110
1
'
,
obs_id
=
'0000011'
,
detector_no
=
"0
2
"
,
detector_no
=
"0
1
"
,
obs_type
=
"sci"
,
obs_time
=
"2021-06-06 11:12:13"
,
exp_time
=
150
,
...
...
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