コード例 #1
0
def main():  # test version of the GUI_base and animation
    # test dictionary for settings
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'keithley_2000': res_settings['keithley_2000'],
        'keithley_2400': res_settings['keithley_2400'],
        'gaussmeter': res_settings['gaussmeter'],
        'sig_gen_8257': res_settings['sig_gen_8257'],
    }

    graph_dict = {
        # i.e. AHE Measurement (should be the measurement type)
        "gui_title": 'TEST GUI',
        "graph_title": "Graph Title",  # Resistance vs. Hx
        "x_title": "X Axis",  # i.e. Applied Field (Oe)
        "y_title": "Y Axis",  # i.e. Hall Resistance (Ohm)
        "x2_title":
        "",  # for gaussmeter readings, leave blank if no gaussmeter used
        "fixed_param_1": "Fixed 1 (Oe)",  # i.e. Hx 100 (Oe)
        "fixed_param_2": "Fixed 2 (mA)"  # i.e. Current 1.9 (mA)
    }
    """
    This dictionary offers the user specific yet flexible control of the measurement loop.  The measurement loop
    is comprised of three nested for loops that each call a unique function defined at the beginning of this file.
    In psuedo code:
    for fix1 loop:
        fixed1func()
        for fix2 loop:
            fixed2func()
            for meas y loop():
                measy()
    The GUIBase and Measurement method automatically manage array creation, save functions, GUI commands, graphing
    and resource control/release.  In the loop command dictionary the user passes the name of three functions that run
    for each section, which should be defined at the top of this file.  They are imported from the path and with the module name.
    Finally the loop arrays will be built using the values associated with the start, stop, step keys for each loop.
    As an example, if 'fix1_stop': 'hx stop' is a key,value pair, the instance of the measurement class will look for the
    value given by kwarg['hx stop'] and set that as the np.array(,stop,) value.
    """
    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'Sample_Measurement',
        'fix1_start': 'hx start',
        'fix1_stop': 'hx stop',
        'fix1_step': 'hx step',
        'fix2_start': 'current start',
        'fix2_stop': 'current stop',
        'fix2_step': 'current step',
        'x_start': 'hz start',
        'x_stop': 'hz stop',
        'x_step': 'hz step',
        'MOKE': False
    }
    """
    The following dictionaries are passed in as *args, meaning there can be a variable number.  The key,value combos
    for each individual dictionary are autogenerated in the GUIBaseClass and the value becomes a corresponding tkinter widgit.
    These key,value combos are then passed to the measurement class when the measure button is pressed (note that values are passed
    as value.get()).  The arrays generated for the three measurement for loops are set by the loop commands dictionary above.
    """

    controls_dict1 = {
        "title": "Magnet Controls",
        "hx start": 0,
        "hx stop": 2,
        "hx step": 1,
        "hz start": -100,
        "hz stop": 100,
        "hz step": 1,
        "averages": 1
    }

    controls_dict2 = {
        "title": "Current Controls",
        "current start": 1,
        "current stop": 2,
        "current step": 0.5
    }

    lockin_controls = {
        "title": "Lockin",
        "Sensitivity": '10uV',
        "Mode": '1st',
        "Frequency": 100,
        "Signal": 1,
        'Hx Dac': mag_settings['Hx Dac'],
        'Hz Dac': mag_settings['Hz Dac'],
        'Hx Conversion': mag_settings['Hx Conversion'],
        'Hz Conversion': mag_settings['Hz Conversion'],
        'Hx Max': mag_settings['Hx Max'],
        'Hz Max': mag_settings['Hz Max']
    }
    """
    Below are the three lines of code that create an instance of the GUIBase, animation function
    and then start the GUIBase.
    """

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, controls_dict2, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()
コード例 #2
0
def main():  # test version of the GUI_base and animation
    # test dictionary for settings
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'keithley_2000': res_settings['keithley_2000'],
        'keithley_2400': res_settings['keithley_2400'],
        'gaussmeter': res_settings['gaussmeter'],
    }

    graph_dict = {
        # i.e. AHE Measurement (should be the measurement type)
        "gui_title": 'SOT_Current_Switching_MOKE',
        # Resistance vs. Hx
        "graph_title": "Realtime MOKE Signal vs. Current (mA)",
        "x_title": "Pulse Current (mA)",  # i.e. Applied Field (Oe)
        "y_title": "MOKE Signal (rgb)",  # i.e. Hall Resistance (Ohm)
        # for gaussmeter readings, leave blank if no gaussmeter used
        "x2_title": "Gaussmeter (Oe)",
        "fixed_param_1": "Hx Field (Oe)",  # i.e. Hx 100 (Oe)
        "fixed_param_2": "Pulse Width (s)"  # i.e. Current 1.9 (mA)
    }

    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'SOT_Current_Switching_MOKE',
        'fix1_start': 'hx start',
        'fix1_stop': 'hx stop',
        'fix1_step': 'hx step',
        'fix2_start': 'pulse width start',
        'fix2_stop': 'pulse width stop',
        'fix2_step': 'pulse width step',
        'x_start': 'current start',
        'x_stop': 'current stop',
        'x_step': 'current step',
        'MOKE': True
    }

    controls_dict1 = {
        "title": "Magnet Controls",
        "hx start": 0,
        "hx stop": 0,
        "hx step": 0,
    }

    controls_dict2 = {
        "title": "Current Controls",
        "current start": -6.0,
        "current stop": 6.0,
        "current step": 0.5,
        "pulse width start": 0.05,
        "pulse width end": 0.05,
        "pulse width step": 0,
        "sensing current": 0.5,
        "write-read delay": 0.1,  # delay between write and read
        # how long after read current sourced is read voltage measured
        "read pulse width": 0.05,
    }

    lockin_controls = {
        "title": "Lockin",
        'Hx Dac': mag_settings['Hx DAC'],
        'Hz Dac': mag_settings['Hz DAC'],
        'Hx Conversion': mag_settings['Hx Conversion'],
        'Hz Conversion': mag_settings['Hz Conversion'],
        'Hx Max': mag_settings['Hx Max'],
        'Hz Max': mag_settings['Hz Max']
    }

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, controls_dict2, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()
コード例 #3
0
def main():
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'sig_gen_8257': res_settings['sig_gen_8257'],
    }

    graph_dict = {
        "gui_title": 'ST-FMR',
        "graph_title": "Graph Title",
        "x_title": "Applied Field",
        "y_title": "Lockin Voltage",
        "x2_title": "",
        "fixed_param_1": "Power (dBm)",
        "fixed_param_2": "Frequency (Ghz)"
    }

    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'ST_FMR',
        'fix1_start': 'power start',
        'fix1_stop': 'power stop',
        'fix1_step': 'power step',
        'fix2_start': 'frequency start',
        'fix2_stop': 'frequency stop',
        'fix2_step': 'frequency step',
        'x_start': 'hx start',
        'x_stop': 'hx stop',
        'x_step': 'hx step',
        'MOKE': False
    }

    controls_dict1 = {
        "title": "Magnet Controls",
        "hx start": 1000,
        "hx stop": -1000,
        "hx step": -5,
    }

    controls_dict2 = {
        "title": "Signal Generator Controls",
        "power start": 25,
        "power stop": 25,
        "power step": 0,
        "frequency start": 6,
        "frequency stop": 6,
        "frequency step": 0,
        "modulation frequency": 500,
        "signal voltage": 0.7
    }

    lockin_controls = {
        "title": "Lockin",
        "Sensitivity": '10uV',
        "averages": 10,
        'Hx Dac': mag_settings['Hx Dac'],
        'Hx Conversion': mag_settings['Hx Conversion'],
        'Hx Max': mag_settings['Hx Max'],
    }

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, controls_dict2, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()
コード例 #4
0
def main():  # test version of the GUI_base and animation
    # test dictionary for settings
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'keithley_2000': res_settings['keithley_2000'],
        'keithley_2400': res_settings['keithley_2400'],
        'gaussmeter': res_settings['gaussmeter'],
    }

    graph_dict = {
        # i.e. AHE Measurement (should be the measurement type)
        "gui_title": 'AHE Measurement',
        "graph_title": "Resistance (Ohm) vs Hz (Oe)",  # Resistance vs. Hx
        "x_title": "Applied Field (Oe)",  # i.e. Applied Field (Oe)
        "y_title": "Realtime Resistance (Ohm)",  # i.e. Hall Resistance (Ohm)
        # for gaussmeter readings, leave blank if no gaussmeter used
        "x2_title": "Gaussmeter (Oe)",
        "fixed_param_1": "Hx Field (Oe)",  # i.e. Hx 100 (Oe)
        "fixed_param_2": "Current (mA)"  # i.e. Current 1.9 (mA)
    }

    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'AHE',
        'fix1_start': 'hx start',
        'fix1_stop': 'hx stop',
        'fix1_step': 'hx step',
        'fix2_start': 'current start',
        'fix2_stop': 'current stop',
        'fix2_step': 'current step',
        'x_start': 'hz start',
        'x_stop': 'hz stop',
        'x_step': 'hz step',
        'MOKE': False
    }
    """
    The following dictionaries are passed in as *args, meaning there can be a variable number.  The key,value combos
    for each individual dictionary are autogenerated in the GUIBaseClass and the value becomes a corresponding tkinter widgit.
    These key,value combos are then passed to the measurement class when the measure button is pressed (note that values are passed
    as value.get()).  The arrays generated for the three measurement for loops are set by the loop commands dictionary above.
    """

    controls_dict1 = {
        "title": "Magnet Controls",
        "hx start": 0,
        "hx stop": 0,
        "hx step": 0,
        "hz start": -100,
        "hz stop": 100,
        "hz step": 5,
    }

    controls_dict2 = {
        "title": "Current Controls",
        "current start": -1.9,
        "current stop": 1.9,
        "current step": 0,
        'averages': 1
    }

    lockin_controls = {
        "title": "Lockin",
        'Hx Dac': mag_settings['Hx Dac'],
        'Hz Dac': mag_settings['Hz Dac'],
        'Hx Conversion': mag_settings['Hx Conversion'],
        'Hz Conversion': mag_settings['Hz Conversion'],
        'Hx Max': mag_settings['Hx Max'],
        'Hz Max': mag_settings['Hz Max']
    }
    """
    Below are the three lines of code that create an instance of the GUIBase, animation function
    and then start the GUIBase.
    """

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, controls_dict2, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()
コード例 #5
0
def main():
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'keithley_2000': res_settings['keithley_2000'],
        'keithley_2400': res_settings['keithley_2400'],
        'gaussmeter': res_settings['gaussmeter'],
    }

    graph_dict = {
        "gui_title": 'USMR_Current_Switching',
        "graph_title": "Avg. Abs. Resistance (Ohm) vs. Current (mA)",
        "x_title": "Pulse Current (mA)",
        "y_title": "Resistance (Ohm)",
        "x2_title": "Gaussmeter (Oe)",
        "fixed_param_1": "Hx Field (Oe)",
        "fixed_param_2": "Pulse Width (s)"
    }

    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'SOT_Current_Switching',
        'fix1_start': 'hx start',
        'fix1_stop': 'hx stop',
        'fix1_step': 'hx step',
        'fix2_start': 'pulse width start',
        'fix2_stop': 'pulse width stop',
        'fix2_step': 'pulse width step',
        'x_start': 'current start',
        'x_stop': 'current stop',
        'x_step': 'current step',
        'MOKE': False
    }

    controls_dict1 = {
        "title": "Magnet Controls",
        "hx start": 0,
        "hx stop": 0,
        "hx step": 0,
    }

    controls_dict2 = {
        "title": "Current Controls",
        "current start": -6.0,
        "current stop": 6.0,
        "current step": 0.5,
        "pulse width start": 0.05,
        "pulse width end": 0.05,
        "pulse width step": 0,
        "sensing current": 0.5,
        "write-read delay": 0.1,  # delay between write and read
        # how long after read current sourced is read voltage measured
        "read pulse width": 0.05,
        "averages": 1
    }

    lockin_controls = {
        "title": "Lockin",
        'Hx Dac': mag_settings['Hx Dac'],
        'Hz Dac': mag_settings['Hz Dac'],
        'Hx Conversion': mag_settings['Hx Conversion'],
        'Hz Conversion': mag_settings['Hz Conversion'],
        'Hx Max': mag_settings['Hx Max'],
        'Hz Max': mag_settings['Hz Max']
    }

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, controls_dict2, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()
コード例 #6
0
def main():  # test version of the GUI_base and animation
    # test dictionary for settings
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'keithley_2000': res_settings['keithley_2000'],
        'keithley_2400': res_settings['keithley_2400'],
    }

    graph_dict = {
        # i.e. AHE Measurement (should be the measurement type)
        "gui_title": 'Hz-MOKE',
        "graph_title":
        "Realtime MOKE Signal vs. Applied Field",  # Resistance vs. Hx
        "x_title": "Applied Field (Oe)",  # i.e. Applied Field (Oe)
        "y_title": "MOKE Signal (rbg)",  # i.e. Hall Resistance (Ohm)
        "x2_title":
        "",  # for gaussmeter readings, leave blank if no gaussmeter used
        "fixed_param_1": "",  # i.e. Hx 100 (Oe)
        "fixed_param_2": ""  # i.e. Current 1.9 (mA)
    }

    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'Hz_MOKE',
        'x_start': 'hz start',
        'x_stop': 'hz stop',
        'x_step': 'hz step',
        'MOKE': True
    }

    controls_dict1 = {
        "title": "Magnet Controls",
        "hz start": -100,
        "hz stop": 100,
        "hz step": 5,
    }

    lockin_controls = {
        "title": "Lockin",
        'Hz Dac': mag_settings['Hz Dac'],
        'Hz Conversion': mag_settings['Hz Conversion'],
        'Hz Max': mag_settings['Hz Max']
    }

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()
コード例 #7
0
def main():
    resource_dict = {
        'dsp_lockin': res_settings['dsp_lockin'],
        'keithley_2000': res_settings['keithley_2000'],
        'keithley_2400': res_settings['keithley_2400'],
        'gaussmeter': res_settings['gaussmeter'],
    }

    graph_dict = {
        # i.e. AHE Measurement (should be the measurement type)
        "gui_title": 'USMR Measurement',
        # Resistance vs. Hx
        "graph_title": "Avg Abs Resistance (Ohm) vs Hx (Oe)",
        "x_title": "Applied Field (Oe)",  # i.e. Applied Field (Oe)
        # i.e. Hall Resistance (Ohm)
        "y_title": "Realtime Avg Resistance (Ohm)",
        # for gaussmeter readings, leave blank if no gaussmeter used
        "x2_title": "Gaussmeter (Oe)",
        "fixed_param_1": "Hz (Oe)",  # i.e. Hx 100 (Oe)
        "fixed_param_2": "Current (mA)"  # i.e. Current 1.9 (mA)
    }

    loop_commands = {
        'fixed_func_1': 'fix_param1',  # name of fixed parameter one function
        'fixed_func_2': 'fix_param2',
        'measure_y_func': 'measure_y',
        # directory from which the preceeding modules will be imported from
        'module_path': os.getcwd(),
        # name of the file to get the functions from
        'module_name': 'USMR',
        'fix1_start': 'hz start',
        'fix1_stop': 'hz stop',
        'fix1_step': 'hz step',
        'fix2_start': 'current start',
        'fix2_stop': 'current stop',
        'fix2_step': 'current step',
        'x_start': 'hx start',
        'x_stop': 'hx stop',
        'x_step': 'hx step',
        'MOKE': False
    }

    controls_dict1 = {
        "title": "Magnet Controls",
        "hx start": -100,
        "hx stop": 100,
        "hx step": 5,
        "hz start": 0,
        "hz stop": 0,
        "hz step": 0,
    }

    controls_dict2 = {
        "title": "Keithley 2400",
        "current start": 0,
        "current stop": 0.5,
        "current step": 0,
        "read delay": 0.4,
        "averages": 1
    }

    lockin_controls = {
        "title": "Lockin",
        'Hx Dac': mag_settings['Hx Dac'],
        'Hz Dac': mag_settings['Hz Dac'],
        'Hx Conversion': mag_settings['Hx Conversion'],
        'Hz Conversion': mag_settings['Hz Conversion'],
        'Hx Max': mag_settings['Hx Max'],
        'Hz Max': mag_settings['Hz Max']
    }

    measurement_gui = GUIBase(graph_dict, resource_dict, loop_commands,
                              controls_dict1, controls_dict2, lockin_controls)
    ani = animation.FuncAnimation(measurement_gui.fig,
                                  animate_plot,
                                  interval=200,
                                  fargs=[
                                      measurement_gui.ax,
                                      measurement_gui.graph,
                                      measurement_gui.results,
                                      measurement_gui.progress_bar,
                                      measurement_gui.time_var
                                  ])
    measurement_gui.mainloop()