Skip to content

[Dark Request]Add support for MyMDC operation modes

Cyril Danilevski requested to merge fix/209 into master

Description

This is the first of 3 PRs to bring darks operation mode to xfel-calibrate (ticket).
In the first PR, webservice.py will support the new request parameters.
In the second PR, the notebooks will be updated accordingly. In the third PR, an end to end refactoring will be done to clear temporary hacks.

How Has This Been Tested?

This is being tested first with the script below, and with the test MyMDC installation (CALLAB run 9983).

import zmq

con = zmq.Context()
socket = con.socket(zmq.REQ)
con = socket.connect("tcp://max-exfl017:5555")

action = 'dark_request'
dark_run_id = '192'
sase = 'sase1'
instrument = 'CALLAB'
cycle = '202031'
proposal = '900113'
detector_id = 'SPB_DET_AGIPD1M-1'
pdu_physical_names = '["AGIPD00 (Q1M1)"', '"AGIPD01 (Q1M2)"', '"AGIPD02 (Q1M3)"', '"AGIPD03 (Q1M4)"', '"AGIPD04 (Q2M1)"', '"AGIPD05 (Q2M2)"', '"AGIPD06 (Q2M3)"', '"AGIPD07 (Q2M4)"', '"AGIPD08 (Q3M1)"', '"AGIPD09 (Q3M2)"', '"AGIPD10 (Q3M3)"', '"AGIPD11 (Q3M4)"', '"AGIPD12 (Q4M1)"', '"AGIPD13 (Q4M2)"', '"AGIPD14 (Q4M3)"', '"AGIPD15 (Q4M4)"]'
pdu_karabo_das = '["AGIPD00"', ' "AGIPD01"', ' "AGIPD02"', ' "AGIPD03"', ' "AGIPD04"', ' "AGIPD05"', ' "AGIPD06"', ' "AGIPD07"', ' "AGIPD08"', ' "AGIPD09"', ' "AGIPD10"', ' "AGIPD11"', ' "AGIPD12"', ' "AGIPD13"', ' "AGIPD14"', ' "AGIPD15"]'
operation_mode = 'FIXED_GAIN'
run_numbers = '[9983]'


data = [action, dark_run_id, sase, instrument, cycle, proposal, detector_id,
        operation_mode, *pdu_physical_names, *pdu_karabo_das, run_numbers]

socket.send(str(data).encode())
resp = socket.recv_multipart()[0]
print(resp.decode())

Types of changes

  • New feature (non-breaking change which adds functionality)
  • new dark_request messages are handled and parsed;
  • xfel-calibrate command created;
  • calibration jobs are submitted;
  • feedback to MyMDC is done;

Note: As only a single run is provided, but three need to be passed to the notebook, the agreement is that run-high represents the run to correct, run-med and run-low are phony

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Reviewers

@ahmedk @hammerd @roscar

I made flake changes that went beyond the immediate need, and that adds noise to the MR.
If it's too much, let me know and I'll revert what's not needed for it.

Edited by Philipp Schmidt

Merge request reports