def test_analyze_runs_assoc(self): logger.info('== {} =='.format(self._testMethodName)) self.args.associate = True aRs = AnalyzeRuns(basePath = self.args.basePath, args = self.args, rt = self.rt, ev = self.ev, logger = logger) aRs.aggregateRuns() rFfFwhm, rFfFlux = aRs.analyzeRuns() # ToDo expand to Flux self.assertEqual(type(rFfFwhm[0]), ResultFit, 'return value: {}'.format(type(rFfFwhm[0])))
def test_analyze_runs_assoc(self): logger.info('== {} =='.format(self._testMethodName)) self.args.associate = True aRs = AnalyzeRuns(basePath=self.args.basePath, args=self.args, rt=self.rt, ev=self.ev, logger=logger) aRs.aggregateRuns() rFfFwhm, rFfFlux = aRs.analyzeRuns() # ToDo expand to Flux self.assertEqual(type(rFfFwhm[0]), ResultFit, 'return value: {}'.format(type(rFfFwhm[0])))
def fitFocDef(self, dataSxtr = None, ftw = None, ft = None): """ fit FOC_DEF """ rFtFwhm = rMnsFwhm = rFtFlux= rMnsFlux = None # analysis here aRs = AnalyzeRuns(debug = self.debug, basePath = None, args = self.args, rt = self.rt, ev = self.ev, logger = self.logger, xdisplay = self.xdisplay, ftw = ftw, ft = ft) dataRn = DataRun(debug = self.debug, args = self.args, rt = self.rt, logger = self.logger) for dSx in dataSxtr: if dSx!=None and dSx.fwhm>0. and dSx.stdFwhm>0.: dataRn.dataSxtrs.append(dSx) rFtFwhm, rMnsFwhm, rFtFlux, rMnsFlux = aRs.analyzeRun(dataRn = dataRn) arFtFwhm = arMnsFwhm = arFtFlux = arMnsFlux = None if self.rt.cfg['ANALYZE_ASSOC']: fitsFns = [ x.fitsFn for x in dataSxtr] # assoc analysis here aRs = AnalyzeRuns(debug = self.debug, basePath = None, args = self.args, rt = self.rt, ev = self.ev, logger = self.logger, xdisplay = self.xdisplay, ftw = ftw, ft = ft) dataRn = aRs.sextractRun(fitsFns = fitsFns) arFtFwhm, arMnsFwhm, arFtFlux, arMnsFlux = aRs.analyzeRun(dataRn = dataRn) # choose among the available results rFt = aRs.bestResult( rFtFwhm = rFtFwhm, arFtFwhm = arFtFwhm, rFtFlux = rFtFlux, arFtFlux = arFtFlux ) # ToDo: think about that return rFtFwhm, rMnsFwhm, arFtFwhm, arMnsFwhm, rFtFlux, rMnsFlux, arFtFlux, arMnsFlux # ToDo: expand to bestResult calculated means return rFt, rMnsFwhm
# environment ev = Environment(debug=args.debug, rt=rtc, logger=logger) if not args.basePath: parser.print_help() logger.warn('rts2saf_analyze: no --basepath specified') sys.exit(1) if not args.toconsole: print 'you may wish to enable logging to console --toconsole' print 'log file is written to: {}'.format(args.logfile) aRs = AnalyzeRuns(debug=args.debug, basePath=args.basePath, args=args, rt=rtc, ev=ev, logger=logger, xdisplay=XDISPLAY) aRs.aggregateRuns() if len(aRs.fS) == 0: logger.warn( 'rts2saf_analyze: exiting, no files found in basepath: {}'.format( args.basePath)) sys.exit(1) rFf = aRs.analyzeRuns() if len(rFf) == 0: logger.error('rts2saf_analyze: no results, exiting') sys.exit(1)
rtc.checkConfiguration(args=args) # environment ev = Environment(debug = args.debug, rt = rtc, logger = logger) if not args.basePath: parser.print_help() logger.warn('rts2saf_analyze: no --basepath specified') sys.exit(1) if not args.toconsole: print 'you may wish to enable logging to console --toconsole' print 'log file is written to: {}'.format(args.logfile) aRs = AnalyzeRuns(debug = args.debug, basePath = args.basePath, args = args, rt = rtc, ev = ev, logger = logger, xdisplay = XDISPLAY) aRs.aggregateRuns() if len(aRs.fS) == 0: logger.warn('rts2saf_analyze: exiting, no files found in basepath: {}'.format(args.basePath)) sys.exit(1) rFf = aRs.analyzeRuns() if len(rFf)==0: logger.error('rts2saf_analyze: no results, exiting') sys.exit(1) if args.model: if rFf[0].ambientTemp in 'NoTemp': logger.warn('rts2saf_analyze: no ambient temperature available in FITS files, no model fitted') else: