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
69d34d83
Commit
69d34d83
authored
Nov 21, 2022
by
Wei Shoulin
Browse files
add level0_id
parent
e81bfd8d
Changes
4
Show whitespace changes
Inline
Side-by-side
csst_dfs_api/msc/level2.py
View file @
69d34d83
...
@@ -14,6 +14,7 @@ class Level2DataApi(object):
...
@@ -14,6 +14,7 @@ class Level2DataApi(object):
''' retrieve level2 records from database
''' retrieve level2 records from database
:param kwargs: Parameter dictionary, key items support:
:param kwargs: Parameter dictionary, key items support:
level0_id: [str]
level1_id: [int]
level1_id: [int]
data_type: [str]
data_type: [str]
create_time : (start, end),
create_time : (start, end),
...
...
csst_dfs_api/sls/level2spectra.py
View file @
69d34d83
...
@@ -13,6 +13,7 @@ class Level2SpectraApi(object):
...
@@ -13,6 +13,7 @@ class Level2SpectraApi(object):
''' retrieve level2 spectra records from database
''' retrieve level2 spectra records from database
:param kwargs: Parameter dictionary, key items support:
:param kwargs: Parameter dictionary, key items support:
level0_id: [str]
level1_id: [int]
level1_id: [int]
spectra_id: [str]
spectra_id: [str]
create_time : (start, end),
create_time : (start, end),
...
@@ -62,6 +63,7 @@ class Level2SpectraApi(object):
...
@@ -62,6 +63,7 @@ class Level2SpectraApi(object):
''' insert a level1 record into database
''' insert a level1 record into database
:param kwargs: Parameter dictionary, key items support:
:param kwargs: Parameter dictionary, key items support:
level0_id: [str]
level1_id: [int]
level1_id: [int]
spectra_id : [str]
spectra_id : [str]
region : [str]
region : [str]
...
...
tests/common/test_common_catalog.py
View file @
69d34d83
...
@@ -13,15 +13,16 @@ class CommonCatalogTestCase(unittest.TestCase):
...
@@ -13,15 +13,16 @@ class CommonCatalogTestCase(unittest.TestCase):
def
test_catalog_query
(
self
):
def
test_catalog_query
(
self
):
t
=
time
.
time
()
t
=
time
.
time
()
result
=
self
.
api
.
catalog_query
(
result
=
self
.
api
.
catalog_query
(
ra
=
193
.2990269
,
# 15415
ra
=
193
,
# 15415
dec
=
0.03833105006540575
6
,
dec
=
2
6
,
radius
=
2
,
radius
=
0.1
,
catalog_name
=
'gaia3'
,
catalog_name
=
'gaia3'
,
min_mag
=-
1
,
min_mag
=-
1
,
max_mag
=-
1
,
max_mag
=-
1
,
obstime
=
-
1
,
obstime
=
-
1
,
limit
=
-
1
limit
=
1
)
)
print
(
result
)
# dt = self.api.to_table(result)
# dt = self.api.to_table(result)
# df = dt.to_pandas()
# df = dt.to_pandas()
# print(df.head())
# print(df.head())
...
...
tests/msc/test_msc_level2co.py
0 → 100644
View file @
69d34d83
import
os
import
unittest
from
astropy.io
import
fits
from
csst_dfs_api.msc.level2co
import
Level2CoApi
class
MSCLevel2CoDataTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
api
=
Level2CoApi
()
def
test_find
(
self
):
recs
=
self
.
api
.
find
(
level1_id
=
1
,
create_time
=
(
"2022-06-15 11:12:13"
,
"2022-06-16 11:12:13"
))
print
(
'find:'
,
recs
)
def
test_catalog_query
(
self
):
result
=
self
.
api
.
catalog_query
(
obs_id
=
'100000000'
,
obs_time
=
(
"2021-05-24 11:12:13"
,
"2021-05-25 13:12:13"
),
limit
=
2
)
if
result
.
success
:
dt
=
self
.
api
.
to_table
(
result
)
dt
.
pprint
()
else
:
print
(
result
)
def
test_get
(
self
):
rec
=
self
.
api
.
get
(
id
=
1
)
print
(
'get:'
,
rec
)
def
test_update_proc_status
(
self
):
rec
=
self
.
api
.
update_proc_status
(
id
=
1
,
status
=
4
)
print
(
'update_proc_status:'
,
rec
)
def
test_update_qc2_status
(
self
):
rec
=
self
.
api
.
update_qc2_status
(
id
=
1
,
status
=
7
)
print
(
'update_qc2_status:'
,
rec
)
def
test_write
(
self
):
rec
=
self
.
api
.
write
(
level1_id
=
1
,
data_type
=
"sci"
,
prc_status
=
3
,
prc_time
=
'2021-10-22 11:12:13'
,
filename
=
"MSC_MS_210525120000_100000000_20_cat.fits"
,
file_path
=
"/opt/temp/csst/msc_data/MSC_MS_210525120000_100000000_20_cat.fits"
)
print
(
'write:'
,
rec
)
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