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

example scans with sscan record #942

Merged
merged 17 commits into from
Apr 3, 2024
Merged

example scans with sscan record #942

merged 17 commits into from
Apr 3, 2024

Conversation

prjemian
Copy link
Contributor

docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Show resolved Hide resolved
"\n",
"So far, we have just run `scan1` and shown the data collected. We'll need to do\n",
"a bit more work to get this data into bluesky as a run. While we might just use\n",
"`bps.read(scan1)` to get the data, the data would be named according to the\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does that mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What was unclear?

"`scan1` structure. We want more meaningful names so we re-assign the names of\n",
"the original objects (motor and scaler channel names). To post *bluesky data*,\n",
"it must come from an ophyd `Device` (subclass). We'll create a custom one just\n",
"for our setup of `scan1`, then `bps.mv()` each of the arrays. Since we do not\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not understand this "then bps.mv() each of the arrays", is it missing a word?

"from ophyd import Component, Device, Signal\n",
"\n",
"class ThisSscanData(Device):\n",
" m1 = Component(Signal)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is Component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An ophyd structure. Do not want to repeat this here (it must be explained somewhere else). Should we find and reference the documentation page?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I looked at the documentation page but it did not help. Maybe there are better reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Component is a tool used by ophyd's Device to mark an attribute as an ophyd object that needs to be handled either as a Device or a Signal. The first argument tells which type of ophyd (or custom) class to be used.

]
},
{
"cell_type": "markdown",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am lost from "so far" to here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added various changes with the latest commit. Did not resolve any conversations. Please see if some of your questions have been resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might take more discussion for us. After tomorrow's discussion?

@prjemian
Copy link
Contributor Author

We need to make our documentation more modular so we do not repeat the explanation of similar concepts, such as:

  • How does a RE subscription work?
  • waiting with polling loop v. status object
  • writing data to a RE stream
  • what code creates an actual bluesky run?
  • What is returned from a call to RE()?
  • How to identify and handle blocking functions when writing a bluesky plan?

docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
"from ophyd import Component, Device, Signal\n",
"\n",
"class ThisSscanData(Device):\n",
" m1 = Component(Signal)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I looked at the documentation page but it did not help. Maybe there are better reference.

docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
@rodolakis
Copy link
Collaborator

Still working on it, was just having some problem between 2 pages of comment open. So hold on to reply!

docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
Copy link
Contributor Author

@prjemian prjemian left a comment

Choose a reason for hiding this comment

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

added replies

docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
docs/source/examples/de_sscan.ipynb Outdated Show resolved Hide resolved
"from ophyd import Component, Device, Signal\n",
"\n",
"class ThisSscanData(Device):\n",
" m1 = Component(Signal)\n",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Component is a tool used by ophyd's Device to mark an attribute as an ophyd object that needs to be handled either as a Device or a Signal. The first argument tells which type of ophyd (or custom) class to be used.

]
},
{
"cell_type": "markdown",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might take more discussion for us. After tomorrow's discussion?

@rodolakis
Copy link
Collaborator

I am all good up to section 4. I will need help after that. If you want to merge go for it, and/or we can discuss tomorrow. I do have a pretty full day though. Otherwise Wednesday morning during our weekly meeting?

@prjemian prjemian merged commit f83d165 into main Apr 3, 2024
11 of 13 checks passed
@prjemian prjemian deleted the 940-sscan-examples branch April 3, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New example: scaler v. motor using sscan record
2 participants