Skip to content

Commit

Permalink
update before section, 7-element
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceravel committed Aug 27, 2024
1 parent 47ea838 commit a81d036
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 30 deletions.
Binary file added docs/_images/7element.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/small_rotation_stage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_images/tilt_stage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 26 additions & 4 deletions docs/before.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ that look like this:

This is a caution box.

The tl;dr for this page is: *read all the caution boxes.*

Failure to do all the tasks in caution boxes will result in delay or
Failure to do the tasks in caution boxes will result in delay or
cancellation of your experiment.

:TL;DR: *read all the caution boxes.*

Register for BNL Site Access
----------------------------

Expand Down Expand Up @@ -70,7 +70,8 @@ account in order to unlock the computers at the beamline.

.. caution:: Without an active account, a known password, and DUO
Federal two-factor authentication, you will be unable to
perform your experiment.
perform your experiment or to access the data from the
experiment.

Safety Approval Form
--------------------
Expand Down Expand Up @@ -141,6 +142,7 @@ Electrochemistry and battery science
Request Lab 4L-L09.

.. admonition:: Radiological samples
:class: important

Radionuclide samples must be prepared and properly contained at the
home institution. NSLS-II has no lab available for work on
Expand All @@ -166,6 +168,17 @@ before the starting date.
To complete your training, follow the training instructions at:
https://www.bnl.gov/nsls2/userguide/before-arrival.php#step2

Links to specific course:

+ `Cyber Security Training (GE-CYBERSEC) <https://training.bnl.gov/portal/GE-CYBERSEC>`__
+ `Computer Use Agreement (GE-COMPUSE-AGREE) <https://training.bnl.gov/portal/GE-COMPUSE-AGREE>`__
+ `General Employee Radiation Training (TQ-GERT) <https://training.bnl.gov/portal/TQ-GERT>`__
+ `NSLS-II Safety Module (PS-NSLS-II-USER-MOD) <https://training.bnl.gov/portal/PS-NSLS-II-USER-MOD>`__
+ `Guest Site Orientation (TQ-GSO) <https://training.bnl.gov/portal/TQ-GSO>`__

Returning users can `check training status online <https://www.bnl.gov/training/>`__.


.. caution::

Failure to complete training will result in a delay starting your
Expand Down Expand Up @@ -241,3 +254,12 @@ training.

Please consult `NSLS-II user guide <https://www.bnl.gov/ps/userguide/>`__
or contact BMM beamline staff for more information.

.. ADMONITION:: **NSLS-II Attire**
:class: caution

At a minimum, all users are required to wear long pants or
skirt/dress that extends to the ankle, short-sleeve or long sleeve
shirts, and shoes that enclose the entire foot for entry to NSLS-II
non-office areas, which includes the experimental floor and sample
preparation laboratories.
18 changes: 15 additions & 3 deletions docs/instruments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,22 @@ photons, this versatility of setup is occasionally very helpful.


.. note::
Thanks to funding from the CHIPS Act, BMM is the process of
Thanks to funding from the CHIPS Act, BMM is
procuring a new 7-element SDD! Look for that in late 2024 or
early 2025.

It arrived on 23 August, 2024! Installation and commissioning to
start soon! Still waiting on the new XYZ stage.

.. _fig-7element:
.. figure:: _images/7element.jpg
:target: _images/7element.jpg
:width: 50%
:align: center





Area detector
-------------
Expand Down Expand Up @@ -320,9 +332,9 @@ in the form of an Eulerian cradle and a `compact rotary stage
:name: fig-pitchroll_rotation
:class-grid: outline

.. image:: _images/dummy.png
.. image:: _images/tilt_stage.jpg

.. image:: _images/dummy.png
.. image:: _images/small_rotation_stage.jpg

(Left) The pitch and roll stage. (Right) The small rotation stage

Expand Down
23 changes: 8 additions & 15 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ TL;DR
**Details, details, details**
:numref:`Command cheatsheet, Section {number} <cheatsheet>`

**Start the live plotting utility**
At a command line (but not the bsui command line),
``run-consumer``, see :numref:`{name}, Section {number}
<start_consumer>`


Essential links
---------------
Expand Down Expand Up @@ -187,11 +182,9 @@ physically at the beamline.

.. attention::

In the 2024-1 cycle, BMM is no longer synching data automatically
to Google Drive, although data will be manually transferred to a
Google Drive for the time being. Soon, data will be available to
users via sftp with proper integration into new data storage and
authentication services in the 2024-2 cycle.
As of the 2024-1 cycle, BMM is no longer syncing data
automatically to Google Drive. Data are now available to users via
sftp with proper authentication. See :numref:`Data Access (Section %s) <data>`.

The measured data along with the entire contents of the
:numref:`measurement dossier (Section %s) <dossier>` will be synched
Expand Down Expand Up @@ -423,11 +416,11 @@ https://github.com/heig-tin-info/handout.
BMM's `Bluesky <https://blueskyproject.io/>`__ profile was mostly
written by Bruce. But this would not have happened without the help
of several members of NSLS-II's DSSI program. In particular, I want
to thank Dan Allan, Tom Caswell, Josh Lynch, Max Rakitin, Dmitri
Gavrilov, Stuart Campbell, Abby Giles, Garrett Bishof, Nate Maytan,
Matt Snyder, and Ryan Jaskiel. And I need to thank every BMM user
|nd| being a BMM user and being a beta tester for the beamline
software are the same thing!
to thank Dan Allan, Tom Caswell, Josh Lynch, Jakub Wlodek, Max
Rakitin, Dmitri Gavrilov, Stuart Campbell, Abby Giles, Garrett Bishof,
Nate Maytan, Matt Snyder, and Ryan Jaskiel. And I need to thank every
BMM user |nd| being a BMM user and being a beta tester for the
beamline software are the same thing!

BMM makes use of `lots of great python tools
<https://speakerdeck.com/jakevdp/the-unexpected-effectiveness-of-python-in-science?slide=52>`__.
Expand Down
42 changes: 34 additions & 8 deletions docs/kafka.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ With the advent of BMM's use of `BlueSky queueserver
had to rethink how plots were made.

In short, a Kafka client was developed to manage real-time
visualization. This client is subscribed to two topiss, a private
visualization. This client is subscribed to two topics, a private
BMM-only topic and the same topic used by Bluesky to distribute
event documents to databroker.
event documents to databroker.

Messages on the private topic tell the worker what kind of plot is
requested. The worker then parses event documents and adds data
points to the real-time plots.

In May 2024, data security upgrades were implemented at BMM. The
upshot of this new data security regime is that the bsui or qs process
is not able to write data to the secure proposal directory on central
is not able to write data to the proposal directory on central
storage. Moving all data file output from the bsui profile to a new
Kafka worker gave us a path forward. The workers can be run with
adequate privilege to write to central storage.
Expand Down Expand Up @@ -95,7 +95,7 @@ It is convenient to make symlinks to each of the shell scripts in a
folder in the execution path. ``~/bin/`` makes sense.

To start, run the ``open-tabs.sh`` script to make a Konsole window
with three tabs. Each tab is named something evokative of what will
with three tabs. Each tab is named something evocative of what will
be running in it.

#. In the tab labeled "Visual plot manager", do ``run-filemanager`` as
Expand Down Expand Up @@ -139,7 +139,7 @@ applications that generate messages and applications that want to
consume those messages and act upon them.

This works via subscription topics. An application can subscribe to
a topic as a producers. That means it can say "I just did something
a topic as a producer. That means it can say "I just did something
and here is information about what I did." It will post that message
to Kafka, then move on.

Expand Down Expand Up @@ -518,18 +518,44 @@ the common thread to how BMM uses Kafka to make plots, both static and
real-time plots.


.. todo:: there are more plot actions that need top be documented.
.. todo:: there are more plot actions that need to be documented.

Headless and visualization workers
----------------------------------

.. todo:: explain why there are two, explain what each does
There are two plotting workers that share code and behave almost
identically. This seems redundant, so merits a few words of
explanation.

The visualization worker is run as the beamline operator |nd|
``xf06bm``. The beamline operator owns the screen and is able to make
plots of data to the screen. However, the beamline operator does not
have permission to write data and png images to the proposal
directory. The visualization worker can be run on any machine on the
local network at BMM |nd| even on multiple machines!

The headless worker does not make visible plot visualization.
Instead, it writes plots to a virtual device which can then be saved
as png images to the proposal directory. It is also able to write
data files to the proposal directory. For example, the XRD data file
measured before each scan sequence is written by the visualization
worker.

In short, the visualization worker is for the benefit of the humans at
the beamline while the headless worker is responsible for writing
files for the data record of the experiment.

Credit goes to Dan Allan for suggesting running two instances of the
plot worker using the QtAgg and Agg `matplotlib backends
<https://matplotlib.org/stable/users/explain/figure/backends.html>`__.


File management
---------------

*Explain all the file management actions with example dicts.*
.. todo::

Explain all the file management actions with example dicts.


Cleaning up the screen
Expand Down
31 changes: 31 additions & 0 deletions docs/manage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,34 @@ storage.
Manage Silicon Drift Detectors
------------------------------

.. note::
Thanks to funding from the CHIPS Act, BMM is
procuring a new 7-element SDD! Look for that in late 2024 or
early 2025.

The assumption is that one of the three detectors will be the primary
detector in an experiment. At the bsui command line (or in queue
server) the ``xs`` symbol should point at the correct detector. Also,
a parameter is set in Redis allowing other processes (such as the
Kafka plotting agent) to know which detector to be paying attention to.


.. code-block:: python
xs = xspress3_set_detector(4)
where the argument to ``xspress3_set_detector`` is 1, 4, or 7

This sets ``xs`` to the selected detector object |nd| ``xs1``,
``xs4``, or ``xs7``. The default at startup is to use the 4-element
detector. That will change soon to the new 7-element.

Also set is the Redis parameter ``BMM:xspress3``, which is set to 1,
4, or 7 (and represented as a b-string).

.. code-block:: python
int(rkvs.get('BMM:xspress3'))
9 changes: 9 additions & 0 deletions docs/pds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,15 @@ For the harmonic rejection mirror, use ``%w m3``
roll = 0.000 mrad XU = 15.001
yaw = 0.001 mrad XD = 15.001
The front-end collimating mirror, the focusing mirror, and one stripe
of the harmonic rejection mirror are coated with 5 nm of Rh deposited
on 30 nm of Pt on silicon. See `MA Marcus, et
al., J. Synch. Radiat. (2004) 11, 239-247 DOI:
10.1107/S0909049504005837
<https://doi.org/10.1107/S0909049504005837>`__ for an explanation of
the advantages of this coating scheme.


.. _slits3:

End station slits
Expand Down

0 comments on commit a81d036

Please sign in to comment.