Commit 77b9ca85 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

removed try except in read

parent 440b5669
...@@ -135,18 +135,14 @@ class CsstMscImgData(CsstMscData): ...@@ -135,18 +135,14 @@ class CsstMscImgData(CsstMscData):
>>> print("instrument: ", data.get_l0keyword("pri", "INSTRUME")) >>> print("instrument: ", data.get_l0keyword("pri", "INSTRUME"))
>>> print("object: ", data.get_l0keyword("pri", "OBJECT")) >>> print("object: ", data.get_l0keyword("pri", "OBJECT"))
""" """
with fits.open(fp) as hdulist:
try: instrument = hdulist[0].header.get('INSTRUME') # strip or not?
with fits.open(fp) as hdulist: detector = hdulist[0].header.get('DETECTOR') # strip or not?
instrument = hdulist[0].header.get('INSTRUME') # strip or not? print("@CsstMscImgData: reading data {} ...".format(fp))
detector = hdulist[0].header.get('DETECTOR') # strip or not? assert instrument in INSTRUMENT_LIST
print("@CsstMscImgData: reading data {} ...".format(fp)) if instrument == 'MSC' and 6 <= int(detector[3:5]) <= 25:
assert instrument in INSTRUMENT_LIST # multi-band imaging
if instrument == 'MSC' and 6 <= int(detector[3:5]) <= 25: hdu0 = hdulist[0].copy()
# multi-band imaging hdu1 = hdulist[1].copy()
hdu0 = hdulist[0].copy() data = CsstMscImgData(hdu0, hdu1, instrument=instrument, detector=detector)
hdu1 = hdulist[1].copy() return data
data = CsstMscImgData(hdu0, hdu1, instrument=instrument, detector=detector)
return data
except Exception as e:
print(e)
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