Loading doc/source/ch08_csst_common.rst +1 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ Source code .. literalinclude:: csst_common/example_interface.py :caption: ``example_interface.py`` :emphasize-lines: 7-11,25-29,75-86,101-112,169-171 :emphasize-lines: 7-11,25-29,75-88,103-116,173-175 :linenos: :language: python Loading doc/source/csst_common/example_interface.py +11 −7 Original line number Diff line number Diff line Loading @@ -74,16 +74,18 @@ def process_single_image( # check result existence if os.path.exists(filepath_output): # file exists, check precison if fits.getheader(filepath_output)["TOL"] < 1e-5: return CsstStatus.PERFECT, fr # file exists, check status and precision if fits.getheader(filepath_output)["STT_DIST"] == 0 and \ fits.getheader(filepath_output)["PCS_DIST"] < 1e-5 and \ fits.getheader(filepath_output)["NS_DIST"] >= 8: return CsstStatus.PERFECT else: return CsstStatus.WARNING, fr return CsstStatus.WARNING else: # file doesn't exist, do your fallback solution fits.HDUList(fits.PrimaryHDU()).writeto(filepath_output) assert os.path.exists(filepath_output) return CsstStatus.WARNING, fr return CsstStatus.WARNING # process multiple images in an exposure (RECOMMENDED, at least for MBI or SLS) Loading @@ -100,8 +102,10 @@ def one_job(dm: CsstMsDataManager, detector: int): # check result existence if os.path.exists(filepath_output): # file exists, check precison if fits.getheader(filepath_output)["TOL"] < 1e-5: # file exists, check status and precision if fits.getheader(filepath_output)["STT_DIST"] == 0 and \ fits.getheader(filepath_output)["PCS_DIST"] < 1e-5 and \ fits.getheader(filepath_output)["NS_DIST"] >= 8: return CsstStatus.PERFECT else: return CsstStatus.WARNING Loading Loading
doc/source/ch08_csst_common.rst +1 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ Source code .. literalinclude:: csst_common/example_interface.py :caption: ``example_interface.py`` :emphasize-lines: 7-11,25-29,75-86,101-112,169-171 :emphasize-lines: 7-11,25-29,75-88,103-116,173-175 :linenos: :language: python Loading
doc/source/csst_common/example_interface.py +11 −7 Original line number Diff line number Diff line Loading @@ -74,16 +74,18 @@ def process_single_image( # check result existence if os.path.exists(filepath_output): # file exists, check precison if fits.getheader(filepath_output)["TOL"] < 1e-5: return CsstStatus.PERFECT, fr # file exists, check status and precision if fits.getheader(filepath_output)["STT_DIST"] == 0 and \ fits.getheader(filepath_output)["PCS_DIST"] < 1e-5 and \ fits.getheader(filepath_output)["NS_DIST"] >= 8: return CsstStatus.PERFECT else: return CsstStatus.WARNING, fr return CsstStatus.WARNING else: # file doesn't exist, do your fallback solution fits.HDUList(fits.PrimaryHDU()).writeto(filepath_output) assert os.path.exists(filepath_output) return CsstStatus.WARNING, fr return CsstStatus.WARNING # process multiple images in an exposure (RECOMMENDED, at least for MBI or SLS) Loading @@ -100,8 +102,10 @@ def one_job(dm: CsstMsDataManager, detector: int): # check result existence if os.path.exists(filepath_output): # file exists, check precison if fits.getheader(filepath_output)["TOL"] < 1e-5: # file exists, check status and precision if fits.getheader(filepath_output)["STT_DIST"] == 0 and \ fits.getheader(filepath_output)["PCS_DIST"] < 1e-5 and \ fits.getheader(filepath_output)["NS_DIST"] >= 8: return CsstStatus.PERFECT else: return CsstStatus.WARNING Loading