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

Convenience data analysis functions #382

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AVB25
Copy link
Contributor

@AVB25 AVB25 commented Feb 1, 2024

Some convenience functions for data analysis that have been helpful to me and may be so to others. These are the same that I opened a pull request for a few months ago in oitg (OxfordIonTrapGroup/oitg#45) and then forgot about 😅

They parse the results dictionary yielded by load_results to translate all PYON into python objects and make data more accessible. There are also functions to sort a multi-dimensional scan, possibly with missing entries (only tested for 2-D scans so far).

Demo usage for loading and directly plotting a 2D scan with missing entries:

# Load the experiment data
results, axes, args, _ = load_ndscan(day=day, rid=rid, experiment=<experiment>)

# Get sorted data for two results channels
p_1 = results["measurement_1_p_0"].data
p_2 = results["measurement_1_p_1"].data

# Get sorted axis data for two axes and scale them
axis_0 = axes[0].data / axes[0].scale
axis_1 = axes[1].data / axes[1].scale

# Plot
plt.pcolormesh(axis_0, axis_1, p_1)

@AVB25 AVB25 force-pushed the load-ndscan branch 2 times, most recently from 66d6f20 to aba42a0 Compare February 1, 2024 19:59
@AVB25
Copy link
Contributor Author

AVB25 commented Feb 1, 2024

Pushes were formatting to pass tests

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.

1 participant