-
Notifications
You must be signed in to change notification settings - Fork 5
Code Map
The aim of this page is to provide a general overview map of the codebase so that people new to it can find their way around.
-
deploy
- Folder containing scripts to help deploy Hyperion -
fake_zocalo
- Folder containing scripts that pretend to be a basic zocalo for testing Hyperion -
graylog
- Folder containing scripts for setting up a basic local graylog instance for testing -
src
- Folder containing all code forhyperion
This is the location of most of the Hyperion code. Throughout the codebase you will see tests next to the code that they are testing, these will be in folders either listed as unit tests
or system tests
. For the purpose of the rest of the map these are ignored and assumed as given. Within Hyperion we have the following areas:
-
device_setup_plans
- These are very small plans that could be reused across different types of experiments -
experiment_plans
- This is where the bulk of the logic for how to do an experiment lives. -
external_interaction
- Code to interact with any services outside Hyperion (except EPICS devices, for which Hyperion uses dodal). -
parameters
- These are where we define what parameters are passed into Hyperion and used internally. -
__main__
- The entry point of the program, is responsible for exposing Hyperion so that it can be externally triggered
Bluesky plans are the way that Hyperion constructs the logic of what to do in an experiment. The generic files in here are:
-
__init__
- this lists the plans that are externally visible -
experiment_registry
- this lists how each plan expects to be called
There are then a number of plans for centring the sample:
-
flyscan_xray_centre_plan
- triggers a hardware-based grid scan and moves to the xray centre as returned fromzocalo
-
oav_grid_detection_plan
- optically calculates a grid for a scan that would cover the whole sample -
grid_detect_then_xray_centre_plan
- performs an OAV grid detection then a flyscan xray centre -
pin_tip_centring_plan
- optically finds the tip of the pin and moves to it -
pin_centre_then_xray_centre_plan
- optically centres the pin, then centres using a grid detect and xray centre. Currently this is the main entry point for Hyperion from GDA.
These call each other in the following way:
Where Start preparing for data collection
is defined in the device_setup_plans
and kicks off long running processes that are needed for xray data collection in the flyscan_xray_centre
phase.
Finally, there are some standalone plans:
-
stepped_grid_scan_plan
- performs a software-based grid scan -
optimise_attenuation_plan
- optimises the attenuator based on the fluorescence detector -
rotation_scan_plan
- performs a rotation scan
This plan does the following, in roughly this order:
- Move to desired transmission (and turn off xbpm feedback)
- Move to omega 0
- Read hardware values for ispyb (a grid scan entry will be added in the background, see here)
- Setup zebra and motion devices for a grid scan to be done in the motion controller
- Wait for the Eiger to finish arming or arm the Eiger if it hasn't already been done
- Run the motion control gridscan
- Wait for grid scan to end
- Retrieve the xray centring results from
Zocalo
(which will be gathered in the background see here) - Move to the centre from these results and move the aperture based on the bounding box of the results
- Move to 100% transmission (and turn on xbpm feedback)
This plan does the following, in roughly this order:
- Move to omega 0
- Calculate the 2D grid size using the edge arrays from the OAV
- Trigger the OAV device to take snapshots, both with and without the grid
- Read the snapshot paths (which will be gathered for ispyb in the background, see here)
- Repeat 2-4 for omega 90
- Return the grid positions
This plan does the following, in roughly this order:
- If called standalone - start preparing for data collection
- Do an OAV grid detection
- Convert the parameters calculated in 2 into something we can send to flyscan xray centre
- Move the backlight out, set the aperture to small and wait for the detector to finish moving
- Do a flyscan xray centre
This plan does the following, in roughly this order:
- Configure the oav for image edge detection
- If we can't find the tip attempt to move it into view by scanning a few large moves in x
- Move to the tip
- Rotate omega by 90
- Move to the tip again
This plan does the following, in roughly this order:
- Start preparing for data collection (e.g. arm the detector)
- Do a pin tip centre
- Do a grid detection then xray centre
TBD
TBD