diff --git a/docs/examples/driver_examples/Qcodes example with Alazar 9360.ipynb b/docs/examples/driver_examples/Qcodes example with Alazar 9360.ipynb new file mode 100644 index 000000000000..d0a023aae1d7 --- /dev/null +++ b/docs/examples/driver_examples/Qcodes example with Alazar 9360.ipynb @@ -0,0 +1,1618 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Qcodes example with Alazar ATS 9360" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "# import all necessary things\n", + "%matplotlib nbagg\n", + "\n", + "import qcodes as qc\n", + "import qcodes.instrument.parameter as parameter\n", + "import qcodes.instrument_drivers.AlazarTech.ATS9360 as ATSdriver\n", + "import qcodes.instrument_drivers.AlazarTech.ATS_acquisition_controllers as ats_contr" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{'bits_per_sample': 12,\n", + " 'board_id': 1,\n", + " 'board_kind': 'ATS9360',\n", + " 'max_samples': 4294967294,\n", + " 'system_id': 1}]" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Command to list all alazar boards connected to the system\n", + "ATSdriver.AlazarTech_ATS.find_boards()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'CPLD_version': '25.16',\n", + " 'SDK_version': '6.0.0',\n", + " 'asopc_type': '1779729248',\n", + " 'bits_per_sample': 12,\n", + " 'driver_version': '6.0.0',\n", + " 'firmware': None,\n", + " 'latest_cal_date': '25-01-17',\n", + " 'max_samples': 4294967294,\n", + " 'memory_size': '4294967294',\n", + " 'model': 'ATS9360',\n", + " 'pcie_link_speed': '0.5GB/s',\n", + " 'pcie_link_width': '8',\n", + " 'serial': '970396',\n", + " 'vendor': 'AlazarTech'}" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Create the ATS9870 instrument on the new server \"alazar_server\"\n", + "ats_inst = ATSdriver.AlazarTech_ATS9360(name='Alazar1')\n", + "# Print all information about this Alazar card\n", + "ats_inst.get_idn()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# Instantiate an acquisition controller (In this case we are doing a simple DFT) on the same server (\"alazar_server\") and \n", + "# provide the name of the name of the alazar card that this controller should control\n", + "acquisition_controller = ats_contr.Demodulation_AcquisitionController(name='acquisition_controller', \n", + " demodulation_frequency=10e6, \n", + " alazar_name='Alazar1')" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "# Configure all settings in the Alazar card\n", + "ats_inst.config(clock_source='INTERNAL_CLOCK',\n", + " sample_rate=1_000_000_000,\n", + " clock_edge='CLOCK_EDGE_RISING',\n", + " decimation=1,\n", + " coupling=['DC','DC'],\n", + " channel_range=[.4,.4],\n", + " impedance=[50,50],\n", + " trigger_operation='TRIG_ENGINE_OP_J',\n", + " trigger_engine1='TRIG_ENGINE_J',\n", + " trigger_source1='EXTERNAL',\n", + " trigger_slope1='TRIG_SLOPE_POSITIVE',\n", + " trigger_level1=160,\n", + " trigger_engine2='TRIG_ENGINE_K',\n", + " trigger_source2='DISABLE',\n", + " trigger_slope2='TRIG_SLOPE_POSITIVE',\n", + " trigger_level2=128,\n", + " external_trigger_coupling='DC',\n", + " external_trigger_range='ETR_2V5',\n", + " trigger_delay=0,\n", + " timeout_ticks=0,\n", + " aux_io_mode='AUX_IN_AUXILIARY', # AUX_IN_TRIGGER_ENABLE for seq mode on\n", + " aux_io_param='NONE' # TRIG_SLOPE_POSITIVE for seq mode on\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# This command is specific to this acquisition controller. The kwargs provided here are being forwarded to ats_inst.acquire\n", + "# This way, it becomes easy to change acquisition specific settings from the ipython notebook\n", + "acquisition_controller.update_acquisitionkwargs(#mode='NPT',\n", + " samples_per_record=1024,\n", + " records_per_buffer=70,\n", + " buffers_per_acquisition=1,\n", + " #channel_selection='AB',\n", + " #transfer_offset=0,\n", + " #external_startcapture='ENABLED',\n", + " #enable_record_headers='DISABLED',\n", + " #alloc_buffers='DISABLED',\n", + " #fifo_only_streaming='DISABLED',\n", + " #interleave_samples='DISABLED',\n", + " #get_processed_data='DISABLED',\n", + " allocated_buffers=1,\n", + " #buffer_timeout=1000\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.502616118642945" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Getting the value of the parameter 'acquisition' of the instrument 'acquisition_controller' performes the entire acquisition \n", + "# protocol. This again depends on the specific implementation of the acquisition controller\n", + "acquisition_controller.acquisition()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'functions': {},\n", + " 'name': 'Alazar1',\n", + " 'parameters': {'IDN': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", + " 'full_name': 'Alazar1_IDN',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'IDN',\n", + " 'name': 'IDN',\n", + " 'post_delay': 0,\n", + " 'raw_value': None,\n", + " 'ts': None,\n", + " 'unit': '',\n", + " 'vals': '',\n", + " 'value': None},\n", + " 'alloc_buffers': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_alloc_buffers',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Alloc Buffers',\n", + " 'name': 'alloc_buffers',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DISABLED',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DISABLED'},\n", + " 'allocated_buffers': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_allocated_buffers',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Allocated Buffers',\n", + " 'name': 'allocated_buffers',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '=0>',\n", + " 'value': 1},\n", + " 'aux_io_mode': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_aux_io_mode',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'AUX I/O Mode',\n", + " 'name': 'aux_io_mode',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'AUX_IN_AUXILIARY',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'AUX_IN_AUXILIARY'},\n", + " 'aux_io_param': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_aux_io_param',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'aux_io_param',\n", + " 'name': 'aux_io_param',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'NONE',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'NONE'},\n", + " 'buffer_timeout': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_buffer_timeout',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Buffer Timeout',\n", + " 'name': 'buffer_timeout',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1000,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'ms',\n", + " 'vals': '=0>',\n", + " 'value': 1000},\n", + " 'buffers_per_acquisition': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_buffers_per_acquisition',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Buffers per Acquisition',\n", + " 'name': 'buffers_per_acquisition',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '=0>',\n", + " 'value': 1},\n", + " 'channel_range1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_channel_range1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Range channel 1',\n", + " 'name': 'channel_range1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 0.4,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'V',\n", + " 'vals': '',\n", + " 'value': 0.4},\n", + " 'channel_range2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_channel_range2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Range channel 2',\n", + " 'name': 'channel_range2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 0.4,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'V',\n", + " 'vals': '',\n", + " 'value': 0.4},\n", + " 'channel_selection': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_channel_selection',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Channel Selection',\n", + " 'name': 'channel_selection',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'AB',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'AB'},\n", + " 'clock_edge': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_clock_edge',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Clock Edge',\n", + " 'name': 'clock_edge',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'CLOCK_EDGE_RISING',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'CLOCK_EDGE_RISING'},\n", + " 'clock_source': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_clock_source',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Clock Source',\n", + " 'name': 'clock_source',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'INTERNAL_CLOCK',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'INTERNAL_CLOCK'},\n", + " 'coupling1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_coupling1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Coupling channel 1',\n", + " 'name': 'coupling1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DC',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DC'},\n", + " 'coupling2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_coupling2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Coupling channel 2',\n", + " 'name': 'coupling2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DC',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DC'},\n", + " 'decimation': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_decimation',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Decimation',\n", + " 'name': 'decimation',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '',\n", + " 'value': 1},\n", + " 'effective_sample_rate': {'__class__': 'qcodes.instrument_drivers.AlazarTech.acquisition_parameters.EffectiveSampleRateParameter',\n", + " 'full_name': 'Alazar1_effective_sample_rate',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'effective_sample_rate',\n", + " 'name': 'effective_sample_rate',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1000000000.0,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'Hz',\n", + " 'value': 1000000000.0},\n", + " 'enable_record_headers': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_enable_record_headers',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Enable Record Headers',\n", + " 'name': 'enable_record_headers',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DISABLED',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DISABLED'},\n", + " 'external_sample_rate': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_external_sample_rate',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'External Sample Rate',\n", + " 'name': 'external_sample_rate',\n", + " 'post_delay': 0,\n", + " 'raw_value': 500000000,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'S/s',\n", + " 'vals': '',\n", + " 'value': 500000000},\n", + " 'external_startcapture': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_external_startcapture',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'External Startcapture',\n", + " 'name': 'external_startcapture',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'ENABLED',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'ENABLED'},\n", + " 'external_trigger_coupling': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_external_trigger_coupling',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'External Trigger Coupling',\n", + " 'name': 'external_trigger_coupling',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DC',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DC'},\n", + " 'external_trigger_range': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_external_trigger_range',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'External Trigger Range',\n", + " 'name': 'external_trigger_range',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'ETR_2V5',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'ETR_2V5'},\n", + " 'fifo_only_streaming': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_fifo_only_streaming',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Fifo Only Streaming',\n", + " 'name': 'fifo_only_streaming',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DISABLED',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DISABLED'},\n", + " 'get_processed_data': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_get_processed_data',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Get Processed Data',\n", + " 'name': 'get_processed_data',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DISABLED',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DISABLED'},\n", + " 'impedance1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_impedance1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Impedance channel 1',\n", + " 'name': 'impedance1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 50,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'Ohm',\n", + " 'vals': '',\n", + " 'value': 50},\n", + " 'impedance2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_impedance2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Impedance channel 2',\n", + " 'name': 'impedance2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 50,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'Ohm',\n", + " 'vals': '',\n", + " 'value': 50},\n", + " 'interleave_samples': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_interleave_samples',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Interleave Samples',\n", + " 'name': 'interleave_samples',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DISABLED',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DISABLED'},\n", + " 'mode': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_mode',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Acquisition mode',\n", + " 'name': 'mode',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'NPT',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'NPT'},\n", + " 'records_per_buffer': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_records_per_buffer',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Records per Buffer',\n", + " 'name': 'records_per_buffer',\n", + " 'post_delay': 0,\n", + " 'raw_value': 70,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '=0>',\n", + " 'value': 70},\n", + " 'sample_rate': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_sample_rate',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Internal Sample Rate',\n", + " 'name': 'sample_rate',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1000000000,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'S/s',\n", + " 'vals': '',\n", + " 'value': 1000000000},\n", + " 'samples_per_record': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_samples_per_record',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Samples per Record',\n", + " 'name': 'samples_per_record',\n", + " 'post_delay': 0,\n", + " 'raw_value': 1024,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '=256, Multiples of 128>',\n", + " 'value': 1024},\n", + " 'timeout_ticks': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_timeout_ticks',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Timeout Ticks',\n", + " 'name': 'timeout_ticks',\n", + " 'post_delay': 0,\n", + " 'raw_value': 0,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '10 us',\n", + " 'vals': '=0>',\n", + " 'value': 0},\n", + " 'transfer_offset': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_transfer_offset',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Transfer Offset',\n", + " 'name': 'transfer_offset',\n", + " 'post_delay': 0,\n", + " 'raw_value': 0,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'Samples',\n", + " 'vals': '=0>',\n", + " 'value': 0},\n", + " 'trigger_delay': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_delay',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Delay',\n", + " 'name': 'trigger_delay',\n", + " 'post_delay': 0,\n", + " 'raw_value': 0,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': 'Sample clock cycles',\n", + " 'vals': '=0>',\n", + " 'value': 0},\n", + " 'trigger_engine1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_engine1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Engine 1',\n", + " 'name': 'trigger_engine1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'TRIG_ENGINE_J',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'TRIG_ENGINE_J'},\n", + " 'trigger_engine2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_engine2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Engine 2',\n", + " 'name': 'trigger_engine2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'TRIG_ENGINE_K',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'TRIG_ENGINE_K'},\n", + " 'trigger_level1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_level1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Level 1',\n", + " 'name': 'trigger_level1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 160,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '',\n", + " 'value': 160},\n", + " 'trigger_level2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_level2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Level 2',\n", + " 'name': 'trigger_level2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 128,\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': '',\n", + " 'value': 128},\n", + " 'trigger_operation': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_operation',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Operation',\n", + " 'name': 'trigger_operation',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'TRIG_ENGINE_OP_J',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'TRIG_ENGINE_OP_J'},\n", + " 'trigger_slope1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_slope1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Slope 1',\n", + " 'name': 'trigger_slope1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'TRIG_SLOPE_POSITIVE',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'TRIG_SLOPE_POSITIVE'},\n", + " 'trigger_slope2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_slope2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Slope 2',\n", + " 'name': 'trigger_slope2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'TRIG_SLOPE_POSITIVE',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'TRIG_SLOPE_POSITIVE'},\n", + " 'trigger_source1': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_source1',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Source 1',\n", + " 'name': 'trigger_source1',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'EXTERNAL',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'EXTERNAL'},\n", + " 'trigger_source2': {'__class__': 'qcodes.instrument_drivers.AlazarTech.ATS.AlazarParameter',\n", + " 'full_name': 'Alazar1_trigger_source2',\n", + " 'instrument': 'qcodes.instrument_drivers.AlazarTech.ATS9360.AlazarTech_ATS9360',\n", + " 'instrument_name': 'Alazar1',\n", + " 'inter_delay': 0,\n", + " 'label': 'Trigger Source 2',\n", + " 'name': 'trigger_source2',\n", + " 'post_delay': 0,\n", + " 'raw_value': 'DISABLE',\n", + " 'ts': '2017-11-09 18:08:02',\n", + " 'unit': '',\n", + " 'vals': \"\",\n", + " 'value': 'DISABLE'}},\n", + " 'submodules': {}}" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# make a snapshot of the 'ats_inst' instrument\n", + "ats_inst.snapshot()" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Started at 2017-11-09 18:08:04\n", + "DataSet:\n", + " location = 'data/2017-11-09/#005_AlazarTest_18-08-04'\n", + " | | | \n", + " Setpoint | dummy_set | dummy | (50,)\n", + " Measured | acquisition_controller_acquisition | acquisition | (50,)\n", + "Finished at 2017-11-09 18:08:08\n" + ] + }, + { + "data": { + "application/javascript": [ + "/* Put everything inside the global mpl namespace */\n", + "window.mpl = {};\n", + "\n", + "\n", + "mpl.get_websocket_type = function() {\n", + " if (typeof(WebSocket) !== 'undefined') {\n", + " return WebSocket;\n", + " } else if (typeof(MozWebSocket) !== 'undefined') {\n", + " return MozWebSocket;\n", + " } else {\n", + " alert('Your browser does not have WebSocket support.' +\n", + " 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n", + " 'Firefox 4 and 5 are also supported but you ' +\n", + " 'have to enable WebSockets in about:config.');\n", + " };\n", + "}\n", + "\n", + "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n", + " this.id = figure_id;\n", + "\n", + " this.ws = websocket;\n", + "\n", + " this.supports_binary = (this.ws.binaryType != undefined);\n", + "\n", + " if (!this.supports_binary) {\n", + " var warnings = document.getElementById(\"mpl-warnings\");\n", + " if (warnings) {\n", + " warnings.style.display = 'block';\n", + " warnings.textContent = (\n", + " \"This browser does not support binary websocket messages. \" +\n", + " \"Performance may be slow.\");\n", + " }\n", + " }\n", + "\n", + " this.imageObj = new Image();\n", + "\n", + " this.context = undefined;\n", + " this.message = undefined;\n", + " this.canvas = undefined;\n", + " this.rubberband_canvas = undefined;\n", + " this.rubberband_context = undefined;\n", + " this.format_dropdown = undefined;\n", + "\n", + " this.image_mode = 'full';\n", + "\n", + " this.root = $('
');\n", + " this._root_extra_style(this.root)\n", + " this.root.attr('style', 'display: inline-block');\n", + "\n", + " $(parent_element).append(this.root);\n", + "\n", + " this._init_header(this);\n", + " this._init_canvas(this);\n", + " this._init_toolbar(this);\n", + "\n", + " var fig = this;\n", + "\n", + " this.waiting = false;\n", + "\n", + " this.ws.onopen = function () {\n", + " fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n", + " fig.send_message(\"send_image_mode\", {});\n", + " if (mpl.ratio != 1) {\n", + " fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n", + " }\n", + " fig.send_message(\"refresh\", {});\n", + " }\n", + "\n", + " this.imageObj.onload = function() {\n", + " if (fig.image_mode == 'full') {\n", + " // Full images could contain transparency (where diff images\n", + " // almost always do), so we need to clear the canvas so that\n", + " // there is no ghosting.\n", + " fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n", + " }\n", + " fig.context.drawImage(fig.imageObj, 0, 0);\n", + " };\n", + "\n", + " this.imageObj.onunload = function() {\n", + " fig.ws.close();\n", + " }\n", + "\n", + " this.ws.onmessage = this._make_on_message_function(this);\n", + "\n", + " this.ondownload = ondownload;\n", + "}\n", + "\n", + "mpl.figure.prototype._init_header = function() {\n", + " var titlebar = $(\n", + " '
');\n", + " var titletext = $(\n", + " '
');\n", + " titlebar.append(titletext)\n", + " this.root.append(titlebar);\n", + " this.header = titletext[0];\n", + "}\n", + "\n", + "\n", + "\n", + "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "\n", + "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n", + "\n", + "}\n", + "\n", + "mpl.figure.prototype._init_canvas = function() {\n", + " var fig = this;\n", + "\n", + " var canvas_div = $('
');\n", + "\n", + " canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n", + "\n", + " function canvas_keyboard_event(event) {\n", + " return fig.key_event(event, event['data']);\n", + " }\n", + "\n", + " canvas_div.keydown('key_press', canvas_keyboard_event);\n", + " canvas_div.keyup('key_release', canvas_keyboard_event);\n", + " this.canvas_div = canvas_div\n", + " this._canvas_extra_style(canvas_div)\n", + " this.root.append(canvas_div);\n", + "\n", + " var canvas = $('');\n", + " canvas.addClass('mpl-canvas');\n", + " canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n", + "\n", + " this.canvas = canvas[0];\n", + " this.context = canvas[0].getContext(\"2d\");\n", + "\n", + " var backingStore = this.context.backingStorePixelRatio ||\n", + "\tthis.context.webkitBackingStorePixelRatio ||\n", + "\tthis.context.mozBackingStorePixelRatio ||\n", + "\tthis.context.msBackingStorePixelRatio ||\n", + "\tthis.context.oBackingStorePixelRatio ||\n", + "\tthis.context.backingStorePixelRatio || 1;\n", + "\n", + " mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n", + "\n", + " var rubberband = $('');\n", + " rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n", + "\n", + " var pass_mouse_events = true;\n", + "\n", + " canvas_div.resizable({\n", + " start: function(event, ui) {\n", + " pass_mouse_events = false;\n", + " },\n", + " resize: function(event, ui) {\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " stop: function(event, ui) {\n", + " pass_mouse_events = true;\n", + " fig.request_resize(ui.size.width, ui.size.height);\n", + " },\n", + " });\n", + "\n", + " function mouse_event_fn(event) {\n", + " if (pass_mouse_events)\n", + " return fig.mouse_event(event, event['data']);\n", + " }\n", + "\n", + " rubberband.mousedown('button_press', mouse_event_fn);\n", + " rubberband.mouseup('button_release', mouse_event_fn);\n", + " // Throttle sequential mouse events to 1 every 20ms.\n", + " rubberband.mousemove('motion_notify', mouse_event_fn);\n", + "\n", + " rubberband.mouseenter('figure_enter', mouse_event_fn);\n", + " rubberband.mouseleave('figure_leave', mouse_event_fn);\n", + "\n", + " canvas_div.on(\"wheel\", function (event) {\n", + " event = event.originalEvent;\n", + " event['data'] = 'scroll'\n", + " if (event.deltaY < 0) {\n", + " event.step = 1;\n", + " } else {\n", + " event.step = -1;\n", + " }\n", + " mouse_event_fn(event);\n", + " });\n", + "\n", + " canvas_div.append(canvas);\n", + " canvas_div.append(rubberband);\n", + "\n", + " this.rubberband = rubberband;\n", + " this.rubberband_canvas = rubberband[0];\n", + " this.rubberband_context = rubberband[0].getContext(\"2d\");\n", + " this.rubberband_context.strokeStyle = \"#000000\";\n", + "\n", + " this._resize_canvas = function(width, height) {\n", + " // Keep the size of the canvas, canvas container, and rubber band\n", + " // canvas in synch.\n", + " canvas_div.css('width', width)\n", + " canvas_div.css('height', height)\n", + "\n", + " canvas.attr('width', width * mpl.ratio);\n", + " canvas.attr('height', height * mpl.ratio);\n", + " canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n", + "\n", + " rubberband.attr('width', width);\n", + " rubberband.attr('height', height);\n", + " }\n", + "\n", + " // Set the figure to an initial 600x600px, this will subsequently be updated\n", + " // upon first draw.\n", + " this._resize_canvas(600, 600);\n", + "\n", + " // Disable right mouse context menu.\n", + " $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n", + " return false;\n", + " });\n", + "\n", + " function set_focus () {\n", + " canvas.focus();\n", + " canvas_div.focus();\n", + " }\n", + "\n", + " window.setTimeout(set_focus, 100);\n", + "}\n", + "\n", + "mpl.figure.prototype._init_toolbar = function() {\n", + " var fig = this;\n", + "\n", + " var nav_element = $('
')\n", + " nav_element.attr('style', 'width: 100%');\n", + " this.root.append(nav_element);\n", + "\n", + " // Define a callback function for later on.\n", + " function toolbar_event(event) {\n", + " return fig.toolbar_button_onclick(event['data']);\n", + " }\n", + " function toolbar_mouse_event(event) {\n", + " return fig.toolbar_button_onmouseover(event['data']);\n", + " }\n", + "\n", + " for(var toolbar_ind in mpl.toolbar_items) {\n", + " var name = mpl.toolbar_items[toolbar_ind][0];\n", + " var tooltip = mpl.toolbar_items[toolbar_ind][1];\n", + " var image = mpl.toolbar_items[toolbar_ind][2];\n", + " var method_name = mpl.toolbar_items[toolbar_ind][3];\n", + "\n", + " if (!name) {\n", + " // put a spacer in here.\n", + " continue;\n", + " }\n", + " var button = $('