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

Hard (arraylike) parameter QtPlot setpoint linearity plotting bug #397

Closed
nataliejpg opened this issue Nov 21, 2016 · 7 comments
Closed
Labels
Milestone

Comments

@nataliejpg
Copy link
Contributor

nataliejpg commented Nov 21, 2016

Steps to reproduce

  1. Do a Loop over a hard (arraylike) parameter where you generate the setpoints and plot it with QtPlot
loop = qc.Loop(y1.voltage.sweep(0,-10, 0.1)).each(v1.trace)
data = loop.get_data_set()
plot = qc.QtPlot()
plot.add(data.VNA_magnitude)
_ = loop.with_bg_task(plot.update, plot.save).run()

data set looks like:

DataSet:
   mode     = DataMode.LOCAL
   location = 'A:/TransmonExperiments/GoogleDrive/T2acquisition/Data/6QAK3_A2_qcodes/data/014'
   <Type>   | <array_id>        | <array.name> | <array.shape>
   Setpoint | yoko1_voltage_set | voltage      | (101,)
   Measured | frequency         | frequency    | (101, 401)
   Measured | VNA_magnitude     | magnitude    | (101, 401)
   Measured | VNA_phase         | phase        | (101, 401)
started at 2016-11-18 17:10:03
  1. load the data and plot it again
loaded_data = qc.load_data(loc_provider.formatter.format(loc_provider.fmt,counter='004'))
plot = qc.QtPlot()
plot.add(loaded_data.VNA_magnitude)

Expected behaviour

Should look the same both times and have the setpoints you would expect on the x axis

Actual behaviour

Looks right when you live plot it (as in step 1) but gives a nonlinear spacing error when you load the data (as in step 2) in and discards the setoints but keeps the label which is now a lie!

from 1
004

from 2
004

with this error:

a:\qcodes\qcodes\plots\pyqtgraph.py:325: UserWarning: nonlinear setpoint array passed to pyqtgraph. ignoring, using default scaling.
  warnings.warn('nonlinear setpoint array passed to pyqtgraph. '

Note: works in matplot in terms of using the setpoint array even when loading data back (but we cant use that because of #380)

Note2: code generating setpoints looks like:

f = tuple(np.linspace(int(start), int(stop), num=npts))
self.setpoints = ((f,), (f,))
self.shapes = ((npts,), (npts,))

@giulioungaretti @alexcjohnson @WilliamHPNielsen

@nataliejpg
Copy link
Contributor Author

Note3: also works correctly for plotting in the notebook after taking the data (ie without live update)

data = qc.Loop(v1.power.sweep(-60,-10, 1)).each(v1.trace).run()
qc.QtPlot(data.VNA_magnitude)

@nataliejpg
Copy link
Contributor Author

Note4: this sometimes works as expected even in QtPlot (depends on the setpoints) which makes me think its something to do with rounding in the driver producing a nonlinear setpoint array but it still wouldn't really explain (to me at least) why it would always work fine with the Note3 example but not with loaded in data.

@MerlinSmiles
Copy link
Contributor

I guess you could try to increase the MAXPX value in the qcodes/plots/pyqtgraph.py file to see if it is related to rounding errors?
Not that I understand how that error is actually calculated...

@nataliejpg
Copy link
Contributor Author

@MerlinSmiles that works, thanks Merlin. Not sure whether to close the issue or leave open to flag up that this is a minor thing that should be looked at/changed in qcodes. @giulioungaretti ?

@MerlinSmiles
Copy link
Contributor

@nataliejpg dont close it, its still a bug.

@jenshnielsen
Copy link
Collaborator

@nataliejpg I think this has been fixed some time ago ?

@nataliejpg
Copy link
Contributor Author

@jenshnielsen agreed

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

No branches or pull requests

4 participants