Qcodes
Qcodes copied to clipboard
AMI430_3D Driver not aware of changes to individual axes
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
- 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)
- 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)
- Examine the snapshot of the
magnetinstrument 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?)
Thansk @spauka That sounds like the correct solution to me. Would you have time to do a fix?