Beispiel #1
0
    def _make_box(self):
        radio_box = make_radio_list([("Image Fields", (self.image_hist, per_image_fields)),
                                     ("Image Data", (self.data_hist, [])),
                                     ("Image Stars", (self.image_stars_hist, per_star_fields)),
                                     ("Star Fields", (self.star_hist, per_image_fields + per_star_fields)),
                                     ("Sky Value", (self.sky_value_hist, []))],
                                    self.radio_callback)

        self.min_spin = make_float_spinner(0, 0, 1, 0.1)
        self.max_spin = make_float_spinner(1, 0, 1, 0.1)

        self.output_box = OutputList(["N: ", "mean: ", "stddev: "])

        button = make_button("set", self.replot)

        self.bin_spin = make_integer_spinner(5, 1000)
        
        radio_box.pack_start(make_box(gtk.HBox, [self.min_spin, self.max_spin, button]), False, False, 0)
        radio_box.pack_start(self.bin_spin, False, False, 0)
        radio_box.pack_start(self.output_box.box, False, False, 0)

        
        hbox = gtk.HBox()
        hbox.pack_start(radio_box, False, False, 0)
        hbox.pack_start(self.image_box)
        return hbox
Beispiel #2
0
    def __init__(self):
        
        self.win = gtk.Window()
        self.win.connect("destroy", lambda x: gtk.main_quit())
        self.win.set_default_size(800,600)
        self.win.set_title("Gattini Data Explorer")

        plot_button = make_button("Plot", self._plot)                
        self.make_cmap_combo()
        self.make_filter_combos()
        self.make_xyc_combos(per_image_fields + per_star_fields)
        self.image_spin = make_integer_spinner(1, count("image"))
        self.star_spin = make_integer_spinner(1, count("star"))

        vsep = [gtk.VSeparator() for i in range(4)]
        [v.set_property("width-request", 1) for v in vsep]
        toolbar1 = make_box(gtk.HBox, [plot_button, vsep[0],
                                       self.xyc_box, vsep[1],
                                      self.image_spin, self.star_spin,
                                      vsep[3],
                                      self.cmap_combo])

        toolbar2 = make_box(gtk.HBox, [self.filter_box, vsep[2]])

        self.nb = gtk.Notebook()
        self.nb.set_tab_pos(gtk.POS_TOP)
        self.nb.connect("switch-page", self.change_page)

        self.tabs = []
        for tab, name in [(PlottingTab, "plot"),
                          (ImageTab, "image"),
                          (StarTab, "star"),
                          (HistTab, "hist")]:
            tab = tab(self)
            self.tabs.append(tab)
            self.nb.append_page(tab.box, tab.label)
            setattr(self, name, tab)

        box = gtk.VBox()
        box.pack_start(toolbar1, False, False, 0)
        box.pack_start(toolbar2, False, False, 0)
        box.pack_start(self.nb)
        self.win.add(box)
        self.win.show_all()