Loading noctua/sequencer.py +19 −12 Original line number Diff line number Diff line Loading @@ -207,10 +207,15 @@ class Sequencer(): log.critical(msg) if not self.embedded: log.info("SEQUENCER: EOF in non-embedded mode. Forcing exit.") if hasattr(self, 'tpl') and self.tpl and hasattr(self.tpl, 'abort'): if hasattr( self, 'tpl') and self.tpl and hasattr( self.tpl, 'abort'): try: self.tpl.abort() except Exception: pass # Best effort except Exception: pass # Best effort os._exit(1) else: log.info("SEQUENCER: EOF in embedded mode. Signaling quit.") Loading Loading @@ -243,7 +248,9 @@ class Sequencer(): "SEQUENCER: Interrupted during interrupt handling. Quitting.") self.quit() except Exception as e: # Add a broad catch here for debugging sys.stderr.write(f"ERROR IN INTERRUPT HANDLER: {type(e).__name__}: {e}\n") sys.stderr.write( f"ERROR IN INTERRUPT HANDLER: { type(e).__name__}: {e}\n") log.error("Error in interrupt handler", exc_info=True) # Fallback to quitting if the handler itself fails self.quit() Loading noctua/templates/testlamp.py +1 −3 Original line number Diff line number Diff line Loading @@ -4,13 +4,11 @@ # System modules from time import sleep # Third-party modules from .basetemplate import BaseTemplate # Other templates from ..config.constants import on_off from ..devices import light from ..utils.logger import log from .basetemplate import BaseTemplate class Template(BaseTemplate): Loading noctua/templates/testoutput.py +1 −1 Original line number Diff line number Diff line Loading @@ -7,9 +7,9 @@ from astropy.time import Time # Other templates from ..config.constants import on_off from ..utils.structure import foc_path # from devices import lamp, light from ..utils.logger import log from ..utils.structure import foc_path from .basetemplate import BaseTemplate Loading noctua/utils/logger.py +12 −7 Original line number Diff line number Diff line Loading @@ -3,14 +3,17 @@ """Custom format log""" # System modules import sys import datetime import os # Will be used if log_path only returns a directory import sys # Third-party modules from loguru import logger import datetime # Other templates from .structure import log_path def mylog(): "logger function" Loading Loading @@ -46,9 +49,11 @@ def mylog(): return logger # This ensures mylog() is called only once. log = mylog() def main(): """Main function""" Loading noctua/utils/structure.py +18 −17 Original line number Diff line number Diff line Loading @@ -13,14 +13,15 @@ from pathlib import Path from astropy.io import fits from astropy.time import Time # Custom modules from ..config.constants import ( DATA_FOLDER, LOG_FOLDER, FITS_FOLDER, FOCUS_FOLDER, FILE_PREFIX, dateobs, dir_type, frame_number, imagetyp, FITS_EXT, FOCUS_EXT, LOG_EXT ) # Other templates from ..config.constants import (DATA_FOLDER, FILE_PREFIX, FITS_EXT, FITS_FOLDER, FOCUS_EXT, FOCUS_FOLDER, LOG_EXT, LOG_FOLDER, dateobs, dir_type, frame_number, imagetyp) PROJECT_ROOT = Path(__file__).parent.parent.parent def date_folder(): """Create a date folder string based on astronomical convention (changes at midday UTC). Loading noctua/config/constants.py +1 −1 File changed.Contains only whitespace changes. Show changes Loading
noctua/sequencer.py +19 −12 Original line number Diff line number Diff line Loading @@ -207,10 +207,15 @@ class Sequencer(): log.critical(msg) if not self.embedded: log.info("SEQUENCER: EOF in non-embedded mode. Forcing exit.") if hasattr(self, 'tpl') and self.tpl and hasattr(self.tpl, 'abort'): if hasattr( self, 'tpl') and self.tpl and hasattr( self.tpl, 'abort'): try: self.tpl.abort() except Exception: pass # Best effort except Exception: pass # Best effort os._exit(1) else: log.info("SEQUENCER: EOF in embedded mode. Signaling quit.") Loading Loading @@ -243,7 +248,9 @@ class Sequencer(): "SEQUENCER: Interrupted during interrupt handling. Quitting.") self.quit() except Exception as e: # Add a broad catch here for debugging sys.stderr.write(f"ERROR IN INTERRUPT HANDLER: {type(e).__name__}: {e}\n") sys.stderr.write( f"ERROR IN INTERRUPT HANDLER: { type(e).__name__}: {e}\n") log.error("Error in interrupt handler", exc_info=True) # Fallback to quitting if the handler itself fails self.quit() Loading
noctua/templates/testlamp.py +1 −3 Original line number Diff line number Diff line Loading @@ -4,13 +4,11 @@ # System modules from time import sleep # Third-party modules from .basetemplate import BaseTemplate # Other templates from ..config.constants import on_off from ..devices import light from ..utils.logger import log from .basetemplate import BaseTemplate class Template(BaseTemplate): Loading
noctua/templates/testoutput.py +1 −1 Original line number Diff line number Diff line Loading @@ -7,9 +7,9 @@ from astropy.time import Time # Other templates from ..config.constants import on_off from ..utils.structure import foc_path # from devices import lamp, light from ..utils.logger import log from ..utils.structure import foc_path from .basetemplate import BaseTemplate Loading
noctua/utils/logger.py +12 −7 Original line number Diff line number Diff line Loading @@ -3,14 +3,17 @@ """Custom format log""" # System modules import sys import datetime import os # Will be used if log_path only returns a directory import sys # Third-party modules from loguru import logger import datetime # Other templates from .structure import log_path def mylog(): "logger function" Loading Loading @@ -46,9 +49,11 @@ def mylog(): return logger # This ensures mylog() is called only once. log = mylog() def main(): """Main function""" Loading
noctua/utils/structure.py +18 −17 Original line number Diff line number Diff line Loading @@ -13,14 +13,15 @@ from pathlib import Path from astropy.io import fits from astropy.time import Time # Custom modules from ..config.constants import ( DATA_FOLDER, LOG_FOLDER, FITS_FOLDER, FOCUS_FOLDER, FILE_PREFIX, dateobs, dir_type, frame_number, imagetyp, FITS_EXT, FOCUS_EXT, LOG_EXT ) # Other templates from ..config.constants import (DATA_FOLDER, FILE_PREFIX, FITS_EXT, FITS_FOLDER, FOCUS_EXT, FOCUS_FOLDER, LOG_EXT, LOG_FOLDER, dateobs, dir_type, frame_number, imagetyp) PROJECT_ROOT = Path(__file__).parent.parent.parent def date_folder(): """Create a date folder string based on astronomical convention (changes at midday UTC). Loading