コード例 #1
0
class TestConfigurationBootes2(unittest.TestCase):

    def tearDown(self):
        pass

    def setUp(self):
        self.rt = Configuration(logger=logger)
        self.fileName='./rts2saf-bootes-2.cfg'
        self.success=self.rt.readConfiguration(fileName=self.fileName)
        self.args=Args()
        self.args.associate = True
        self.args.flux=True

    #@unittest.skip('feature not yet implemented')
    def test_readConfiguration(self):
        logger.info('== {} =='.format(self._testMethodName))
        self.assertTrue(self.success, 'config file: {} faulty or not found'.format(self.fileName))
        self.assertIs(type(self.rt), Configuration)

    def test_checkConfiguration(self):
        logger.info('== {} =='.format(self._testMethodName))
        self.assertTrue(self.success, 'config file: {} faulty or not found'.format(self.fileName))
        result = self.rt.checkConfiguration(args=self.args)
        self.assertTrue(result)

    def test_filterWheelInUse(self):
        logger.info('== {} =='.format(self._testMethodName))
        self.assertEqual(self.rt.cfg['inuse'][0], 'COLWFLT', 'return value: {}'.format(self.rt.cfg['inuse'][0]))

    def test_writeDefaultConfiguration(self):
        logger.info('== {} =='.format(self._testMethodName))
        cfn='./rts2saf-default.cfg'
        result=self.rt.writeDefaultConfiguration(cfn=cfn)
        self.assertEqual(cfn, result, 'return value: {}'.format(result))
コード例 #2
0
    if args.checkConfig:
        args.toconsole = True

    # logger
    logger = Logger(
        debug=args.debug,
        args=args).logger  # if you need to chage the log format do it here
    # read the run time configuration
    rt = Configuration(logger=logger)
    if not rt.readConfiguration(fileName=args.config):
        logger.error(
            'rts2saf_focus: exiting, wrong syntax, check the configuration file: {0}'
            .format(args.config))
        sys.exit(1)

    if not rt.checkConfiguration(args=args):
        logger.error(
            'rts2saf_focus: exiting, check the configuration file: {0}'.format(
                args.config))
        sys.exit(1)

    # overwrite config defaults
    rt.cfg['ANALYZE_FLUX'] = args.flux
    rt.cfg['ANALYZE_ASSOC'] = args.associate
    rt.cfg['ANALYZE_ASSOC_FRACTION'] = args.fractObjs

    if args.FitDisplay:
        rt.cfg['WITH_MATHPLOTLIB'] = True

    # get the environment
    ev = Environment(debug=args.debug, rt=rt, logger=logger)
コード例 #3
0
    rtc.cfg['ANALYZE_ASSOC_FRACTION'] = args.fractObjs
    rtc.cfg['FOCUSER_INTERVAL'] = args.focuserInterval
    rtc.cfg['WEIGHTED_MEANS'] = args.means

    if args.FitDisplay:
        rtc.cfg['WITH_MATHPLOTLIB'] = True

    if args.emptySlots is not None:
        rtc.cfg['EMPTY_SLOT_NAMES'] = [x.strip() for x in args.emptySlots]

    # ToDo ugly
    if args.filterNames is not None:
        fts = [x.strip() for x in args.filterNames]
        args.filterNames = fts

    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,
コード例 #4
0
ファイル: rts2saf_focus.py プロジェクト: RTS2/rts2
        args.debug=True
        args.level='DEBUG'
        args.toconsole=True
        
    if args.checkConfig:
        args.toconsole=True

    # logger
    logger= Logger(debug=args.debug, args=args).logger # if you need to chage the log format do it here
    # read the run time configuration
    rt=Configuration(logger=logger)
    if not rt.readConfiguration(fileName=args.config):
        logger.error('rts2saf_focus: exiting, wrong syntax, check the configuration file: {0}'.format(args.config))
        sys.exit(1)
        
    if not rt.checkConfiguration(args=args):
        logger.error('rts2saf_focus: exiting, check the configuration file: {0}'.format(args.config))
        sys.exit(1)

    # overwrite config defaults
    rt.cfg['ANALYZE_FLUX'] = args.flux  
    rt.cfg['ANALYZE_ASSOC'] = args.associate
    rt.cfg['ANALYZE_ASSOC_FRACTION'] = args.fractObjs

    if args.FitDisplay:
        rt.cfg['WITH_MATHPLOTLIB'] = True

    # get the environment
    ev=Environment(debug=args.debug, rt=rt,logger=logger)

    if not args.blind and args.focRange:
コード例 #5
0
ファイル: rts2saf_analyze.py プロジェクト: RTS2/rts2
    rtc.cfg['WEIGHTED_MEANS'] = args.means


    if args.FitDisplay:
        rtc.cfg['WITH_MATHPLOTLIB'] = True

    if args.emptySlots is not None:
        rtc.cfg['EMPTY_SLOT_NAMES'] = [ x.strip() for x in  args.emptySlots ]

    # ToDo ugly
    if args.filterNames is not None:
        fts = [ x.strip() for x in  args.filterNames ]
        args.filterNames = fts


    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()