Sample view REST API#
- GET /mxcube/api/v0.1/sampleview/camera/subscribe#
- Subscribe to the camera streaming
- response:
image as html Content-type
- PUT /mxcube/api/v0.1/sampleview/camera/unsubscribe#
- SampleCentring: unsubscribe from the camera streaming
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/camera/save#
Save snapshot of the sample view data = {generic_data, “Path”: path} # not sure if path should be available, or directly use the user/proposal path Return: ‘True’ if command issued succesfully, otherwise ‘False’.
- GET /mxcube/api/v0.1/sampleview/camera#
- Get size of the image of the diffractometer
- response Content-type:application/json, example:
{ “imageHeight”: 576, “imageWidth”: 768, “pixelsPerMm”: [1661.1295681063123, 1661.1295681063123] } :statuscode: 200: no error :statuscode: 409: error
- POST /mxcube/api/v0.1/sampleview/camera#
- PUT /mxcube/api/v0.1/sampleview/centring/(point_id)/moveto#
- Move to the given centred position.
- parameter id:
centred position identifier, integer
- statuscode:
200: no error
- statuscode:
409: error
- GET /mxcube/api/v0.1/sampleview/shapes#
- Retrieve all the stored centred positions.
- response Content-type:
application/json, the stored centred positions.
- statuscode:
200: no error
- statuscode:
409: error
- GET /mxcube/api/v0.1/sampleview/shapes/(sid)#
- Retrieve requested shape information.
- response Content-type:
application/json, the stored centred positions.
- statuscode:
200: no error
- statuscode:
409: shape not found
- POST /mxcube/api/v0.1/sampleview/shapes/(sid)#
- Update cell result data.
- parameter shape_data:
dict with result info (cell number, result value)
- response Content-type:
application/json, response status.
- statuscode:
200: no error
- statuscode:
409: error
- POST /mxcube/api/v0.1/sampleview/shapes#
- Update shape information.
- parameter shape_data:
dict with shape information (id, type, …)
- response Content-type:
application/json, the stored centred positions.
- statuscode:
200: no error
- statuscode:
409: error
- DELETE /mxcube/api/v0.1/sampleview/shapes/(sid)#
- Retrieve all the stored centred positions.
- response Content-type:
application/json, the stored centred positions.
- statuscode:
200: no error
- statuscode:
409: error
- POST /mxcube/api/v0.1/sampleview/shapes/rotate_to#
Rotate Phi to the position where the given shape was defined
- parameter sid:
The shape id
- response Content-type:
application/json, the stored centred positions.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/zoom#
- Move the zoom motor.
- request Content-type:
application/json, new position {‘level’: 4}.
Note: level specified as integer (not ‘Zoom 4’) :response Content-type: application/json, new scale value, example: {“pixelsPerMm”: [ 1661.1, 1661.1]} :statuscode: 200: no error :statuscode: 409: error
- PUT /mxcube/api/v0.1/sampleview/backlighton#
- Activate the backlight of the diffractometer.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/backlightoff#
- Switch off the backlight of the diffractometer.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/frontlighton#
- Activate the frontlight of the diffractometer.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/frontlightoff#
- Switch off the frontlight of the diffractometer.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/(motid)/(newpos)#
Move or Stop the given motor. :parameter motid: motor name, ‘Phi’, ‘Focus’, ‘PhiZ’, ‘PhiY’, ‘Zoom’, ‘BackLightSwitch’,’BackLight’,’FrontLightSwitch’, ‘FrontLight’, ‘Sampx’, ‘Sampy’ :parameter newpos: new position, double, stop: string :statuscode: 200: no error :statuscode: 409: error
- GET /mxcube/api/v0.1/sampleview/centring/startauto#
- Start automatic (lucid) centring procedure.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/centring/start3click#
- Start 3 click centring procedure.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/centring/abort#
- Abort centring procedure.
- statuscode:
200: no error
- statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/centring/click#
The 3-click method needs the input from the user, a running 3click centring procedure must be set before
- Request Content-type:
application/json, integer positions of the clicks, {clickPos={“x”: 123,”y”: 456}}
- Response Content-type:
application/json, integer, number of clicks left {‘clickLeft’: 3 | 2 | 1}
- Statuscode:
200: no error
- Statuscode:
409: error
- PUT /mxcube/api/v0.1/sampleview/centring/accept#
Accept the centring position.
- PUT /mxcube/api/v0.1/sampleview/centring/reject#
Reject the centring position.
- PUT /mxcube/api/v0.1/sampleview/movetobeam#
Go to the beam position from the given (x, y) position.
- PUT /mxcube/api/v0.1/sampleview/centring/centring_method#
Set MXCuBE to use automatic (lucid) centring procedure when mounting samples
- Statuscode:
200: no error
- Statuscode:
409: error