|
13 | 13 | class Xia2OverloadWrapper(Wrapper): |
14 | 14 | _logger_name = "dlstbx.wrap.xia2_overload" |
15 | 15 |
|
16 | | - def send_to_ispyb(self, transmission): |
17 | | - ispyb_command_list = [] |
18 | | - |
19 | | - d = { |
20 | | - "program": "xia2.overload", |
21 | | - "ispyb_command": "insert_screening_output", |
22 | | - "screening_id": "$ispyb_screening_id", |
23 | | - "store_result": "ispyb_screening_output_id", |
24 | | - } |
25 | | - ispyb_command_list.append(d) |
26 | | - |
27 | | - d = { |
28 | | - "ispyb_command": "insert_screening_strategy", |
29 | | - "transmission": transmission, |
30 | | - "screening_output_id": "$ispyb_screening_output_id", |
31 | | - "store_result": "ispyb_screening_strategy_id", |
32 | | - } |
33 | | - ispyb_command_list.append(d) |
34 | | - |
35 | | - d = { |
36 | | - "ispyb_command": "insert_screening_strategy_wedge", |
37 | | - "screening_strategy_id": "$ispyb_screening_strategy_id", |
38 | | - "store_result": "ispyb_screening_strategy_wedge_id", |
39 | | - } |
40 | | - ispyb_command_list.append(d) |
41 | | - |
42 | | - d = { |
43 | | - "ispyb_command": "insert_screening_strategy_sub_wedge", |
44 | | - "transmission": transmission, |
45 | | - "screening_strategy_wedge_id": "$ispyb_screening_strategy_wedge_id", |
46 | | - "store_result": "ispyb_screening_strategy_sub_wedge_id", |
47 | | - } |
48 | | - ispyb_command_list.append(d) |
49 | | - |
50 | | - d = { |
51 | | - "ispyb_command": "update_processing_status", |
52 | | - "program_id": "$ispyb_autoprocprogram_id", |
53 | | - "message": "Processing successful", |
54 | | - "status": "success", |
55 | | - } |
56 | | - ispyb_command_list.append(d) |
57 | | - |
58 | | - self.recwrap.send_to("ispyb", {"ispyb_command_list": ispyb_command_list}) |
59 | | - self.log.info("Sent %d commands to ISPyB", len(ispyb_command_list)) |
60 | | - self.log.debug("Sending %s", json.dumps(ispyb_command_list, indent=2)) |
61 | | - |
62 | 16 | def run(self): |
63 | 17 | assert hasattr(self, "recwrap"), "No recipewrapper object found" |
64 | 18 |
|
@@ -121,9 +75,9 @@ def run(self): |
121 | 75 | saturation = (max_count / overload_limit) * average_to_peak |
122 | 76 | scale_factor = target_countrate_pct / saturation |
123 | 77 |
|
124 | | - scaled_transmission = transmission * scale_factor |
125 | | - self.send_to_ispyb(min(100, scaled_transmission)) |
| 78 | + scaled_transmission = min(1, ( transmission * scale_factor ) / 100) |
126 | 79 |
|
| 80 | + self.recwrap.send_to("strategy", {"parameters": {"scaled_transmission": scaled_transmission}}) |
127 | 81 | self.log.info("Done.") |
128 | 82 | return True |
129 | 83 |
|
|
0 commit comments