Hi,
From my understanding, using the artiq_run -o command I should be able to write my results in a HDF5 type file.
I am using this basic test code, which prints the voltages the terminal correctly in default.
from artiq.experiment import *
import numpy as np
import sys
import artiq.coredevice.ad9910 as ad9910
class DDSTest(EnvExperiment):
def build(self):
self.setattr_device("core")
self.setattr_device("sampler0")
@kernel
def run(self):
self.core.reset()
self.sampler0.set_gain_mu(0,0)
self.core.break_realtime()
smp=[0.0]*8
self.sampler0.sample(smp)
print("Voltages are", smp)
##Command used in terminal
I used this command in the terminal artiq_run -o test.hdf5 ADCsampler.py
##Reading the HDF5 file
I tried reading the file using
import h5py
import numpy as np
with h5py.File('test.hdf5', 'r') as f:
for key in f.keys():
print("{}:{}".format(key, f[key]))
I am getting an empty file,
