Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zi issue with index out out bounds #10

Open
jenshnielsen opened this issue Aug 1, 2017 · 1 comment
Open

Zi issue with index out out bounds #10

jenshnielsen opened this issue Aug 1, 2017 · 1 comment

Comments

@jenshnielsen
Copy link
Contributor

Seems to be more likely to happen with many averages

runfile('A:/qcodes_experiments/fast_charge_default_settings.py', wdir='A:/qcodes_experiments')
Started at 2017-08-01 10:30:45
DataSet:
   location = 'A:\\qcodes_experiments\\MajoQubit\\DVZ_MCQ002A1\\4025'
   <Type>   | <array_id>            | <array.name>  | <array.shape>
   Setpoint | sg1_frequency_set     | frequency     | (300,)
   Measured | ziuhfli_scope_avg_ch1 | scope_avg_ch1 | (300, 512)
Finished at 2017-08-01 10:32:17
Traceback (most recent call last):

  File "<ipython-input-91-152cc28d54e4>", line 1, in <module>
    runfile('A:/qcodes_experiments/fast_charge_default_settings.py', wdir='A:/qcodes_experiments')

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
    execfile(filename, namespace)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "A:/qcodes_experiments/fast_charge_default_settings.py", line 116, in <module>
    scope_signal, zi_trig_signal, trigger_holdoff=60e-6, zi_scope_length=512)

  File "A:/qcodes_experiments/modules/Majorana/fast_diagrams.py", line 246, in fast_charge_diagram
    plot, data = do1d(qdac_channel, q_start, q_stop, npoints, delay, *scope_avger)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\utils\wrappers.py", line 444, in do1d
    do_plots=do_plots)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\utils\wrappers.py", line 380, in _do_measurement
    _ = loop.with_bg_task(plot.update).run()

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\loops.py", line 735, in run
    self._run_wrapper()

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\loops.py", line 784, in _run_wrapper
    self._run_loop(*args, **kwargs)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\loops.py", line 856, in _run_loop
    current_values=new_values)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\actions.py", line 136, in __call__
    out = [g() for g in self.getters]

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\qcodes\actions.py", line 136, in <listcomp>
    out = [g() for g in self.getters]

  File "A:/qcodes_experiments/modules/Majorana/fast_diagrams.py", line 33, in get
    data_avg = np.mean(data, 0)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\numpy\core\fromnumeric.py", line 2909, in mean
    out=out, **kwargs)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\numpy\core\_methods.py", line 57, in _mean
    rcount = _count_reduce_items(arr, axis)

  File "c:\users\root\anaconda3\envs\qcodes-qdev-master\lib\site-packages\numpy\core\_methods.py", line 50, in _count_reduce_items
    items *= arr.shape[ax]

IndexError: tuple index out of range
@jenshnielsen
Copy link
Contributor Author

This is probably caused by the ZI failing and not returning any data. In this case we retry 10 times and if that fails we return (None, None) as the data for the 2 channels.

In [17]: np.mean(None, 0)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-17-e1b00a113f89> in <module>()
----> 1 np.mean(None, 0)

~/.pyenv/versions/3.6.2/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/fromnumeric.py in mean(a, axis, dtype, out, keepdims)
   2907
   2908     return _methods._mean(a, axis=axis, dtype=dtype,
-> 2909                           out=out, **kwargs)
   2910
   2911

~/.pyenv/versions/3.6.2/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/_methods.py in _mean(a, axis, dtype, out, keepdims)
     55
     56     is_float16_result = False
---> 57     rcount = _count_reduce_items(arr, axis)
     58     # Make this warning show up first
     59     if rcount == 0:

~/.pyenv/versions/3.6.2/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/_methods.py in _count_reduce_items(arr, axis)
     48     items = 1
     49     for ax in axis:
---> 50         items *= arr.shape[ax]
     51     return items
     52

IndexError: tuple index out of range

I guess we should just fail with a more useful error and try to resolve why the ZI fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant