Skip to content

Update waveform_values function#239

Merged
Jasper-Harvey0 merged 10 commits intomainfrom
update-waveform-function
Mar 5, 2026
Merged

Update waveform_values function#239
Jasper-Harvey0 merged 10 commits intomainfrom
update-waveform-function

Conversation

@Jasper-Harvey0
Copy link
Collaborator

I want to change this function to be a little bit easier to work with, as I am hoping to use it in the OLCS production test.
The function used to return a list of tuples:
values = [(x1,y1), (x2,y2) ...]

This is honestly just annoying to work with for anything besides basic plotting. I would like to change it to just return two lists. One is all the x data and the other, the y data. This makes it easier to go looking for values at specific points in time and reduces the amount of unpacking needed when using the data.

As a flow on effect of this change, the function should now just return a single channels worth of data, and you can just call the function more times for more channels.

The file export now just contains the data, as the preamble was mostly redundant as the values have already been scaled as per the preamble values. It also breaks csv as the header size is bigger than every other row.

@Jasper-Harvey0
Copy link
Collaborator Author

Atgrep returns no hits for this, so I am confident these changes won't break anything in production;
image

Copy link
Collaborator

@jcollins1983 jcollins1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming you've tested reasonably well for your usecase, but I'm curious as to why you've removed the lines:

self.write(":WAV:FORM BYTE")
self.write(":WAV:POIN:MODE RAW")

The programmers manual doesn't appear to indicate a default for these and I don't see them being set anywhere else in the driver. Is there something that confirms that we don't need to set them and the defaults are as we expect them to be?

The couple of other comments are only minor, feel free to ignore if you don't see the value in making any changes.

@Jasper-Harvey0
Copy link
Collaborator Author

Looking into the byte and points mode spawned some changes to the function. These are mostly around just making sure you get the right data back from the scope for the various modes. There is no support for retrieving math or function channels.

Copy link
Collaborator

@jcollins1983 jcollins1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an unused import that needs to bee removed and a couple of other comments on clarity that you can take or leave.

Copy link
Collaborator

@jcollins1983 jcollins1983 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@Jasper-Harvey0 Jasper-Harvey0 merged commit 3137a46 into main Mar 5, 2026
3 checks passed
@Jasper-Harvey0 Jasper-Harvey0 deleted the update-waveform-function branch March 5, 2026 21:30
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

Successfully merging this pull request may close these issues.

2 participants