fix: make xraycenter line scan on box center and twice box height
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 46s
CI / test (3.12) (pull_request) Successful in 1m3s
CI / test (3.14) (pull_request) Successful in 1m8s
CI / test (3.13) (pull_request) Successful in 1m12s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m12s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m24s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m28s
CI / test-with-coverage (pull_request) Successful in 1m38s
CI / coverage-analysis (pull_request) Failing after 4s
CI / lint (push) Skipped
CI / test (3.12) (push) Skipped
CI / test (3.13) (push) Skipped
CI / test-with-beamline-plugins (pxi_bec) (push) Skipped
CI / test-with-beamline-plugins (pxii_bec) (push) Skipped
CI / test-with-beamline-plugins (pxiii_bec) (push) Skipped
CI / lint (pull_request) Failing after 46s
CI / test (3.12) (pull_request) Successful in 1m3s
CI / test (3.14) (pull_request) Successful in 1m8s
CI / test (3.13) (pull_request) Successful in 1m12s
CI / test-with-beamline-plugins (pxi_bec) (pull_request) Successful in 1m12s
CI / test-with-beamline-plugins (pxii_bec) (pull_request) Successful in 1m24s
CI / test-with-beamline-plugins (pxiii_bec) (pull_request) Successful in 1m28s
CI / test-with-coverage (pull_request) Successful in 1m38s
CI / coverage-analysis (pull_request) Failing after 4s
This commit is contained in:
@@ -246,28 +246,18 @@ class RasterService:
|
||||
target_point=prediction_result.target_point,
|
||||
focus=prediction_result.focus,
|
||||
)
|
||||
target_point = prediction_result.target_point
|
||||
|
||||
prediction_box = prediction_result.box
|
||||
|
||||
if y_padding_fraction_each_side is None:
|
||||
local_contact_config = self.ctx.deps.cfg.local_contact_config
|
||||
prediction_type = getattr(prediction_box, "type", None)
|
||||
if prediction_box is not None:
|
||||
box_y_height_px = abs(prediction_box.box.bottom_y - prediction_box.box.top_y)
|
||||
box_y_center_px = prediction_box.box.top_y + box_y_height_px / 2
|
||||
else:
|
||||
box_y_center_px = None
|
||||
|
||||
if prediction_type == MLBoxType.LOOP_FACE:
|
||||
y_padding_fraction_each_side = (
|
||||
local_contact_config.line_scan_loop_face_y_padding_fraction_each_side
|
||||
)
|
||||
elif prediction_type == MLBoxType.LOOP_ALL:
|
||||
y_padding_fraction_each_side = (
|
||||
local_contact_config.line_scan_loop_all_y_padding_fraction_each_side
|
||||
)
|
||||
else:
|
||||
y_padding_fraction_each_side = float(
|
||||
cfg_get("daq.auto_raster.line_scan_y_padding_fraction", 0.15)
|
||||
)
|
||||
|
||||
if target_point is not None:
|
||||
target_y_pxl = target_point[1]
|
||||
if box_y_center_px is not None:
|
||||
target_y_pxl = box_y_center_px
|
||||
y_delta_mm = abs(target_y_pxl - beam_y_pxl) * geom.pixel_in_mm
|
||||
|
||||
if y_retarget_threshold_mm is None:
|
||||
@@ -323,9 +313,9 @@ class RasterService:
|
||||
|
||||
if prediction_box is not None and prediction_box.box is not None and grid_size_mm.y > 0:
|
||||
box_height_pxl = abs(prediction_box.box.bottom_y - prediction_box.box.top_y)
|
||||
padded_height_mm = (
|
||||
box_height_pxl * geom.pixel_in_mm * (1.0 + 2.0 * y_padding_fraction_each_side)
|
||||
)
|
||||
padded_height_px = box_height_pxl * 2
|
||||
padded_height_mm = padded_height_px* geom.pixel_in_mm
|
||||
|
||||
n_y = max(1, ceil(padded_height_mm / grid_size_mm.y))
|
||||
self.logger.info(
|
||||
"Computed second auto-center raster y size from ML box height",
|
||||
|
||||
Reference in New Issue
Block a user