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
b7fe9a52
Commit
b7fe9a52
authored
Oct 28, 2024
by
Wei Shoulin
Browse files
mbi l1 cutout
parent
aac0b282
Pipeline
#7159
passed with stage
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_dfs_api_cluster/mbi/__init__.py
View file @
b7fe9a52
from
.level1
import
Level1DataApi
\ No newline at end of file
csst_dfs_api_cluster/mbi/level1.py
0 → 100644
View file @
b7fe9a52
from
..common.service
import
grpc_channel
from
..common.utils
import
*
from
..common.constants
import
*
from
csst_dfs_commons.models.constants
import
MBI_DECTECTORS
class
Level1DataApi
(
object
):
def
__init__
(
self
):
self
.
stub
=
None
@
grpc_channel
def
cutout
(
self
,
**
kwargs
):
if
get_parameter
(
kwargs
,
"ra"
)
is
None
or
get_parameter
(
kwargs
,
"dec"
)
is
None
:
return
Result
.
error
(
message
=
"ra and dec are required"
)
if
float
(
get_parameter
(
kwargs
,
"ra"
))
<
0
or
float
(
get_parameter
(
kwargs
,
"ra"
))
>
360
:
return
Result
.
error
(
message
=
"ra must between 0 and 360"
)
if
float
(
get_parameter
(
kwargs
,
"dec"
))
<
-
90
or
float
(
get_parameter
(
kwargs
,
"dec"
))
>
90
:
return
Result
.
error
(
message
=
"dec must between -90 and 90"
)
if
get_parameter
(
kwargs
,
"pixels"
,
0
)
==
0
:
kwargs
[
'pixels'
]
=
256
if
not
get_parameter
(
kwargs
,
"filters"
):
kwargs
[
'filters'
]
=
[
'g'
]
kwargs
[
'module_id'
]
=
'MSC'
kwargs
[
'detector_no'
]
=
[
str
(
i
)
for
i
in
MBI_DECTECTORS
]
result
=
find_req
(
"Level1Servicer.FindByCoutout"
,
kwargs
)
if
not
result
.
success
:
return
result
l1_file_list
=
result
.
data
return
l1_file_list
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