if src is None: logger.logCritical("Error no source appears to be visible!") array.endExecution(Control.FAIL, "No visible Source.") sys.exit(-1) else: logger.logInfo("Using source: " + src.getSourceName()) ##################################################################### src.addLinearStroke("-2 arcmin", 0, "2 arcmin/min", 0, 0) # # now configure the spectral spec. specSpec = SpectralSpec() try: specSpec.setSubscanDuration("2 min") specSpec.setFrequency("86.5 GHz") sqlConf = SquareLawConfig() sqlConf.setIntegrationDuration(0.1) specSpec.setSquareLawConfig(sqlConf) except: logger.logCritical("Could not configure specSpec") array.endExecution(Control.FAIL, "Could not configure specSpec") sys.exit(-1) #### Starting movement of antenna ################## try: tp_obs_mode.setTarget(src, specSpec) tp_obs_mode.beginScan([ScanIntentMod.TARGET]) tp_obs_mode.doSubscan([SubscanIntentMod.ON_SOURCE]) tp_obs_mode.endScan() except: logger.logCritical("Could not do a beginScan/doSubScan/endSubScan")
# Get the array and begin execution testName = 'Pre-tuning for observation on strong source' setArrayName(arrayName) array = getArray() antennas = array.antennas() array.beginExecution() mode = array.getTotalPowerObservingMode() logger.logInfo("Total Power Observing Mode has been created") try: logger.logInfo("Executing "+testName+" setting frequency ") print 'Setting frequency\n' # mode.setFrequency(obsFreq) ss = SpectralSpec() sqrLawConfig = SquareLawConfig() sqrLawConfig.setIntegrationDuration("10 ms") ss.setSquareLawConfig(sqrLawConfig) ss.setFrequency(obsFreq) mode.setSpectrum(ss) except KeyboardInterrupt: logger.logError("^C Pressed!") logger.logInfo("Trying to close down...") except Exception, ex: logger.logCritical("Some sort of exception was thrown... go look at logs.") helperException = ACSErrTypeCommonImpl.UnknownExImpl(exception=ex) helperException.Print() array.endExecution(Control.FAIL, "Exception thrown in "+ testName) raise ex