def create_machine_static_page(self):
     '''
     creates the static machine page which comes as standard in the vis
     '''
     #create machine tab in the form of a table
     scope = config.get("Visualiser", "initial_scope")
     machine_page = MachinePage(self.dao, True, scope, self.open_windows,
                                self.pages, self.real_pages)
Beispiel #2
0
    def __init__(self,
                 dao,
                 windows,
                 main_pages,
                 vertex_in_question,
                 real_pages,
                 vertex=None,
                 merged=True):
        super(RasterPage, self).__init__(dao, windows, main_pages, real_pages)
        self.is_merged_version = merged
        #holds all the vertexes being recorded for spikes
        if vertex_in_question is None:
            self.vertex_in_question = list()
            self.vertex_in_question.append(vertex)
        else:
            self.vertex_in_question = sorted(vertex_in_question,
                                             key=lambda vertex: vertex.label)

        #creates a collection of offsets for y plot
        self.off_sets = list()
        current_off_set = 0

        self.x_axis_scope = config.get("Visualiser", "raster_plot_x_scope")
        if self.x_axis_scope == "None":
            self.x_axis_scope = dao.run_time
        if self.x_axis_scope is None:
            self.x_axis_scope = 2000.0

        self.do_fading = config.getboolean("Visualiser",
                                           "raster_plot_do_fading")
        self.data_stores = []

        for vertex in self.vertex_in_question:
            label = str(vertex.label)
            self.data_stores.append(label)
            tuple_data = [(-1, -1), (-1, -1)]
            self.data_stores.append(tuple_data)
            self.off_sets.append(current_off_set)
            current_off_set += vertex.atoms + 15

        #records the maxiumum neuron value
        self.max_y_value = current_off_set

        #set name of page
        self.page = gtk.Frame("raster plot")

        self.figure = None
        self.plot = ScatterplotChart()
        self.axis = None
        self.canvas = None
        self.graphview = None
        if self.is_merged_version:
            label = "merged raster page"
        else:
            label = "Raster page of {}".format(vertex.label)
        main_pages.append_page(self.page, gtk.Label(label))
        #generate plot
        self.generate_plot(0, True)
    def __init__(self, dao, windows, main_pages, vertex_in_question, real_pages,
                 vertex=None, merged=True):
        super(RasterPage, self).__init__(dao, windows, main_pages, real_pages)
        self.is_merged_version = merged
        #holds all the vertexes being recorded for spikes
        if vertex_in_question is None:
            self.vertex_in_question = list()
            self.vertex_in_question.append(vertex)
        else:
            self.vertex_in_question = sorted(vertex_in_question,
                                             key=lambda vertex: vertex.label)

        #creates a collection of offsets for y plot
        self.off_sets = list()
        current_off_set = 0

        self.x_axis_scope = config.get("Visualiser", "raster_plot_x_scope")
        if self.x_axis_scope == "None":
            self.x_axis_scope = dao.run_time
        if self.x_axis_scope is None:
            self.x_axis_scope = 2000.0
        
        self.do_fading = config.getboolean("Visualiser", "raster_plot_do_fading")
        self.data_stores = []
            
        for vertex in self.vertex_in_question:
            label = str(vertex.label)
            self.data_stores.append(label)
            tuple_data = [(-1, -1), (-1, -1)]
            self.data_stores.append(tuple_data)
            self.off_sets.append(current_off_set)
            current_off_set += vertex.atoms + 15

        #records the maxiumum neuron value
        self.max_y_value = current_off_set

        #set name of page
        self.page = gtk.Frame("raster plot")

        self.figure = None
        self.plot = ScatterplotChart()
        self.axis = None
        self.canvas = None
        self.graphview = None
        if self.is_merged_version:
            label = "merged raster page"
        else:
            label = "Raster page of {}".format(vertex.label)
        main_pages.append_page(self.page,
                               gtk.Label(label))
        #generate plot
        self.generate_plot(0, True)
Beispiel #4
0
for arg in args:
    if hostname is None:
        print "Using %s as hostname" % arg
        hostname = arg
    elif configfile is None:
        print "Using %s as configfile" % arg
        configfile = _checkfile(arg)
    elif bootfile is None:
        print "Using %s as bootfile" % arg
        bootfile = _checkfile(arg)
    elif structfile is None:
        print "Using %s as structfile" % arg
        structfile = _checkfile(arg)

if hostname is None:
    hostname = config.get("Machine", "machineName")
    if hostname == "None":
        print "machineName is not defined in pacman.cfg and has not been specified"
        sys.exit(2)

if configfile is None:
    version = config.get("Machine", "version")
    if version == "None":
        print "version is not defined in pacman.cfg and config file has not been specified"
        sys.exit(2)
    configfile = _checkfile("spin{}.conf".format(version))

if bootfile is None:
    bootfile = _checkfile("scamp-130.boot")

if structfile is None:
    def __init__(self, dao, windows, main_pages,
                 vertex_in_question, real_pages):
        super(TopologicalPage, self).__init__(dao, windows,
                                              main_pages, real_pages)

        #holds all the vertexes being recorded for spikes
        self.vertex_in_question = vertex_in_question

        if self.vertex_in_question.visualiser_reset_counters:
            self.data = dict()
            self.data['t'] = self.vertex_in_question.visualiser_reset_counter_period
            self.data['p'] = self
            self.data['pt'] = None
        else:
            self.data = None


        self.placement_fudge = None
        if getattr(self.vertex_in_question,
                   "get_packet_retina_coords", None) is None:
            self.NO_BLOCKS_IN_EXPOSURE_PLOT = \
                vertex_in_question.visualiser_no_colours
            self.NO_COLOR_MAPPING_LABELS = \
                vertex_in_question.visualiser_no_colours

        self.drawing_area = None
        self.objects_to_draw = dict()
        self.max_color_value = {'r': 1, 'g': 1, 'b': 1}
        self.min_color_value = {'r': 0, 'g': 0, 'b': 0}
        number_of_neurons = (self.vertex_in_question.subvertices[0].hi_atom -
                             self.vertex_in_question.subvertices[0].lo_atom)
        if (vertex_in_question.visualiser_2d_dimensions['x'] is None or
            vertex_in_question.visualiser_2d_dimensions['y'] is None):
                self.x_dim = int(math.sqrt(number_of_neurons))
                self.y_dim = int(math.sqrt(number_of_neurons))
                vertex_in_question.visualiser_2d_dimensions = {'x': self.x_dim, 'y': self.y_dim}
        else:
            self.x_dim = vertex_in_question.visualiser_2d_dimensions['x']
            self.y_dim = vertex_in_question.visualiser_2d_dimensions['y']

        #values for tracking color increases
        self.initial_value = 0
        self.max_seen_value = 50
        self.min_seen_value = 0
        self.needs_reseting = False
        self.spikes_that_need_processing = list()
        self.drawing = False

        #holders for determining if you need to redraw
        # everything, or just a section
        self.new_entries = list()
        self.redraw_everything = True

        self.exposure_bar_mapping = dict()


        #stores a offset needed for fading
        retina_drop_off_theshold = None
        if config.getboolean("Visualiser", "retina_plot_drop_off"):
            retina_drop_off_theshold = \
                config.get("Visualiser", "retina_plot_drop_off_value_per_sec")

        self.data_stores = []

       # print self.vertex_in_question
        label = self.vertex_in_question.label
        if label == None:
            label = "Unknown"

        #set name of page
        self.page = gtk.Frame("topological plot")
        main_pages.append_page(self.page,
                               gtk.Label("Topological Page of "
                                         "{}".format(vertex_in_question.label)))
        #generate plot area
        self.generate_plot()

        #generate objects to draw
        self.generate_objects()

        #generate the rectangles that represent the retina view
        self.generate_retina_view()
Beispiel #6
0
for arg in args:
    if hostname is None:
        print "Using %s as hostname" % arg
        hostname = arg
    elif configfile is None:
        print "Using %s as configfile" % arg
        configfile = _checkfile(arg)
    elif bootfile is None:
        print "Using %s as bootfile" % arg
        bootfile = _checkfile(arg)
    elif structfile is None:
        print "Using %s as structfile" % arg
        structfile = _checkfile(arg)

if hostname is None:
    hostname = config.get("Machine", "machineName")
    if hostname == "None":
        print "machineName is not defined in pacman.cfg and has not been specified"
        sys.exit(2)

if configfile is None:
    version = config.get("Machine", "version")
    if version == "None":
        print "version is not defined in pacman.cfg and config file has not been specified"
        sys.exit(2)
    configfile = _checkfile("spin{}.conf".format(version))

if bootfile is None:
    bootfile = _checkfile("scamp-130.boot")

if structfile is None:
    def __init__(self, dao, windows, main_pages, vertex_in_question,
                 real_pages):
        super(TopologicalPage, self).__init__(dao, windows, main_pages,
                                              real_pages)

        #holds all the vertexes being recorded for spikes
        self.vertex_in_question = vertex_in_question

        if self.vertex_in_question.visualiser_reset_counters:
            self.data = dict()
            self.data[
                't'] = self.vertex_in_question.visualiser_reset_counter_period
            self.data['p'] = self
            self.data['pt'] = None
        else:
            self.data = None

        self.placement_fudge = None
        if getattr(self.vertex_in_question, "get_packet_retina_coords",
                   None) is None:
            self.NO_BLOCKS_IN_EXPOSURE_PLOT = \
                vertex_in_question.visualiser_no_colours
            self.NO_COLOR_MAPPING_LABELS = \
                vertex_in_question.visualiser_no_colours

        self.drawing_area = None
        self.objects_to_draw = dict()
        self.max_color_value = {'r': 1, 'g': 1, 'b': 1}
        self.min_color_value = {'r': 0, 'g': 0, 'b': 0}
        number_of_neurons = (self.vertex_in_question.subvertices[0].hi_atom -
                             self.vertex_in_question.subvertices[0].lo_atom)
        if (vertex_in_question.visualiser_2d_dimensions['x'] is None
                or vertex_in_question.visualiser_2d_dimensions['y'] is None):
            self.x_dim = int(math.sqrt(number_of_neurons))
            self.y_dim = int(math.sqrt(number_of_neurons))
            vertex_in_question.visualiser_2d_dimensions = {
                'x': self.x_dim,
                'y': self.y_dim
            }
        else:
            self.x_dim = vertex_in_question.visualiser_2d_dimensions['x']
            self.y_dim = vertex_in_question.visualiser_2d_dimensions['y']

        #values for tracking color increases
        self.initial_value = 0
        self.max_seen_value = 50
        self.min_seen_value = 0
        self.needs_reseting = False
        self.spikes_that_need_processing = list()
        self.drawing = False

        #holders for determining if you need to redraw
        # everything, or just a section
        self.new_entries = list()
        self.redraw_everything = True

        self.exposure_bar_mapping = dict()

        #stores a offset needed for fading
        retina_drop_off_theshold = None
        if config.getboolean("Visualiser", "retina_plot_drop_off"):
            retina_drop_off_theshold = \
                config.get("Visualiser", "retina_plot_drop_off_value_per_sec")

        self.data_stores = []

        # print self.vertex_in_question
        label = self.vertex_in_question.label
        if label == None:
            label = "Unknown"

        #set name of page
        self.page = gtk.Frame("topological plot")
        main_pages.append_page(
            self.page,
            gtk.Label("Topological Page of "
                      "{}".format(vertex_in_question.label)))
        #generate plot area
        self.generate_plot()

        #generate objects to draw
        self.generate_objects()

        #generate the rectangles that represent the retina view
        self.generate_retina_view()