Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 108 additions & 41 deletions docs/examples/Qcodes example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -308,22 +308,80 @@
{
"data": {
"text/plain": [
"[0.117]"
"{'instruments': {'gates': {'functions': {'reset': {}},\n",
" 'parameters': {'chan0': {'ts': None, 'value': None},\n",
" 'chan1': {'ts': None, 'value': None},\n",
" 'chan2': {'ts': None, 'value': None}}},\n",
" 'meter': {'functions': {},\n",
" 'parameters': {'amplitude': {'ts': None, 'value': None}}},\n",
" 'source': {'functions': {},\n",
" 'parameters': {'amplitude': {'ts': None, 'value': None}}}}}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"station.snapshot()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{'instruments': {'gates': {'functions': {'reset': {}},\n",
" 'parameters': {'chan0': {'ts': '2016-04-20 00:19:23', 'value': 0.0},\n",
" 'chan1': {'ts': '2016-04-20 00:19:23', 'value': 0.0},\n",
" 'chan2': {'ts': '2016-04-20 00:19:23', 'value': 0.0}}},\n",
" 'meter': {'functions': {},\n",
" 'parameters': {'amplitude': {'ts': '2016-04-20 00:19:23', 'value': 0.117}}},\n",
" 'source': {'functions': {},\n",
" 'parameters': {'amplitude': {'ts': '2016-04-20 00:19:23', 'value': 0.1}}}}}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"station.snapshot(update=True)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[0.117]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# we can get the measured quantities right now\n",
"station.measure()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {
"collapsed": false
},
Expand All @@ -333,9 +391,9 @@
"output_type": "stream",
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='testsweep'\n",
" amplitude: amplitude\n",
" chan0: chan0\n",
"started at 2016-04-13 15:23:05\n"
" amplitude: amplitude\n",
"started at 2016-04-20 00:19:28\n"
]
}
],
Expand All @@ -357,7 +415,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 8,
"metadata": {
"collapsed": false,
"scrolled": true
Expand All @@ -377,16 +435,16 @@
" 0.007, 0.008, 0.008, 0.008, 0.009, 0.009, 0.01 , 0.01 ,\n",
" 0.01 , 0.011, 0.011, 0.012, 0.013, 0.013, 0.014, 0.015,\n",
" 0.016, 0.017, 0.018, 0.019, 0.02 , 0.022, 0.023, 0.025,\n",
" 0.027, 0.029, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" 0.027, 0.029, 0.031, 0.034, 0.037, 0.04 , 0.044, 0.048,\n",
" 0.053, 0.058, 0.064, 0.071, 0.077, 0.085, 0.092, 0.099,\n",
" 0.106, 0.111, 0.115, 0.117, 0.117, 0.117, 0.115, 0.111,\n",
" 0.106, 0.099, 0.092, 0.085, 0.077, 0.071, 0.064, 0.058,\n",
" 0.053, 0.048, 0.044, 0.04 , 0.037, 0.034, 0.031, 0.029,\n",
" 0.027, 0.025, 0.023, 0.022, 0.02 , 0.019, 0.018, 0.017,\n",
" 0.016, 0.015, 0.014, 0.013, 0.013, 0.012, 0.011, 0.011,\n",
" 0.01 , 0.01 , 0.01 , 0.009, 0.009, 0.008, 0.008, 0.008,\n",
" 0.007, 0.007, 0.007, 0.007, 0.006, 0.006, 0.006, 0.006,\n",
" 0.006, 0.007, 0.007, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
Expand Down Expand Up @@ -427,15 +485,15 @@
" -14.6, -14.5, -14.4, -14.3, -14.2, -14.1, -14. , -13.9, -13.8,\n",
" -13.7, -13.6, -13.5, -13.4, -13.3, -13.2, -13.1, -13. , -12.9,\n",
" -12.8, -12.7, -12.6, -12.5, -12.4, -12.3, -12.2, -12.1, -12. ,\n",
" -11.9, -11.8, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" -11.9, -11.8, -11.7, -11.6, -11.5, -11.4, -11.3, -11.2, -11.1,\n",
" -11. , -10.9, -10.8, -10.7, -10.6, -10.5, -10.4, -10.3, -10.2,\n",
" -10.1, -10. , -9.9, -9.8, -9.7, -9.6, -9.5, -9.4, -9.3,\n",
" -9.2, -9.1, -9. , -8.9, -8.8, -8.7, -8.6, -8.5, -8.4,\n",
" -8.3, -8.2, -8.1, -8. , -7.9, -7.8, -7.7, -7.6, -7.5,\n",
" -7.4, -7.3, -7.2, -7.1, -7. , -6.9, -6.8, -6.7, -6.6,\n",
" -6.5, -6.4, -6.3, -6.2, -6.1, -6. , -5.9, -5.8, -5.7,\n",
" -5.6, -5.5, -5.4, -5.3, -5.2, -5.1, -5. , -4.9, -4.8,\n",
" -4.7, -4.6, -4.5, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
Expand Down Expand Up @@ -465,7 +523,7 @@
" nan, nan, nan, nan])}"
]
},
"execution_count": 5,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -478,7 +536,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 9,
"metadata": {
"collapsed": false,
"scrolled": false
Expand All @@ -492,7 +550,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 10,
"metadata": {
"collapsed": false,
"scrolled": false
Expand All @@ -503,11 +561,11 @@
"output_type": "stream",
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='test2d'\n",
" chan1: chan1\n",
" amplitude_3: amplitude\n",
" chan0: chan0\n",
" amplitude_0: amplitude\n",
"started at 2016-04-13 15:23:28\n"
" chan0: chan0\n",
" chan1: chan1\n",
"started at 2016-04-20 00:19:58\n"
]
}
],
Expand All @@ -531,7 +589,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"metadata": {
"collapsed": false
},
Expand All @@ -541,14 +599,14 @@
"output_type": "stream",
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='test_multi_d'\n",
" avg_amplitude: avg_amplitude\n",
" chan2: chan2\n",
" chan0: chan0\n",
" amplitude_2: amplitude\n",
" chan0: chan0\n",
" chan2: chan2\n",
" chan1: chan1\n",
" amplitude_3_0: amplitude\n",
" avg_amplitude: avg_amplitude\n",
" amplitude_5_0: amplitude\n",
"started at 2016-04-13 15:24:20\n"
" amplitude_3_0: amplitude\n",
"started at 2016-04-20 00:20:54\n"
]
}
],
Expand Down Expand Up @@ -577,7 +635,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 13,
"metadata": {
"collapsed": false,
"scrolled": false
Expand All @@ -589,10 +647,10 @@
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='test_complex_param'\n",
" avg_amplitude: avg_amplitude\n",
" chan2: chan2\n",
" chan1: chan1\n",
" amplitude: amplitude\n",
"started at 2016-02-02 12:18:09\n"
" chan1: chan1\n",
" chan2: chan2\n",
"started at 2016-04-20 00:21:35\n"
]
}
],
Expand All @@ -608,6 +666,15 @@
"plot4Q = qc.QtPlot(data4.amplitude, figsize=(1200, 500))\n",
"plot4Q.add(data4.avg_amplitude, subplot=2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -626,7 +693,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.0"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions qcodes/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def __init__(self, *instruments, monitor=None, default=True, **kwargs):

self.monitor = monitor

def snapshot_base(self):
return {'instruments': {name: ins.snapshot()
def snapshot_base(self, *args, **kwargs):
return {'instruments': {name: ins.snapshot(*args, **kwargs)
for name, ins in self.instruments.items()}}

def add_instrument(self, instrument, name=None):
Expand Down
2 changes: 1 addition & 1 deletion qcodes/utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def snapshot(self, *args, **kwargs):

return snap

def snapshot_base(self):
def snapshot_base(self, *ignore_args, **ignore_kwargs):
'''
override this with the primary information for a subclass
'''
Expand Down