Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1149 from DiamondLightSource/1148_fix-CI-tests
Browse files Browse the repository at this point in the history
Fix failing CI tests due to DAQ config files
  • Loading branch information
d-perl authored Feb 14, 2024
2 parents 1add034 + a88fbaf commit 10e5573
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
xarray
doct
databroker
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@0dfcfc7cbb2f400cfc21d19f6371b9a22e347d7a
dls-dodal @ git+https://github.com/DiamondLightSource/dodal.git@5b8ef3e
pydantic<2.0 # See https://github.com/DiamondLightSource/hyperion/issues/774
scipy
pyzmq<25 # See https://github.com/DiamondLightSource/hyperion/issues/1103
Expand Down
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
RotationInternalParameters,
)

i03.DAQ_CONFIGURATION_PATH = "tests/test_data/test_daq_configuration"


def _destroy_loggers(loggers):
for logger in loggers:
Expand Down Expand Up @@ -267,18 +269,21 @@ def oav():
def flux():
return i03.flux(fake_with_ophyd_sim=True)


@pytest.fixture
def ophyd_pin_tip_detection():
RunEngine() # A RE is needed to start the bluesky loop
pin_tip_detection = i03.pin_tip_detection(fake_with_ophyd_sim=True)
return pin_tip_detection


@pytest.fixture
def robot():
robot = i03.robot(fake_with_ophyd_sim=True)
set_sim_value(robot.barcode.bare_signal, ["BARCODE"])
return robot


@pytest.fixture
def attenuator():
with patch(
Expand Down
140 changes: 140 additions & 0 deletions tests/test_data/test_daq_configuration/domain/beamlineParameters
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#
#
BeamLine BL03S

## Test data for device instantiation
BLSE=FB

## BPFB (Beam Position FeedBack)
## HALF (default) only off during data collection
## FULL only off for XBPM2 during attenuation optimisation, fluo when trans < 2% and wedged MAD
## UNAVAILABLE (not default) prevents xbpm_feedback.py trying to access EPICS IOC that may not be running
BPFB=FULL
## Note: only beamline scientists control whether feedback is enabled
## via the XBPM feedback EDM screen in Synoptic

# DCM parameters
DCM_Perp_Offset_FIXED = 25.6
#
# beamstop
#
parked_x = 4.49
parked_y = -50.0
parked_y_plate = -50.5
parked_z = -49.5
parked_z_robot = 30.0

in_beam_z_MIN_START_POS = 60.0


#Aperture - Scatterguard positions
# 100 micron ap
miniap_x_LARGE_APERTURE = 2.389
miniap_y_LARGE_APERTURE = 40.986
miniap_z_LARGE_APERTURE = 15.8

sg_x_LARGE_APERTURE = 5.25
sg_y_LARGE_APERTURE = 4.43

# 50 micron ap
miniap_x_MEDIUM_APERTURE = 2.384
miniap_y_MEDIUM_APERTURE = 44.967
miniap_z_MEDIUM_APERTURE = 15.8
sg_x_MEDIUM_APERTURE = 5.285
sg_y_MEDIUM_APERTURE = 0.46

# 20 micron ap
miniap_x_SMALL_APERTURE = 2.430
miniap_y_SMALL_APERTURE = 48.974
miniap_z_SMALL_APERTURE = 15.8
sg_x_SMALL_APERTURE = 5.3375
sg_y_SMALL_APERTURE = -3.55

# Robot load
miniap_x_ROBOT_LOAD = 2.386
miniap_y_ROBOT_LOAD = 31.40
miniap_z_ROBOT_LOAD = 15.8
sg_x_ROBOT_LOAD = 5.25
sg_y_ROBOT_LOAD = 4.43

# manual mount
miniap_x_MANUAL_LOAD = -4.91
miniap_y_MANUAL_LOAD = -49.0
miniap_z_MANUAL_LOAD = -10.0

sg_x_MANUAL_LOAD = -4.7
sg_y_MANUAL_LOAD = 1.8

miniap_x_SCIN_MOVE = -4.91
# prion setting
#miniap_x_SCIN_MOVE = 0.0
sg_x_SCIN_MOVE = -4.75

scin_y_SCIN_IN = 100.855
scin_y_SCIN_OUT = -0.02
scin_z_SCIN_IN = 101.5115


scin_z_SCIN_OUT = 0.1

#distance to move gonx,y,z when scintillator is put in with standard pins
# For old gonio:
gon_x_SCIN_OUT_DISTANCE = 1.0
# For SmarGon:
gon_x_SCIN_OUT_DISTANCE_smargon = 1

gon_y_SCIN_OUT_DISTANCE = 2.0
gon_z_SCIN_OUT_DISTANCE = -0.5

# StandardEnergy on i03 is 12700eV
StandardEnergy = 12700

keyence_max_attempts = 1
# Move gonio 100 microns, see difference in keyence values
# Then do 100/difference, put that number below
# Sign may change between Smargon and MiniKappa
keyence_slopeYToX = 2.5
keyence_slopeYToY = -2.5
keyence_slopeXToZ = 3.23

YAGSamX = 1022
YAGSamY = -98.0
YAGSamZ = -147
YAGOmega = 0.0

#ipin value must be < ipin_threshold above background for data collection
ipin_threshold = 0.1

# energy thresholds for mirror stripes
# - first threshold is between bare/Rh stripes (e.g. 7000)
# - second threshold is between Rh/Pt stripes (e.g. 18000)
mirror_threshold_bare_rh = 6900
mirror_threshold_rh_pt = 30000

# flux conversion factors
flux_factor_no_aperture = 1
flux_factor_LARGE_APERTURE = 0.738
flux_factor_MEDIUM_APERTURE = 0.36
flux_factor_SMALL_APERTURE = 0.084
flux_factor_no_aperture_plate = 1
flux_factor_LARGE_APERTURE_plate = 0.738
flux_factor_MEDIUM_APERTURE_plate = 0.36
flux_factor_SMALL_APERTURE_plate = 0.084

#Deadtime settings
fluorescence_analyser_deadtimeThreshold=0.002 # used by edge scans
fluorescence_spectrum_deadtimeThreshold=0.0005 # used by spectrum

#Other settings
fluorescence_attenuation_low_roi = 100
fluorescence_attenuation_high_roi = 2048
attenuation_optimisation_optimisation_cycles = 10
attenuation_optimisation_start_transmission = 0.1 # per cent
fluorescence_mca_sca_offset = 400

#Total count settings
attenuation_optimisation_multiplier = 2
attenuation_optimisation_target_count = 2000
attenuation_optimisation_upper_limit = 50000
attenuation_optimisation_lower_limit = 20000

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Bragg pitch
# Degree values for pitch are interpreted as mrad
# The values cannot change direction.
# last update 2023/06/26 NP
Units Deg mrad
Units Deg Deg
19.24347 -0.79775
16.40949 -0.78679
14.31123 -0.77838
12.69287 -0.77276
11.40555 -0.77276
10.35662 -0.77031
9.48522 -0.76693
8.95826 -0.76387
8.74953 -0.76387
8.12020 -0.76387
7.57556 -0.76354
7.09950 -0.76166
6.67997 -0.76044
6.30732 -0.75953
5.97411 -0.75845
5.67434 -0.75796
5.40329 -0.75789
5.15700 -0.75551
4.93218 -0.75513
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Bragg angle against roll( absolute number)
#reloadLookupTables()
# last update 2023/01/19 NP
Units Deg mrad
26.4095 -0.2799
6.3075 -0.2799

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import bluesky.preprocessors as bpp
import pytest
from bluesky.run_engine import RunEngine
from dodal.beamlines.i03 import DAQ_CONFIGURATION_PATH
from dodal.beamlines import i03
from dodal.devices.attenuator import Attenuator
from dodal.devices.DCM import DCM
from dodal.devices.flux import Flux
Expand Down Expand Up @@ -72,7 +72,7 @@ def fake_rotation_scan(
attenuator = make_fake_device(Attenuator)(name="attenuator")
flux = make_fake_device(Flux)(name="flux")
dcm = make_fake_device(DCM)(
name="dcm", daq_configuration_path=DAQ_CONFIGURATION_PATH
name="dcm", daq_configuration_path=i03.DAQ_CONFIGURATION_PATH
)

@bpp.subs_decorator(list(subscriptions))
Expand Down

0 comments on commit 10e5573

Please sign in to comment.