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
135b2eb4
Commit
135b2eb4
authored
Jun 21, 2022
by
Wei Shoulin
Browse files
ifs write level0
parent
d5fdf01e
Changes
8
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api/ifs/level0.py
View file @
135b2eb4
...
@@ -70,14 +70,8 @@ class Level0DataApi(object):
...
@@ -70,14 +70,8 @@ class Level0DataApi(object):
''' insert a level0 data record into database
''' insert a level0 data record into database
:param kwargs: Parameter dictionary, key items support:
:param kwargs: Parameter dictionary, key items support:
obs_id = [str],
file_path = [str],
detector_no = [str],
copyfiles = [boolean]
obs_type = [str],
obs_time = [str],
exp_time = [int],
detector_status_id = [int],
filename = [str],
file_path = [str]
:returns: csst_dfs_common.models.Result
:returns: csst_dfs_common.models.Result
'''
'''
...
...
csst_dfs_api/mci/level0.py
View file @
135b2eb4
...
@@ -65,14 +65,9 @@ class Level0DataApi(object):
...
@@ -65,14 +65,9 @@ class Level0DataApi(object):
''' insert a level0 data record into database
''' insert a level0 data record into database
:param kwargs: Parameter dictionary, key items support:
:param kwargs: Parameter dictionary, key items support:
obs_id = [str],
detector_no = [str],
file_path = [str],
obs_type = [str],
copyfiles = [boolean]
obs_time = [str],
exp_time = [int],
detector_status_id = [int],
filename = [str],
file_path = [str]
:returns: csst_dfs_common.models.Result
:returns: csst_dfs_common.models.Result
'''
'''
...
...
tests/ifs/test_ifs_level0.py
View file @
135b2eb4
...
@@ -9,34 +9,25 @@ class IFSLevel0DataTestCase(unittest.TestCase):
...
@@ -9,34 +9,25 @@ class IFSLevel0DataTestCase(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
api
=
Level0DataApi
()
self
.
api
=
Level0DataApi
()
def
test_find
(
self
):
#
def test_find(self):
re
c
s
=
self
.
api
.
find
(
obs_id
=
'000009'
,
obs_type
=
'sci'
,
limit
=
0
)
#
res
ult
= self.api.find(
ra = 248, dec = 87, radius = 2, limit = 0, obs_type = "sky"
)
print
(
'find:'
,
re
c
s
)
#
print('find:', res
ult
)
def
test_get
(
self
):
#
def test_get(self):
re
c
=
self
.
api
.
get
(
id
=
1
00
)
#
re
sult
= self.api.get(id = 1)
print
(
'get:'
,
re
c
)
#
print('get:', re
sult.data
)
rec
=
self
.
api
.
get
(
level0_id
=
'
10
000001
02
'
)
#
rec = self.api.get(level0_id = '
3
000001
45CCD231-c4
')
print
(
'get:'
,
rec
)
#
print('get:', rec)
def
test_update_proc_status
(
self
):
#
def test_update_proc_status(self):
rec
=
self
.
api
.
update_proc_status
(
level0_id
=
'000001102'
,
status
=
6
)
#
rec = self.api.update_proc_status(level0_id = '000001102', status = 6)
print
(
'update_proc_status:'
,
rec
)
#
print('update_proc_status:', rec)
def
test_update_qc0_status
(
self
):
#
def test_update_qc0_status(self):
rec
=
self
.
api
.
update_qc0_status
(
level0_id
=
'000001102'
,
status
=
7
)
#
rec = self.api.update_qc0_status(level0_id = '000001102', status = 7)
print
(
'update_qc0_status:'
,
rec
)
#
print('update_qc0_status:', rec)
def
test_write
(
self
):
def
test_write
(
self
):
rec
=
self
.
api
.
write
(
rec
=
self
.
api
.
write
(
file_path
=
"/Users/wsl/temp/csst/ifs_data/sky_Data/CSST_IFS_B_sky_20211225001425_20211225001925_300000013_X_L0_VER_I4203.fits"
)
level0_id
=
'000001101'
,
obs_id
=
'0000011'
,
detector_no
=
"01"
,
obs_type
=
"sci"
,
obs_time
=
"2021-06-06 11:12:13"
,
exp_time
=
150
,
detector_status_id
=
3
,
filename
=
"MSC_00001234"
,
file_path
=
"/opt/MSC_00001234.fits"
)
print
(
'write:'
,
rec
)
print
(
'write:'
,
rec
)
\ No newline at end of file
tests/mci/test_
ifs
_cal_merge.py
→
tests/mci/test_
mci
_cal_merge.py
View file @
135b2eb4
File moved
tests/mci/test_
ifs
_level0.py
→
tests/mci/test_
mci
_level0.py
View file @
135b2eb4
...
@@ -30,13 +30,5 @@ class MCILevel0DataTestCase(unittest.TestCase):
...
@@ -30,13 +30,5 @@ class MCILevel0DataTestCase(unittest.TestCase):
def
test_write
(
self
):
def
test_write
(
self
):
rec
=
self
.
api
.
write
(
rec
=
self
.
api
.
write
(
level0_id
=
'000001101'
,
obs_id
=
'0000011'
,
detector_no
=
"01"
,
obs_type
=
"sci"
,
obs_time
=
"2021-06-06 11:12:13"
,
exp_time
=
150
,
detector_status_id
=
3
,
filename
=
"MSC_00001234"
,
file_path
=
"/opt/MSC_00001234.fits"
)
file_path
=
"/opt/MSC_00001234.fits"
)
print
(
'write:'
,
rec
)
print
(
'write:'
,
rec
)
\ No newline at end of file
tests/mci/test_
ifs
_level0_prc.py
→
tests/mci/test_
mci
_level0_prc.py
View file @
135b2eb4
File moved
tests/mci/test_
ifs
_level1.py
→
tests/mci/test_
mci
_level1.py
View file @
135b2eb4
File moved
tests/mci/test_
ifs
_level1_prc.py
→
tests/mci/test_
mci
_level1_prc.py
View file @
135b2eb4
File moved
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