Commit ae72d421 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

level1 cone

parent e6b59eac
......@@ -20,6 +20,9 @@ class Level1DataApi(object):
qc1_status : [int],
prc_status : [int],
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
:returns: csst_dfs_common.models.Result
......@@ -35,6 +38,17 @@ class Level1DataApi(object):
'''
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):
''' fetch a record from database
......
from ..facility import ObservationApi, Level0DataApi
from ..facility import ObservationApi, Level0DataApi, Level1DataApi
from csst_dfs_commons.models import Result
def find_observation(
......@@ -23,6 +23,25 @@ def find_level0(obs_id: str = '',
dec_obj: float = None,
radius: float = None,
object_name: str = None,
version: str = None) -> Result:
version: str = None,
limit: int = 0) -> Result:
kwarg = locals()
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
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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment