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

tweaks

parent 4aab9f44
......@@ -12,6 +12,7 @@ import os
import glob
import re
import numpy as np
from astropy.io import fits
from .params import CSST_PARAMS as CP
......@@ -266,15 +267,18 @@ class CsstMsDataManager:
print("final target detector IDs are ", self.target_detectors)
return
def get_bias(self, detector=6):
def get_bias(self, detector=6) -> np.ndarray:
""" get bias data """
fp = glob.glob(self.path_aux.format("CLB", detector))[0]
return fits.getdata(fp)
def get_dark(self, detector=6):
def get_dark(self, detector=6) -> np.ndarray:
""" get dark data """
fp = glob.glob(self.path_aux.format("CLD", detector))[0]
return fits.getdata(fp)
def get_flat(self, detector=6):
def get_flat(self, detector=6) -> np.ndarray:
""" get flat data """
fp = glob.glob(self.path_aux.format("CLF", detector))[0]
return fits.getdata(fp)
......@@ -349,7 +353,7 @@ class CsstMsDataManager:
dir_pcref = ""
else:
raise ValueError("@DM: invalid hostname {}!".format(hostname))
raise ValueError("@DM: invalid hostname {} or datatype {}!".format(hostname, datatype))
return CsstMsDataManager(
ver_sim=ver_sim, datatype=datatype, dir_l0=dir_l0, dir_l1=dir_l1, dir_pcref=dir_pcref, path_aux=path_aux)
......
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