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
d2e89420
Commit
d2e89420
authored
Jun 22, 2023
by
Wei Shoulin
Browse files
Iterable brick_ids
parent
ebd97b29
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api_cluster/mbi/level2.py
View file @
d2e89420
...
@@ -4,6 +4,8 @@ import grpc
...
@@ -4,6 +4,8 @@ import grpc
import
datetime
import
datetime
import
pickle
import
pickle
from
collections
import
Iterable
from
csst_dfs_commons.models
import
Result
from
csst_dfs_commons.models
import
Result
from
csst_dfs_commons.models.common
import
from_proto_model_list
from
csst_dfs_commons.models.common
import
from_proto_model_list
from
csst_dfs_commons.models.msc
import
Level2Record
,
Level2CatalogRecord
from
csst_dfs_commons.models.msc
import
Level2Record
,
Level2CatalogRecord
...
@@ -75,9 +77,14 @@ class Level2DataApi(object):
...
@@ -75,9 +77,14 @@ class Level2DataApi(object):
'''
'''
try
:
try
:
datas
=
io
.
BytesIO
()
datas
=
io
.
BytesIO
()
totalCount
=
0
totalCount
=
0
brick_ids
=
get_parameter
(
kwargs
,
"brick_ids"
,
[])
if
not
isinstance
(
brick_ids
,
Iterable
):
brick_ids
=
[
brick_ids
]
resps
=
self
.
stub
.
FindCatalog
(
level2_pb2
.
FindLevel2CatalogReq
(
resps
=
self
.
stub
.
FindCatalog
(
level2_pb2
.
FindLevel2CatalogReq
(
brick_ids
=
","
.
join
([
str
(
i
)
for
i
in
get_parameter
(
kwargs
,
"
brick_ids
"
,
[])
]),
brick_ids
=
","
.
join
([
str
(
i
)
for
i
in
brick_ids
]),
obs_id
=
get_parameter
(
kwargs
,
"obs_id"
,
None
),
obs_id
=
get_parameter
(
kwargs
,
"obs_id"
,
None
),
detector_no
=
get_parameter
(
kwargs
,
"detector_no"
,
None
),
detector_no
=
get_parameter
(
kwargs
,
"detector_no"
,
None
),
filter
=
get_parameter
(
kwargs
,
"filter"
,
None
),
filter
=
get_parameter
(
kwargs
,
"filter"
,
None
),
...
@@ -121,8 +128,13 @@ class Level2DataApi(object):
...
@@ -121,8 +128,13 @@ class Level2DataApi(object):
return: csst_dfs_common.models.Result
return: csst_dfs_common.models.Result
'''
'''
try
:
try
:
brick_ids
=
get_parameter
(
kwargs
,
"brick_ids"
,
[])
if
not
isinstance
(
brick_ids
,
Iterable
):
brick_ids
=
[
brick_ids
]
resp
,
_
=
self
.
stub
.
FindCatalogFile
.
with_call
(
level2_pb2
.
FindLevel2CatalogReq
(
resp
,
_
=
self
.
stub
.
FindCatalogFile
.
with_call
(
level2_pb2
.
FindLevel2CatalogReq
(
brick_ids
=
","
.
join
([
str
(
i
)
for
i
in
get_parameter
(
kwargs
,
"
brick_ids
"
,
[])
]),
brick_ids
=
","
.
join
([
str
(
i
)
for
i
in
brick_ids
]),
obs_id
=
get_parameter
(
kwargs
,
"obs_id"
),
obs_id
=
get_parameter
(
kwargs
,
"obs_id"
),
detector_no
=
get_parameter
(
kwargs
,
"detector_no"
),
detector_no
=
get_parameter
(
kwargs
,
"detector_no"
),
filter
=
get_parameter
(
kwargs
,
"filter"
,
None
),
filter
=
get_parameter
(
kwargs
,
"filter"
,
None
),
...
...
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