def logfileLen(): # count the lines in the current log file result = 0 logfile = casalog.logfile() if os.path.isfile(logfile): with open(logfile) as f: for result, l in enumerate(f, 1): pass return result
def test_tclean_success(): # An EXTREMELY HACKY way to test whether tclean succeeded on the previous iteration with open(casalog.logfile(), "r") as fh: lines = fh.readlines() for line in lines[-5:]: if 'SEVERE tclean:::: An error occurred running task tclean.' in line: raise ValueError( "tclean failed. See log for detailed error report.\n{0}". format(line)) if 'SEVERE' in line: raise ValueError( "SEVERE error message encountered: {0}".format(line))
def __init__(self, start_services=False): # Initialize command request handler service state self.__command_request_handler_service_on = False self.__command_request_handler_service_running = False self.__command_request_handler_service_thread = None # Instantiate MPICommunicator reference self.__communicator = MPICommunicator() # Instantiate MPIMonitorClient reference self.__monitor_server = MPIMonitorServer(False) # Initialize logfile descriptor self.__logfile_descriptor = open(casalog.logfile(), "a") # Initialize virtual frame buffer state self.__virtual_frame_buffer_port = None self.__virtual_frame_buffer_process = None # Automatically start services if start_services: self.start_services()
def __init__(self,start_services=False): # Initialize command request handler service state self.__command_request_handler_service_on = False self.__command_request_handler_service_running = False self.__command_request_handler_service_thread = None # Instantiate MPICommunicator reference self.__communicator = MPICommunicator() # Instantiate MPIMonitorClient reference self.__monitor_server = MPIMonitorServer(False) # Initialize logfile descriptor self.__logfile_descriptor = open(casalog.logfile(), 'a') # Initialize virtual frame buffer state self.__virtual_frame_buffer_port = None self.__virtual_frame_buffer_process = None # Automatically start services if start_services: self.start_services()
" containing the ALMAIMF code.") else: sys.path.append(os.getenv('ALMAIMF_ROOTDIR')) from metadata_tools import logprint import os try: from taskinit import casalog except ImportError: from casatasks import casalog if os.getenv('LOGFILENAME'): casalog.setlogfile(os.path.join(os.getcwd(), os.getenv('LOGFILENAME'))) print("CASA log file name is {0}".format(casalog.logfile())) runonce = bool(os.environ.get('RUNONCE')) # to do diagnostic plotting, we need the MS, not just the science-only calibrated MS SPACESAVING = 1 DOSPLIT = True # only walk the science goal directories science_goal_dirs = glob.glob("science_goal*") for scigoal in science_goal_dirs: for group in glob.glob(scigoal + "/*"): for member in glob.glob(os.path.join(group, "*")): dirpath = member scriptsforpi = glob.glob(