Ejemplo n.º 1
0
    def run_command_on_occupancy_envelopes(self, cmd_string, ls, times=None):
        """ Runs a command across occupancy envelopes
        
        cmd_string is the command to run, with %0 for current map, %1 for
        previous saved map, etc.

        ls is a list of lifestages to run command on

        times is a list of times to run command on, -ve values are interpreted
        as indices from the end of the array e.g. -1 == last map.
        """
        mdig_config = config.get_config()

        if not self.is_complete():
            self.log.error("Incomplete instance [%s]" % self)
            raise InstanceIncompleteException()

        ac = AnalysisCommand(cmd_string)
        self.set_region()
        envelopes = self.get_occupancy_envelopes()
        for ls_id in ls:
            e_times = [int(t) for t in envelopes[ls_id].keys()]
            ac.init_output_file(self)
            ac.set_times(self.experiment.get_period(), e_times, times)
            ac.run_command(envelopes[ls_id])

            if mdig_config.analysis_add_to_xml:
                # add the analysis result to xml filename
                # under instance...
                self.add_analysis_result(ls_id, ac)
Ejemplo n.º 2
0
    def run_command_on_occupancy_envelopes(self, cmd_string, ls, times=None):
        """ Runs a command across occupancy envelopes
        
        cmd_string is the command to run, with %0 for current map, %1 for
        previous saved map, etc.

        ls is a list of lifestages to run command on

        times is a list of times to run command on, -ve values are interpreted
        as indices from the end of the array e.g. -1 == last map.
        """
        mdig_config = config.get_config()
        
        if not self.is_complete():
            self.log.error("Incomplete instance [%s]" % self)
            raise InstanceIncompleteException()

        ac = AnalysisCommand(cmd_string)
        self.set_region()
        envelopes = self.get_occupancy_envelopes()
        for ls_id in ls:
            e_times = [ int(t) for t in envelopes[ls_id].keys() ]
            ac.init_output_file(self)
            ac.set_times(self.experiment.get_period(), e_times, times)
            ac.run_command(envelopes[ls_id])

            if mdig_config.analysis_add_to_xml:
                # add the analysis result to xml filename
                # under instance...
                self.add_analysis_result(ls_id, ac)
Ejemplo n.º 3
0
    def run_command_on_replicates(self, cmd_string, ls, times=None):
        """ Run a command across all replicate maps.

        cmd_string is the command to run, with %0 for current map, %1 for
        previous saved map, etc.

        ls is a list of lifestages to run command on.

        times is a list of times to run command on, -ve values are interpreted
        as indices from the end of the array e.g. -1 == last map.
        """
        self.set_region()
        if not self.is_complete():
            self.log.warning(
                "Instance [%s] is incomplete, but will continue anyway" % self)

        ac = AnalysisCommand(cmd_string)
        for r in self.replicates:
            for ls_id in ls:
                saved_maps = r.get_saved_maps(ls_id)
                r_times = [int(t) for t in saved_maps.keys()]
                ac.init_output_file(self, r)
                ac.set_times(self.experiment.get_period(), r_times, times)
                ac.run_command(saved_maps)

                if config.get_config().analysis_add_to_xml:
                    # add the analysis result to xml filename
                    # under instance...
                    r.add_analysis_result(ls_id, ac)
Ejemplo n.º 4
0
    def run_command_on_replicates(self, cmd_string, ls, times=None):
        """ Run a command across all replicate maps.

        cmd_string is the command to run, with %0 for current map, %1 for
        previous saved map, etc.

        ls is a list of lifestages to run command on.

        times is a list of times to run command on, -ve values are interpreted
        as indices from the end of the array e.g. -1 == last map.
        """
        self.set_region()
        if not self.is_complete():
            self.log.warning(
                    "Instance [%s] is incomplete, but will continue anyway" % self)
            
        ac = AnalysisCommand(cmd_string)
        for r in self.replicates:
            for ls_id in ls:
                saved_maps = r.get_saved_maps(ls_id)
                r_times = [ int(t) for t in saved_maps.keys() ]
                ac.init_output_file(self, r)
                ac.set_times(self.experiment.get_period(),r_times,times)
                ac.run_command(saved_maps)
                
                if config.get_config().analysis_add_to_xml:
                    # add the analysis result to xml filename
                    # under instance...
                    r.add_analysis_result(ls_id, ac)