Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
ca1038e
Add do manual acquisition plan
olliesilvester Aug 11, 2025
bb2d127
Add option to override path provider
olliesilvester Aug 13, 2025
b392a26
remove todos
olliesilvester Aug 13, 2025
972ed36
Review response
olliesilvester Aug 21, 2025
940da42
Merge branch 'main' into 1200_add_basic_jf_plans
olliesilvester Aug 29, 2025
5386324
Merge remote-tracking branch 'origin/main' into 1200_add_basic_jf_plans
olliesilvester Aug 29, 2025
b92a863
Merge branch '1200_add_basic_jf_plans' of github.com:DiamondLightSour…
olliesilvester Aug 29, 2025
de5479f
remove accidentally added file
olliesilvester Aug 29, 2025
8f28c71
Remove print from test
olliesilvester Aug 29, 2025
f67cb7f
Remove frames per trigger for external acquisitions
olliesilvester Sep 1, 2025
cb8447e
Add do internal acquisition plan
olliesilvester Aug 29, 2025
aff58b0
Add initial plan
olliesilvester Sep 1, 2025
4bf34af
Add tests and fixes
olliesilvester Sep 1, 2025
a8ee429
Monitor signals during tests
olliesilvester Sep 2, 2025
61b6e38
Add full do darks plan
olliesilvester Sep 2, 2025
6cfab71
Add tests and docstring
olliesilvester Sep 2, 2025
f832c1d
WIP add rotation scan plan
olliesilvester Sep 3, 2025
fdfc32f
Fixes and add test
olliesilvester Sep 4, 2025
27b6416
Merge branch 'main' into 1200_add_jf_internal_acquisition
olliesilvester Sep 17, 2025
dc680a5
Refactor external acquisiton plan into reusable plan utils
olliesilvester Sep 22, 2025
9eea8d3
Improve tests
olliesilvester Sep 22, 2025
5291289
pin dodal
olliesilvester Sep 22, 2025
56cb214
update dodal pin
olliesilvester Sep 22, 2025
594046c
update path provider of the writer in override plan
olliesilvester Sep 22, 2025
090a429
Add stop JF in contingency wrapper for fly plan
olliesilvester Sep 22, 2025
15416c0
Fix race condition in test
olliesilvester Sep 22, 2025
824be80
Fix override_file_path
olliesilvester Sep 24, 2025
020d5fe
dodal pin
olliesilvester Sep 24, 2025
496f404
Merge branch 'main' into 1200_add_jf_internal_acquisition
olliesilvester Sep 24, 2025
92874c7
Fix test
olliesilvester Sep 25, 2025
0c4a7ef
Merge remote-tracking branch 'origin/main' into 1200_add_jf_internal_…
olliesilvester Sep 25, 2025
53dffe2
unpin dodal
olliesilvester Sep 25, 2025
7ea94c9
Maybe fix test again
olliesilvester Sep 25, 2025
3701394
Add non-zero sleep to test
olliesilvester Sep 25, 2025
e828621
Revert changes to vscode workspace settings
olliesilvester Sep 25, 2025
0bcf536
Wait for JF to unstage
DominicOram Sep 25, 2025
809811a
Merge branch '1200_add_jf_internal_acquisition' of github.com:Diamond…
olliesilvester Sep 25, 2025
af4f9a7
Merge remote-tracking branch 'origin/main' into 1200_add_jf_do_darks
olliesilvester Sep 26, 2025
dbef0cf
Update plan for comissioning jungfrau device
Sep 26, 2025
5f8a352
Improve docstring to explain pedestal mode
olliesilvester Sep 26, 2025
5d7624d
Add another comment
olliesilvester Sep 26, 2025
408cb98
Merge branch '1200_add_jf_do_darks' into 1200_add_jf_rotation_plan
olliesilvester Sep 26, 2025
d4bf17d
Implement revised jungfrau rotation scans
olliesilvester Sep 26, 2025
a4b289f
Make zebra and shutter setup plans more generic
olliesilvester Sep 30, 2025
55a1f3a
Improve docstring
olliesilvester Oct 1, 2025
37ffe91
Add another docstring
olliesilvester Oct 1, 2025
3e752e6
Merge remote-tracking branch 'origin/1314_make_zebra_shutter_setup_pl…
olliesilvester Oct 1, 2025
dabdcfe
Make setup and tidy up zebra rotation plans common
olliesilvester Oct 1, 2025
01b5419
Merge branch '1314_make_zebra_shutter_setup_plans_more_generic' into …
olliesilvester Oct 1, 2025
23fab94
Do all setup in parallel, add plan to do multi rotations by transmission
olliesilvester Oct 1, 2025
01b063d
Make metadata writer less weird
olliesilvester Oct 1, 2025
4711e36
More tidy up and test stubs
olliesilvester Oct 1, 2025
43590d1
Add test that pedestal mode is turned off on exception
olliesilvester Oct 2, 2025
69bfe2f
Create fixture for enum attenuator
olliesilvester Oct 2, 2025
27a3076
rename exception
olliesilvester Oct 2, 2025
49de8b8
relentless testing
olliesilvester Oct 2, 2025
4c58ff4
Add metadata writer test
olliesilvester Oct 2, 2025
038a8c8
Add run decorator onto plan
olliesilvester Oct 2, 2025
48c48db
Merge remote-tracking branch 'origin/1200_add_jf_do_darks' into 1200_…
olliesilvester Oct 2, 2025
90721b2
Add extra patch to test
olliesilvester Oct 3, 2025
2cafc60
remove wait as a parameter
olliesilvester Oct 3, 2025
385cd68
Let ophyd async revert pedestal mode on disarm instead of the plan
olliesilvester Oct 3, 2025
1b609ea
Add contingency wrapper
olliesilvester Oct 3, 2025
c6f5e14
Add more tests
olliesilvester Oct 6, 2025
5f1420d
Merge remote-tracking branch 'origin/1200_add_jf_do_darks' into 1200_…
olliesilvester Oct 6, 2025
fe6d846
make gain mode a parameter of fly_jungfrau plan
olliesilvester Oct 6, 2025
b067ec6
Expose jungfrau do dark plan to web ui
noemifrisina Oct 13, 2025
1c2ab2b
Merge branch 'main' of github.com:DiamondLightSource/mx-bluesky into …
olliesilvester Oct 20, 2025
50afbe9
Remove beam xy from metadata writer
olliesilvester Oct 20, 2025
a9886ef
Put gain mode into fly_jungfrau
olliesilvester Oct 20, 2025
971b2b3
Merge remote-tracking branch 'origin/main' into 1200_add_jf_rotation_…
olliesilvester Oct 21, 2025
d715aad
Merge remote-tracking branch 'origin/main' into 1200_add_jf_rotation_…
olliesilvester Oct 21, 2025
cfae73b
remove flux from metadata
olliesilvester Oct 21, 2025
63a4304
Fix namings
olliesilvester Oct 21, 2025
76b5df2
Review response
olliesilvester Oct 22, 2025
1697ff1
Merge branch 'main' into 151_1200-ui-plans-for-jf-rotation
noemifrisina Oct 27, 2025
d6bc925
Merge branch 'main' into 151_1200-ui-plans-for-jf-rotation
noemifrisina Oct 31, 2025
817ecb1
Merge branch 'main' into 151_1200-ui-plans-for-jf-rotation
noemifrisina Nov 12, 2025
3956ef2
Merge branch 'main' into 151_1200-ui-plans-for-jf-rotation
noemifrisina Nov 17, 2025
e407913
Merge branch '1200_add_jf_rotation_plan' into 151_1200-ui-plans-for-j…
noemifrisina Nov 17, 2025
8218b91
Merge branch 'main' into 151_1200-ui-plans-for-jf-rotation
noemifrisina Nov 19, 2025
31fbce7
Start on jf ui plans
noemifrisina Nov 19, 2025
7bb516b
Just a try
noemifrisina Nov 19, 2025
20b771c
Expose plans to blueapi
noemifrisina Nov 19, 2025
d08cd98
Do not use kwargs
noemifrisina Nov 21, 2025
1814953
Merge branch 'main' into 151_1200-ui-plans-for-jf-rotation
noemifrisina Jan 20, 2026
41603f0
Pin dodal to main
noemifrisina Jan 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ commands = [
description = "Run tests with coverage"
commands = [
[
"pytest",
"pytest",
"--cov=mx_bluesky",
"--cov-report",
"term",
Expand Down Expand Up @@ -245,7 +245,7 @@ setenv = [
]
commands = [
[
"pytest",
"pytest",
"-m",
"system_test",
"--timeout=60",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import bluesky.plan_stubs as bps

from mx_bluesky.beamlines.i24.jungfrau_commissioning.composites import (
RotationScanComposite,
)
from mx_bluesky.beamlines.i24.parameters.constants import PlanNameConstants


def read_devices_for_metadata(composite: RotationScanComposite):
yield from bps.create(PlanNameConstants.ROTATION_META_READ)
yield from bps.read(composite.dcm.energy_in_kev)
yield from bps.read(composite.dcm.wavelength_in_a)
yield from bps.read(composite.det_stage.z)
yield from bps.save()
19 changes: 19 additions & 0 deletions src/mx_bluesky/beamlines/i24/parameters/rotation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from __future__ import annotations

from pydantic import field_validator

from mx_bluesky.common.parameters.rotation import SingleRotationScan


class MultiRotationScanByTransmissions(SingleRotationScan):
transmission_fractions: list[float]
transmission_frac: float = -1

@field_validator("transmission_frac")
@classmethod
def validate_transmission_frac(cls, val):
if val != -1:
raise ValueError(
"The transmission_fractions field must be specified instead of the transmission_frac when using MultiRotationScanByTransmissions parameters"
)
return val
11 changes: 11 additions & 0 deletions src/mx_bluesky/beamlines/i24/serial/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from mx_bluesky.beamlines.i24.jungfrau_commissioning.experiment_plans.do_darks import (
do_pedestal_darks,
)
from mx_bluesky.beamlines.i24.serial.web_gui_plans.general_plans import (
gui_gonio_move_on_click,
gui_move_backlight,
Expand Down Expand Up @@ -32,6 +35,10 @@
)
from .log import clean_up_log_config_at_end, setup_collection_logs
from .setup_beamline.setup_detector import setup_detector_stage
from .web_gui_plans.jungfrau_plans import (
run_multi_rotation_plan,
run_single_rotation_plan,
)

__all__ = [
"setup_detector_stage",
Expand Down Expand Up @@ -63,4 +70,8 @@
"gui_set_zoom_level",
"gui_set_fiducial_0",
"gui_run_extruder_collection",
# Jungfrau
"do_pedestal_darks",
"run_single_rotation_plan",
"run_multi_rotation_plan",
]
153 changes: 153 additions & 0 deletions src/mx_bluesky/beamlines/i24/serial/web_gui_plans/jungfrau_plans.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import bluesky.preprocessors as bpp
from bluesky.utils import MsgGenerator
from dodal.common import inject
from dodal.devices.attenuator.attenuator import EnumFilterAttenuator
from dodal.devices.hutch_shutter import HutchShutter
from dodal.devices.i24.aperture import Aperture
from dodal.devices.i24.beamstop import Beamstop
from dodal.devices.i24.commissioning_jungfrau import CommissioningJungfrau
from dodal.devices.i24.dcm import DCM
from dodal.devices.i24.dual_backlight import DualBacklight
from dodal.devices.i24.vgonio import VerticalGoniometer
from dodal.devices.motors import YZStage
from dodal.devices.synchrotron import Synchrotron
from dodal.devices.xbpm_feedback import XBPMFeedback
from dodal.devices.zebra.zebra import Zebra
from dodal.devices.zebra.zebra_controlled_shutter import ZebraShutter

from mx_bluesky.beamlines.i24.jungfrau_commissioning.composites import (
RotationScanComposite,
)
from mx_bluesky.beamlines.i24.jungfrau_commissioning.experiment_plans.rotation_scan_plan import (
multi_rotation_plan_varying_transmission,
single_rotation_plan,
)
from mx_bluesky.beamlines.i24.parameters.rotation import (
MultiRotationScanByTransmissions,
)
from mx_bluesky.common.parameters.rotation import SingleRotationScan

PARAM_MODEL_VERSION = "5.0.0"
BEAMLINE = "BL24I"


@bpp.run_decorator()
def run_single_rotation_plan(
exposure_time_s: float,
omega_start_deg: float,
omega_increment_deg: float,
total_scan_width_deg: float,
detector_distance_mm: float,
shutter_opening_time_s: float,
visit: str,
file_name: str,
storage_directory: str,
transmission: float,
aperture: Aperture = inject("aperture"),
attenuator: EnumFilterAttenuator = inject("attenuator"),
jungfrau: CommissioningJungfrau = inject("commissioning_jungfrau"),
gonio: VerticalGoniometer = inject("vgonio"),
synchrotron: Synchrotron = inject("synchrotron"),
sample_shutter: ZebraShutter = inject("sample_shutter"),
zebra: Zebra = inject("zebra"),
xbpm_feedback: XBPMFeedback = inject("xbpm_feedback"),
hutch_shutter: HutchShutter = inject("shutter"),
beamstop: Beamstop = inject("beamstop"),
detector_stage: YZStage = inject("detector_motion"),
backlight: DualBacklight = inject("backlight"),
dcm: DCM = inject("dcm"),
) -> MsgGenerator:
composite = RotationScanComposite(
aperture,
attenuator,
jungfrau,
gonio,
synchrotron,
sample_shutter,
zebra,
xbpm_feedback,
hutch_shutter,
beamstop,
detector_stage,
backlight,
dcm,
)
parameters = SingleRotationScan(
exposure_time_s=exposure_time_s,
omega_start_deg=omega_start_deg,
rotation_increment_deg=omega_increment_deg,
scan_width_deg=total_scan_width_deg,
detector_distance_mm=detector_distance_mm,
visit=visit,
file_name=file_name,
storage_directory=storage_directory,
shutter_opening_time_s=shutter_opening_time_s,
transmission_frac=transmission,
parameter_model_version=PARAM_MODEL_VERSION,
beamline="BL24I",
sample_id=0,
snapshot_directory=None,
)

yield from single_rotation_plan(composite, parameters)


@bpp.run_decorator()
def run_multi_rotation_plan(
exposure_time_s: float,
omega_start_deg: float,
omega_increment_deg: float,
total_scan_width_deg: float,
detector_distance_mm: float,
shutter_opening_time_s: float,
visit: str,
file_name: str,
storage_directory: str,
transmission_fractions: list[float],
aperture: Aperture = inject("aperture"),
attenuator: EnumFilterAttenuator = inject("attenuator"),
jungfrau: CommissioningJungfrau = inject("commissioning_jungfrau"),
gonio: VerticalGoniometer = inject("vgonio"),
synchrotron: Synchrotron = inject("synchrotron"),
sample_shutter: ZebraShutter = inject("sample_shutter"),
zebra: Zebra = inject("zebra"),
xbpm_feedback: XBPMFeedback = inject("xbpm_feedback"),
hutch_shutter: HutchShutter = inject("shutter"),
beamstop: Beamstop = inject("beamstop"),
detector_stage: YZStage = inject("detector_motion"),
backlight: DualBacklight = inject("backlight"),
dcm: DCM = inject("dcm"),
) -> MsgGenerator:
composite = RotationScanComposite(
aperture,
attenuator,
jungfrau,
gonio,
synchrotron,
sample_shutter,
zebra,
xbpm_feedback,
hutch_shutter,
beamstop,
detector_stage,
backlight,
dcm,
)
params = MultiRotationScanByTransmissions(
exposure_time_s=exposure_time_s,
omega_start_deg=omega_start_deg,
rotation_increment_deg=omega_increment_deg,
scan_width_deg=total_scan_width_deg,
detector_distance_mm=detector_distance_mm,
visit=visit,
file_name=file_name,
storage_directory=storage_directory,
shutter_opening_time_s=shutter_opening_time_s,
transmission_frac=-1,
transmission_fractions=transmission_fractions,
parameter_model_version=PARAM_MODEL_VERSION,
beamline="BL24I",
sample_id=0,
snapshot_directory=None,
)
yield from multi_rotation_plan_varying_transmission(composite, params)
3 changes: 3 additions & 0 deletions src/mx_bluesky/common/parameters/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DetectorParams,
TriggerMode,
)
from dodal.utils import get_beamline_name
from pydantic import (
BaseModel,
ConfigDict,
Expand All @@ -32,6 +33,8 @@

PARAMETER_VERSION = Version.parse("5.3.0")

BL = get_beamline_name("i03")


def get_param_version() -> SemanticVersion:
return SemanticVersion.validate_from_str(str(PARAMETER_VERSION))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ def test_rotation_scan_moves_beamstop_into_place(
MagicMock(),
)
@patch(
"mx_bluesky.hyperion.experiment_plans.rotation_scan_plan.setup_zebra_for_rotation"
"mx_bluesky.common.device_setup_plans.setup_zebra_and_shutter.setup_zebra_for_rotation"
)
def test_rotation_scan_plan_with_omega_flip_inverts_motor_movements_but_not_event_params(
mock_setup_zebra_for_rotation: MagicMock,
Expand Down
Loading
Loading