Commit b7fe9a52 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

mbi l1 cutout

parent aac0b282
Pipeline #7159 passed with stage
from .level1 import Level1DataApi
\ No newline at end of file
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
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