def set_to_running(): LOGGER.info( "Given A running telescope for executing observations on a subarray") assert (telescope_is_in_standby()) LOGGER.info("Starting up telescope") set_telescope_to_running() wait_before_test(timeout=10)
def start_up(): LOGGER.info( "Given A running telescope for executing observations on a subarray") LOGGER.info("Check whether telescope is in StandBy") assert (telescope_is_in_standby()) LOGGER.info("Starting up telescope") set_telescope_to_running() wait_before_test(timeout=10) LOGGER.info("Telescope is in ON State")
def start_up_telescope(result): if telescope_is_in_standby(): LOGGER.info("PROCESS: Starting up telescope") set_telescope_to_running() wait_before_test(timeout=10) subarray_state = resource(result[SUBARRAY_USED]).get('obsState') assert subarray_state == 'EMPTY', \ f"Expected sub-array to be in EMPTY but instead was in {subarray_state}" LOGGER.info("Sub-array is in ObsState EMPTY")
def set_telescope_in_on_state(result): """ Set telescope to ON state (startup) if it's not yet ON. """ LOGGER.info("Starting up telescope") if telescope_is_in_standby(): set_telescope_to_running() wait_before_test(timeout=10) telescope_state = resource(result[CENTRAL_NODE_USED]).get('State') assert telescope_state == 'ON', \ f"Expected telescope to be ON but instead was {telescope_state}" LOGGER.info("Telescope is in ON state")
def set_subarray_to_idle(result): """ Set sub-array to idle state after resources are allocated. """ if telescope_is_in_standby(): LOGGER.info("Starting up telescope") set_telescope_to_running() LOGGER.info("Assigning resources") to_be_composed_out_of() subarray_state = resource(result[SUBARRAY_USED]).get('obsState') assert subarray_state == 'IDLE', \ f"Expected sub-array to be in IDLE but instead was in {subarray_state}" LOGGER.info("Sub-array is in ObsState IDLE")
def assign(): LOGGER.info( "Before starting the telescope checking if the telescope is in StandBy." ) assert telescope_is_in_standby() LOGGER.info("Telescope is in StandBy.") LOGGER.info("Invoking Startup Telescope command on the telescope.") set_telescope_to_running() wait_before_test(timeout=10) LOGGER.info("Telescope is started successfully.") LOGGER.info("Allocating resources to Low Subarray 1") to_be_composed_out_of() wait_before_test(timeout=10) LOGGER.info("Subarray 1 is ready")
def assign(): LOGGER.info( "Before starting the telescope checking if the telescope is in StandBy." ) #Added timeout of 10 sec to wait tmc_low subarray to become OFF wait_before_test(timeout=10) assert (telescope_is_in_standby()) LOGGER.info("Telescope is in StandBy.") LOGGER.info("Invoking Startup Telescope command on the telescope.") LOGGER.info("Starting up telescope") set_telescope_to_running() wait_before_test(timeout=10) LOGGER.info("Telescope is started successfully.") LOGGER.info("Allocating resources to Low Subarray 1") to_be_composed_out_of() LOGGER.info("AssignResources execution successful on Subarray 1") wait_before_test(timeout=10)
def allocate_resources_from_sbi(script, sb_json): """ Use the OET Rest API to run resource allocation script with SB JSON Args: script (str): file path to an observing script sb_json (str): file path to a scheduling block """ if telescope_is_in_standby(): set_telescope_to_running() wait_before_test(timeout=10) script_completion_state = EXECUTOR.execute_script(script, sb_json, timeout=60) assert script_completion_state == 'COMPLETED', \ f"Expected resource allocation script to be COMPLETED, instead was {script_completion_state}"
def start_up(): LOGGER.info("Check whether telescope is in StandBy") assert (telescope_is_in_standby()) LOGGER.info("Starting up telescope") set_telescope_to_running() wait_before_test(timeout=10)