Exemple #1
0
 def populateroi(self, args):
     "Add ROIs to an object"
     md = self._load(args)
     client = self.ctx.conn(args)
     # TODO: Configure logging properly
     if args.report:
         populate_roi.log.setLevel(logging.DEBUG)
     else:
         populate_roi.log.setLevel(logging.INFO)
     factory = populate_roi.PlateAnalysisCtxFactory(client.sf)
     ctx = factory.get_analysis_ctx(md.get_id())
     count = ctx.get_measurement_count()
     if not count:
         self.ctx.die(100, "No measurements found")
     if args.measurement is not None and args.measurement >= count:
         self.ctx.die(100,
                      "Invalid measurement index: %d" % args.measurement)
     for i in range(count):
         if args.dry_run:
             self.ctx.out("Measurement %d has %s result files." %
                          (i, ctx.get_result_file_count(i)))
         else:
             if args.measurement is not None:
                 if args.measurement != i:
                     continue
             meas = ctx.get_measurement_ctx(i)
             meas.parse_and_populate()
Exemple #2
0
    def populateroi(self, args):
        "Add ROIs to an object"
        md = self._load(args)
        client = self.ctx.conn(args)

        log_level = logging.INFO - (10 * args.verbose) + (10 * args.quiet)
        if args.report:
            log_level = log_level - 10

        factory = populate_roi.PlateAnalysisCtxFactory(client.sf)
        ctx = factory.get_analysis_ctx(md.get_id())
        count = ctx.get_measurement_count()
        if not count:
            self.ctx.die(100, "No measurements found")
        if args.measurement is not None and args.measurement >= count:
            self.ctx.die(100,
                         "Invalid measurement index: %d" % args.measurement)
        for i in range(count):
            if args.dry_run:
                self.ctx.out("Measurement %d has %s result files." %
                             (i, ctx.get_result_file_count(i)))
            else:
                if args.measurement is not None:
                    if args.measurement != i:
                        continue
                meas = ctx.get_measurement_ctx(i)
                meas.parse_and_populate()