Commit b60c91f1 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

tweaks

parent 305ae41e
Pipeline #1212 failed with stage
in 0 seconds
...@@ -28,11 +28,12 @@ Change list ...@@ -28,11 +28,12 @@ Change list
.. code-block:: python .. code-block:: python
import os.path import os
import numpy as np import numpy as np
from astropy.io import fits import numpy.typing as npt
from astropy import table from astropy import table
from astropy.io import fits
from csst_common.status import CsstStatus, CsstResult from csst_common.status import CsstStatus, CsstResult
...@@ -40,23 +41,26 @@ Change list ...@@ -40,23 +41,26 @@ Change list
return fits.getdata(file_path) return fits.getdata(file_path)
def _do_step_one(data: np.ndarray) -> np.ndarray: def _do_step_one(data: npt.NDArray) -> npt.NDArray:
reduced_data = np.fliplr(data) reduced_data = np.fliplr(data)
return reduced_data return reduced_data
def _do_step_two(data: np.ndarray) -> np.ndarray: def _do_step_two(data: npt.NDArray) -> npt.NDArray:
reduced_data = np.flipud(data) reduced_data = np.flipud(data)
return reduced_data return reduced_data
def _do_step_three(data: np.ndarray, rc="/path/to/catalog") -> np.ndarray: def _do_step_three(data: npt.NDArray, rc: str = "/path/to/catalog") -> npt.NDArray:
trc = table.Table.read(rc) trc = table.Table.read(rc)
return data + np.mean(trc["ra"]) + np.mean(trc["dec"]) return data + np.mean(trc["ra"]) + np.mean(trc["dec"])
def base_msc_l1_mbi_image_distortion( def base_msc_l1_mbi_image_distortion(
input_file, output_file, rc: str = "/path/to/gaia_dr3.fits", **kwargs input_file: str,
output_file: str,
rc: str = "/path/to/gaia_dr3.fits",
**kwargs
) -> CsstResult: ) -> CsstResult:
"""your docstring here""" """your docstring here"""
# read data # read data
...@@ -71,11 +75,17 @@ Change list ...@@ -71,11 +75,17 @@ Change list
assert os.path.exists(output_file) assert os.path.exists(output_file)
# construct CsstResult # construct CsstResult
result = CsstResult( result = CsstResult(
status=CsstStatus.PERFECT, file_list=[output_file, "an additional output file"] status=CsstStatus.PERFECT,
file_list=[
output_file,
"/path/to/result1.fits",
"/path/to/result2.fits",
],
) )
return result return result
导入模块 导入模块
--------- ---------
......
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