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
ffe0b610
Commit
ffe0b610
authored
Jan 04, 2023
by
Wei Shoulin
Browse files
bytes
parent
2d128fe8
Changes
1
Show whitespace changes
Inline
Side-by-side
csst_dfs_api_cluster/common/catalog.py
View file @
ffe0b610
...
@@ -30,7 +30,8 @@ class CatalogApi(object):
...
@@ -30,7 +30,8 @@ class CatalogApi(object):
try
:
try
:
datas
=
b
''
datas
=
b
''
totalCount
=
0
totalCount
=
0
for
resp
in
self
.
stub
.
Gaia3Search
(
ephem_pb2
.
EphemSearchRequest
(
resps
=
self
.
stub
.
Gaia3Search
(
ephem_pb2
.
EphemSearchRequest
(
ra
=
ra
,
ra
=
ra
,
dec
=
dec
,
dec
=
dec
,
radius
=
radius
,
radius
=
radius
,
...
@@ -38,7 +39,8 @@ class CatalogApi(object):
...
@@ -38,7 +39,8 @@ class CatalogApi(object):
maxMag
=
max_mag
,
maxMag
=
max_mag
,
obstime
=
obstime
,
obstime
=
obstime
,
limit
=
limit
limit
=
limit
),
metadata
=
get_auth_headers
()):
),
metadata
=
get_auth_headers
())
for
resp
in
resps
:
if
resp
.
success
:
if
resp
.
success
:
# data = from_proto_model_list(Gaia3Record, resp.records)
# data = from_proto_model_list(Gaia3Record, resp.records)
datas
=
datas
+
resp
.
records
datas
=
datas
+
resp
.
records
...
@@ -208,7 +210,6 @@ class CatalogApi(object):
...
@@ -208,7 +210,6 @@ class CatalogApi(object):
rec
.
NS64HIdx
=
r
[
155
]
rec
.
NS64HIdx
=
r
[
155
]
rec
.
FileIdx
=
r
[
156
]
rec
.
FileIdx
=
r
[
156
]
ret_records2
.
append
(
rec
)
ret_records2
.
append
(
rec
)
return
Result
.
ok_data
(
data
=
ret_records2
).
append
(
"totalCount"
,
totalCount
)
return
Result
.
ok_data
(
data
=
ret_records2
).
append
(
"totalCount"
,
totalCount
)
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
()))
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