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

AMI430_3D Driver not aware of changes to individual axes #5193

Open
spauka opened this issue Jun 2, 2023 · 1 comment
Open

AMI430_3D Driver not aware of changes to individual axes #5193

spauka opened this issue Jun 2, 2023 · 1 comment

Comments

@spauka
Copy link
Contributor

spauka commented Jun 2, 2023

Hi All,

The AMI430_3D driver is not aware of changes to the individual axes when snapshotting, leading to inconsistent snapshots where the field recorded in the individual axis instruments in not the same as the field recorded in the 3D instrument.

Steps to reproduce

  1. Create a 3D magnet instance in the usual way:
field_X = scfg.load_instrument("field_X")
field_Y = scfg.load_instrument("field_Y")
field_Z = scfg.load_instrument("field_Z")
magnet = AMI430_3D("magnet", field_X, field_Y, field_Z, (field_limit,))
station.add_component(magnet)
  1. Perform a measurement that ramps the magnet using one of the individual magnet axes. As an example, here I'm taking a PNA trace.
dataset_1, _, _ = qc.dataset.do0d(pna.polar)
field_Z.field(1)
dataset_2, _, _ = qc.dataset.do0d(pna.polar)
  1. Examine the snapshot of the magnet instrument in the two traces to extract the magnetic field:
mag_1 = dataset_1.snapshot["station"]["instruments"]["magnet"]
field_1 = mag_1["parameters"]["cartesian_measured"]["value"]
mag_2 = dataset_2.snapshot["station"]["instruments"]["magnet"]
field_2 = mag_2["parameters"]["cartesian_measured"]["value"]

Expected behaviour

The two values should be:

field_1 == (0, 0, 0)
field_2 == (0, 0, 1)

Actual behaviour

The cache in the AMI430_3D instrument means that the field_2 value still reads (0, 0, 0):

field_1 == (0, 0, 0)
field_2 == (0, 0, 0) # !! This is wrong !!

Solution

Use DelegateParameter's in the AMI430_3D driver such that the cache is kept up to date.

Ping @jenshnielsen and @sohailc (you originally wrote the driver right?)

@jenshnielsen
Copy link
Collaborator

Thansk @spauka That sounds like the correct solution to me. Would you have time to do a fix?

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

2 participants