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
ae72d421
Commit
ae72d421
authored
Feb 23, 2023
by
Wei Shoulin
Browse files
level1 cone
parent
e6b59eac
Changes
3
Show whitespace changes
Inline
Side-by-side
csst_dfs_api/facility/level1.py
View file @
ae72d421
...
@@ -20,6 +20,9 @@ class Level1DataApi(object):
...
@@ -20,6 +20,9 @@ class Level1DataApi(object):
qc1_status : [int],
qc1_status : [int],
prc_status : [int],
prc_status : [int],
filename: [str]
filename: [str]
ra_cen: float = None,
dec_cen: float = None,
radius_cen: float = None,
limit: limits returns the number of records,default 0:no-limit
limit: limits returns the number of records,default 0:no-limit
:returns: csst_dfs_common.models.Result
:returns: csst_dfs_common.models.Result
...
@@ -35,6 +38,17 @@ class Level1DataApi(object):
...
@@ -35,6 +38,17 @@ class Level1DataApi(object):
'''
'''
return
self
.
stub
.
find_by_brick_ids
(
**
kwargs
)
return
self
.
stub
.
find_by_brick_ids
(
**
kwargs
)
def
sls_find_by_qc1_status
(
self
,
**
kwargs
):
''' retrieve level1 records from database
:param kwargs: Parameter dictionary, key items support:
qc1_status : [int],
limit: limits returns the number of records,default 1
:returns: csst_dfs_common.models.Result
'''
return
self
.
stub
.
sls_find_by_qc1_status
(
**
kwargs
)
def
get
(
self
,
**
kwargs
):
def
get
(
self
,
**
kwargs
):
''' fetch a record from database
''' fetch a record from database
...
...
csst_dfs_api/functional/__init__.py
View file @
ae72d421
from
..facility
import
ObservationApi
,
Level0DataApi
from
..facility
import
ObservationApi
,
Level0DataApi
,
Level1DataApi
from
csst_dfs_commons.models
import
Result
from
csst_dfs_commons.models
import
Result
def
find_observation
(
def
find_observation
(
...
@@ -23,6 +23,25 @@ def find_level0(obs_id: str = '',
...
@@ -23,6 +23,25 @@ def find_level0(obs_id: str = '',
dec_obj
:
float
=
None
,
dec_obj
:
float
=
None
,
radius
:
float
=
None
,
radius
:
float
=
None
,
object_name
:
str
=
None
,
object_name
:
str
=
None
,
version
:
str
=
None
)
->
Result
:
version
:
str
=
None
,
limit
:
int
=
0
)
->
Result
:
kwarg
=
locals
()
kwarg
=
locals
()
return
Level0DataApi
().
find
(
**
kwarg
)
return
Level0DataApi
().
find
(
**
kwarg
)
def
find_level1
(
level0_id
:
str
=
''
,
module_id
:
str
=
''
,
data_type
:
str
=
''
,
create_time
:
tuple
=
(
None
,
None
),
qc1_status
:
int
=
None
,
prc_status
:
int
=
None
,
file_name
:
str
=
''
,
ra_cen
:
float
=
None
,
dec_cen
:
float
=
None
,
radius_cen
:
float
=
None
,
limit
:
int
=
0
)
->
Result
:
kwarg
=
locals
()
return
Level1DataApi
().
find
(
**
kwarg
)
def
find_sls_by_qc1_status
(
qc1_status
:
int
=
-
1
,
limit
:
int
=
1
)
->
Result
:
kwarg
=
locals
()
return
Level1DataApi
().
sls_find_by_qc1_status
(
**
kwarg
)
\ No newline at end of file
tests/sls/test_sls_level1.py
0 → 100644
View file @
ae72d421
import
os
import
unittest
from
astropy.io
import
fits
from
csst_dfs_api.facility.level1
import
Level1DataApi
class
SLSLevel1DataTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
api
=
Level1DataApi
()
def
test_find_by_qc1_status
(
self
):
recs
=
self
.
api
.
sls_find_by_qc1_status
(
qc1_status
=-
1
)
print
(
'find_by_qc1_status:'
,
recs
)
def
test_find
(
self
):
recs
=
self
.
api
.
find
(
ra_cen
=
1
,
dec_cen
=
2
,
radius_cen
=
1
)
print
(
'find:'
,
recs
)
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