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-cluster
Commits
5c73b401
Commit
5c73b401
authored
Dec 27, 2023
by
Wei Shoulin
Browse files
generate coordinate search condition sql
parent
3a01a3f0
Pipeline
#2782
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api_cluster/facility/level2.py
View file @
5c73b401
...
@@ -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
...
...
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