예제 #1
0
    def __init__(self, doc, running, spectrometer):
        super().__init__(doc, running, spectrometer)
        self.title = 'Measurement'

        self.BG = None
        self.A = None
        self.B = None
        self.AB = None
        self.GD = None
        self.gdaxis = None
        self.w = None
        self.FFT = None

        self.currentlyBG = False
        self.currentlyA = False
        self.currentlyB = False
        self.currentlyAB = False
        self.currentlygd = False

        self.replot = True

        self.counter = 0
        self.limitspectra = 100

        # extra line plots
        self.linePlot.line(legend='Background', line_color='grey')
        self.linePlot.line(legend='A', line_color='blue')
        self.linePlot.line(legend='B', line_color='green')
        self.linePlot.line(legend='A+B', line_color='black')

        self.linePlot2 = bph.plot_2d()
        self.linePlot2.line(legend='GD', line_color='red')
        self.linePlot3 = bph.plot_2d()
        self.linePlot3.line(legend='FFT', line_color='red')

        self.BGBtn = bokeh.models.widgets.Toggle(label='Background')
        self.ABtn = bokeh.models.widgets.Toggle(label='A')
        self.BBtn = bokeh.models.widgets.Toggle(label='B')
        self.ABBtn = bokeh.models.widgets.Toggle(label='A+B')

        self.saveNameInput = bokeh.models.widgets.TextInput(
            title='Save Filename', value='Name')

        # arrange items
        self.inputs = bokeh.layouts.Column(self.startBtn,
                                           self.integrationInput, self.BGBtn,
                                           self.ABtn, self.BBtn, self.ABBtn,
                                           self.saveBtn, self.saveNameInput)
        self.layout = bokeh.layouts.row(
            self.inputs,
            bokeh.layouts.column(self.linePlot.element, self.linePlot2.element,
                                 self.linePlot3.element),
            width=800)
예제 #2
0
    def __init__(self, doc, running, lockin_digitizer, delayer, logbook=None):
        super().__init__(doc, running, lockin_digitizer, delayer)
        self.title = 'Measurement'
        self.logbook = logbook

        # measurement source and line plot
        self.linePlot = bph.plot_2d()
        self.linePlot.line(legend='Current 2', line_color='red')
        self.linePlot.line(legend='Current 5', line_color='blue')

        self.linePlotMean = bph.plot_2d()
        self.linePlotMean.line(legend='Current 2', line_color='red')
        self.linePlotMean.line(legend='Current 5', line_color='blue')

        # save button
        self.saveBtn = bokeh.models.widgets.Button(
            label='Save Spectrum', button_type='success')
        self.saveBtn.on_click(self.save_spectrum)
        self.saveNameInput = bokeh.models.widgets.TextInput(
            title='Legend Name', value='Name')

        # scan table button
        self.scanTableBtn = bokeh.models.widgets.Toggle(label='Scan Table')

        # measurement inputs
        self.zeroDelInput = bokeh.models.widgets.TextInput(
            title='Zero Delay [um]', value='50.')
        self.startDelInput = bokeh.models.widgets.TextInput(
            title='Start Delay [fs]', value='-10.')
        self.stopDelInput = bokeh.models.widgets.TextInput(
            title='Stop Delay [fs]', value='10.')
        self.stepSizeInput = bokeh.models.widgets.TextInput(
            title='Step Size [fs]', value='0.5')
        self.comment = bokeh.models.widgets.TextAreaInput(
            title='Comment', value='', rows=10)

        # reclaim piezo button
        self.reclaimPiezoBtn = bokeh.models.widgets.Button(
            label='Reclaim Piezo', button_type='success')
        self.reclaimPiezoBtn.on_click(self.reclaimPiezo)

        # arrange items
        self.inputs = bokeh.layouts.widgetbox(
            self.startBtn, self.timeconstantInput, self.orderInput,
            self.integrationInput, self.zeroDelInput, self.startDelInput,
            self.stopDelInput, self.stepSizeInput, self.saveBtn,
            self.saveNameInput, self.scanTableBtn, self.comment,
            self.reclaimPiezoBtn)
        self.layout = bokeh.layouts.row(
            self.inputs,
            bokeh.layouts.column(
                self.linePlot.element, self.linePlotMean.element))
예제 #3
0
    def __init__(self, doc, running, tof_digitizer, delayer):
        self.title = 'Alignment'
        self.spectrum_length = tof_digitizer.range
        self.spectrum = []

        # measurement thread
        self.measurement = None
        # bokeh doc for callback
        self.doc = doc
        # digitizer card
        self.tof_digitizer = tof_digitizer
        # global measurement running indicator
        self.running = running
        # delay piezo
        self.delayer = delayer

        # for continuous mode
        self.subtractsweeps = 0
        self.subtractstarts = 0
        self.subtractruntime = 0
        self.subtractspectrum = 0
        self.lastspectrum = 0

        # Set up widgets
        self.startBtn = bokeh.models.widgets.Button(label='Start',
                                                    button_type='success')
        self.integrationInput = bokeh.models.widgets.TextInput(
            title='Integration time [ksweeps]', value='6')
        self.piezoPos = bokeh.models.widgets.TextInput(
            title='Piezo Position [um]', value='1.0')

        # spectrum plot
        self.linePlot = bph.plot_2d()
        self.linePlot.line(legend='Current')

        # save button
        self.saveBtn = bokeh.models.widgets.Button(label='Save Spectrum',
                                                   button_type='success')
        self.saveBtn.on_click(self.save_spectrum)
        self.saveNameInput = bokeh.models.widgets.TextInput(
            title='Legend Name', value='Name')

        # arrange layout
        self.inputs = bokeh.layouts.widgetbox(self.startBtn,
                                              self.integrationInput,
                                              self.saveBtn, self.saveNameInput,
                                              self.piezoPos)
        self.layout = bokeh.layouts.row(self.inputs,
                                        self.linePlot.element,
                                        width=800)

        # start thread callback
        self.startBtn.on_click(self.start)
예제 #4
0
    def __init__(self, doc, sensor, running, roi):
        super().__init__(doc, sensor, running, roi)
        # spectrum source and line plot instead of image plot
        self.linePlot = bph.plot_2d()
        self.linePlot.line(legend='Spectrum')

        # save button
        self.saveBtn = bokeh.models.widgets.Button(label='Save Spectrum',
                                                   button_type='success')
        self.saveBtn.on_click(partial(self.save_spectrum))
        self.saveNameInput = bokeh.models.widgets.TextInput(
            title='Legend Name', value='Name')
        # arrange items
        self.inputs = bokeh.layouts.widgetbox(self.startBtn,
                                              self.integrationInput,
                                              self.saveBtn, self.saveNameInput)
        self.layout = bokeh.layouts.row(self.inputs,
                                        self.linePlot.element,
                                        width=800)
예제 #5
0
    def __init__(self, doc, running, spectrometer):
        self.title = 'Alignment'
        self.lastrefresh = 0

        # measurement thread
        self.cont_readout = None
        # bokeh doc for callback
        self.doc = doc
        # digitizer card
        self.spectrometer = spectrometer
        # global measurement running indicator
        self.running = running
        # autoscale variable

        # Set up widgets
        self.startBtn = bokeh.models.widgets.Button(label='Start',
                                                    button_type='success',
                                                    disabled=False)
        self.integrationInput = bokeh.models.widgets.TextInput(
            title='Integration time [msec]', value='13')

        self.linePlot = bph.plot_2d()
        self.linePlot.line(legend='Current', line_color='red')

        # save button
        self.saveBtn = bokeh.models.widgets.Button(label='Save Spectrum',
                                                   button_type='success',
                                                   disabled=False)
        self.saveBtn.on_click(self.save_spectrum)
        self.saveNameInput = bokeh.models.widgets.TextInput(
            title='Legend Name', value='Name')

        # arrange layout
        self.inputs = bokeh.layouts.Column(self.startBtn,
                                           self.integrationInput, self.saveBtn,
                                           self.saveNameInput)
        self.layout = bokeh.layouts.row(self.inputs,
                                        self.linePlot.element,
                                        width=800)

        # start thread callback
        self.startBtn.on_click(self.start)