Commit 5c73b401 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

generate coordinate search condition sql

parent 3a01a3f0
Pipeline #2782 passed with stage
...@@ -96,6 +96,33 @@ class Level2DataApi(object): ...@@ -96,6 +96,33 @@ class Level2DataApi(object):
except grpc.RpcError as e: except grpc.RpcError as e:
return Result.error(message="%s:%s" % (e.code().value, e.details())) return Result.error(message="%s:%s" % (e.code().value, e.details()))
def coord_cond_sql(self, **kwargs):
''' generate coordinate search condition sql
:param kwargs: Parameter dictionary, key items support:
data_type: [str]
ra: [float]
dec: [float]
radius: [float]
:returns: csst_dfs_common.models.Result
'''
try:
resp = self.stub.CoordCond(level2_pb2.CoordCondReq(
data_type = get_parameter(kwargs, "data_type"),
ra = get_parameter(kwargs, "ra"),
dec = get_parameter(kwargs, "dec"),
radius = get_parameter(kwargs, "radius")
),metadata = get_auth_headers())
if resp.success:
return Result.ok_data(data = resp.condition)
else:
return Result.error(message = str(resp.error.detail))
except grpc.RpcError as e:
return Result.error(message="%s:%s" % (e.code().value, e.details()))
def find_existed_brick_ids(self, **kwargs): def find_existed_brick_ids(self, **kwargs):
''' retrieve existed brick_ids in a single exposure catalog ''' retrieve existed brick_ids in a single exposure catalog
......
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