Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Clip cuts assumes data does not need to be scaled in cut levels--
# only clipped
fi.set_autocuts(AutoCuts.Clip(logger=self.logger))
bd = fi.get_bindings()
bd.enable_all(True)
fi.set_desired_size(512, 512)
iw = Viewers.GingaViewerWidget(viewer=fi)
vbox.add_widget(iw, stretch=1)
hbox = Widgets.HBox()
hbox.set_margins(4, 2, 4, 2)
wopen = Widgets.Button("Open File")
#wopen.clicked.connect(self.open_file)
wquit = Widgets.Button("Quit")
wquit.add_callback('activated', lambda *args: self.quit())
for w in (wopen, wquit):
hbox.add_widget(w, stretch=0)
hbox.add_widget(Widgets.Label(''), stretch=1)
vbox.add_widget(hbox, stretch=0)
self.top.set_widget(vbox)
self.top.set_title("Video Example Viewer")
btns = Widgets.HBox()
btns.set_border_width(4)
btns.set_spacing(3)
btn = Widgets.Button('Save')
btn.set_tooltip('Save selected image(s)')
btn.add_callback('activated', lambda w: self.save_images())
btn.set_enabled(False)
btns.add_widget(btn, stretch=0)
self.w.save = btn
btn = Widgets.Button('Close')
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
container.add_widget(btns, stretch=0)
self.gui_up = True
# Initialize directory selection dialog
self.dirsel = DirectorySelection(self.fv.w.root.get_widget())
# Generate initial listing
self.update_channels()
b.ra_angle.add_callback('activated', lambda *args: self.set_ra_angle())
b.dec_angle.set_text(str(self.axes.dec_angle))
b.dec_angle.set_tooltip('Orientation in deg of DEC labels')
b.dec_angle.add_callback(
'activated', lambda *args: self.set_dec_angle())
fr.set_widget(w)
vbox.add_widget(fr, stretch=0)
top.add_widget(sw, stretch=1)
btns = Widgets.HBox()
btns.set_spacing(3)
btn = Widgets.Button("Close")
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
top.add_widget(btns, stretch=0)
container.add_widget(top, stretch=1)
self.gui_up = True
fr.set_widget(w)
vbox.add_widget(fr, stretch=0)
spacer = Widgets.Label('')
vbox.add_widget(spacer, stretch=1)
top.add_widget(sw, stretch=1)
btns = Widgets.HBox()
btns.set_spacing(3)
btn = Widgets.Button("Close")
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
top.add_widget(btns, stretch=0)
container.add_widget(top, stretch=1)
self.w.frch = lbl
fr.set_widget(lbl)
vbox.add_widget(fr, stretch=0)
# stretch
vbox.add_widget(Widgets.Label(''), stretch=1)
btns = Widgets.HBox()
btns.set_spacing(4)
btns.set_border_width(4)
btn = Widgets.Button("Close")
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
vbox.add_widget(btns)
container.add_widget(vbox, stretch=1)
self.gui_up = True
fmap = self.get_channel_frame_mapping()
self.update_chinfo(fmap)
vbox2.set_border_width(4)
vbox2.add_widget(w)
vbox2.add_widget(w2)
fr.set_widget(vbox2, stretch=0)
vbox.add_widget(fr, stretch=0)
container.add_widget(vbox, stretch=1)
btns = Widgets.HBox()
btns.set_spacing(3)
btn = Widgets.Button('Close')
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
container.add_widget(btns, stretch=0)
self.gui_up = True
index = self.formats.index(self.format)
combobox.set_index(index)
combobox.add_callback('activated', lambda w, idx: self.set_format())
fr.set_widget(w)
vbox.add_widget(fr, stretch=0)
spacer = Widgets.Label('')
vbox.add_widget(spacer, stretch=1)
top.add_widget(sw, stretch=1)
btns = Widgets.HBox()
btns.set_spacing(3)
btn = Widgets.Button("Close")
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
top.add_widget(btns, stretch=0)
container.add_widget(top, stretch=1)
b.show.set_tooltip('Show masks')
b.show.add_callback('activated', lambda w: self.redo())
b.hide.set_tooltip('Hide masks')
b.hide.add_callback('activated', lambda w: self.clear_mask())
b.forget.set_tooltip('Forget masks')
b.forget.add_callback('activated', lambda w: self.forget_masks())
container.add_widget(w, stretch=0)
btns = Widgets.HBox()
btns.set_border_width(4)
btns.set_spacing(3)
btn = Widgets.Button('Close')
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
container.add_widget(btns, stretch=0)
self.gui_up = True
# Initialize mask file selection dialog
self.mfilesel = FileSelection(self.fv.w.root.get_widget(),
all_at_once=True)
# Populate table
# Pick field evaluation status
hbox = Widgets.HBox()
hbox.set_spacing(4)
hbox.set_border_width(4)
label = Widgets.Label()
#label.set_alignment(0.05, 0.5)
self.w.eval_status = label
hbox.add_widget(self.w.eval_status, stretch=0)
hbox.add_widget(Widgets.Label(''), stretch=1)
vbox1.add_widget(hbox, stretch=0)
# Pick field evaluation progress bar and stop button
hbox = Widgets.HBox()
hbox.set_spacing(4)
hbox.set_border_width(4)
btn = Widgets.Button("Stop")
btn.add_callback('activated', lambda w: self.eval_intr())
btn.set_enabled(False)
self.w.btn_intr_eval = btn
hbox.add_widget(btn, stretch=0)
self.w.eval_pgs = Widgets.ProgressBar()
hbox.add_widget(self.w.eval_pgs, stretch=1)
vbox1.add_widget(hbox, stretch=0)
nb.add_widget(vbox1, title="Readout")
# Build settings panel
captions = (('Show Candidates', 'checkbutton'),
("Draw type:", 'label', 'xlbl_drawtype', 'label',
"Draw type", 'combobox'),
('Radius:', 'label', 'xlbl_radius', 'label',
fr.set_widget(w)
vbox.add_widget(fr, stretch=0)
spacer = Widgets.Label('')
vbox.add_widget(spacer, stretch=1)
top.add_widget(sw, stretch=1)
btns = Widgets.HBox()
btns.set_spacing(3)
btn = Widgets.Button("Close")
btn.add_callback('activated', lambda w: self.close())
btns.add_widget(btn, stretch=0)
btn = Widgets.Button("Help")
btn.add_callback('activated', lambda w: self.help())
btns.add_widget(btn, stretch=0)
btns.add_widget(Widgets.Label(''), stretch=1)
top.add_widget(btns, stretch=0)
container.add_widget(top, stretch=1)
self.gui_up = True
self._reset_channels_gui()