Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for recent MO PR #689

Merged
merged 4 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mxcubecore/HardwareObjects/ALBA/ALBACollect.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ def write_image_headers(self, start_angle):
)
self.image_headers["Detector_Voffset"] = "0 m"

# NBNB TODO check if get_beam_position() (should be pixels)
# matches beamx, beamy (should be mm)
beamx, beamy = HWR.beamline.detector.get_beam_position()
self.image_headers["Beam_xy"] = "(%.2f, %.2f) pixels" % (beamx, beamy)

Expand Down
3 changes: 3 additions & 0 deletions mxcubecore/HardwareObjects/ALBA/ALBAPilatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def has_shutterless(self):

def get_beam_position(self, distance=None, wavelength=None):
"""Returns beam center coordinates"""

# NBNB TODO check if pixels or mm, and adjust code
# Should be pixels
beam_x = 0
beam_y = 0
try:
Expand Down
9 changes: 6 additions & 3 deletions mxcubecore/HardwareObjects/EMBLFlexHCD.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ def load(self, sample):
res = SampleChanger.load(self, sample)
finally:
for msg in self.get_robot_exceptions():
logging.getLogger("HWR").error(msg)
if msg is not None:
logging.getLogger("HWR").error(msg)

if res:
self.prepare_centring()
Expand Down Expand Up @@ -541,7 +542,8 @@ def _do_load(self, sample=None):
gevent.sleep(2)

for msg in self.get_robot_exceptions():
logging.getLogger("HWR").error(msg)
if msg is not None:
logging.getLogger("HWR").error(msg)

return self._set_loaded_sample_and_prepare(loaded_sample, previous_sample)

Expand All @@ -559,7 +561,8 @@ def _do_unload(self, sample=None):
)

for msg in self.get_robot_exceptions():
logging.getLogger("HWR").error(msg)
if msg is not None:
logging.getLogger("HWR").error(msg)

if loaded_sample == (-1, -1, -1):
self._reset_loaded_sample()
Expand Down
2 changes: 1 addition & 1 deletion mxcubecore/HardwareObjects/ISPyBRestClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def get_dc(self, dc_id):
response = json.loads(get(url).text)[0]
except Exception as ex:
response = None
logging.getLogger("ispyb_client").exception(str(ex))
# logging.getLogger("ispyb_client").exception(str(ex))

lims_dc = {}
lims_dc["workflow_result_url_list"] = []
Expand Down
4 changes: 2 additions & 2 deletions mxcubecore/HardwareObjects/LimaEigerDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def prepare_acquisition(

beam_x, beam_y = HWR.beamline.detector.get_beam_position()
header_info = [
"beam_center_x=%s" % (beam_x / 7.5000003562308848e-02),
"beam_center_y=%s" % (beam_y / 7.5000003562308848e-02),
"beam_center_x=%s" % (beam_x),
"beam_center_y=%s" % (beam_y),
"detector_distance=%s"
% (HWR.beamline.detector.distance.get_value() / 1000.0),
"omega_start=%0.4f" % start,
Expand Down
4 changes: 2 additions & 2 deletions mxcubecore/HardwareObjects/LimaPilatusDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def prepare_acquisition(
self.header["Transmission"] = HWR.beamline.transmission.get_value()

self.header["Flux"] = HWR.beamline.flux.get_value()
self.header["Beam_xy"] = "(%.2f, %.2f) pixels" % tuple(
[value / 0.172 for value in HWR.beamline.detector.get_beam_position()]
self.header["Beam_xy"] = (
"(%.2f, %.2f) pixels" % HWR.beamline.detector.get_beam_position()
)
self.header["Detector_Voffset"] = "0.0000 m"
self.header["Energy_range"] = "(0, 0) eV"
Expand Down
5 changes: 3 additions & 2 deletions mxcubecore/HardwareObjects/abstract/AbstractCollect.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,9 @@ def update_data_collection_in_lims(self):
params["resolution"] = HWR.beamline.resolution.get_value()
params["transmission"] = HWR.beamline.transmission.get_value()
beam_centre_x, beam_centre_y = HWR.beamline.detector.get_beam_position()
params["xBeam"] = beam_centre_x
params["yBeam"] = beam_centre_y
pixel_x, pixel_y = self.get_pixel_size()
params["xBeam"] = beam_centre_x * pixel_x
params["yBeam"] = beam_centre_y * pixel_y
und = self.get_undulators_gaps()
i = 1
for jj in self.bl_config.undulators:
Expand Down
11 changes: 8 additions & 3 deletions mxcubecore/HardwareObjects/queue_model_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2159,9 +2159,7 @@ def set_pre_strategy_params(
distance = HWR.beamline.resolution.resolution_to_distance(
resolution, wavelength
)
orgxy = HWR.beamline.detector.get_beam_position(
distance, wavelength
)
orgxy = HWR.beamline.detector.get_beam_position(distance, wavelength)

self.detector_setting = GphlMessages.BcsDetectorSetting(
resolution, orgxy=orgxy, Distance=distance
Expand Down Expand Up @@ -2500,6 +2498,13 @@ def get_files_to_be_written(self):
return self.acquisitions[0].path_template.get_files_to_be_written()


def addXrayCentring(parent_node, **centring_parameters):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I thought you wanted to remove this function ?

"""Add Xray centring to queue."""
xc_model = XrayCentring2(**centring_parameters)
HWR.beamline.queue_model.add_child(parent_node, xc_model)
#
return xc_model

#
# Collect hardware object utility function.
#
Expand Down
73 changes: 0 additions & 73 deletions mxcubecore/configuration/esrf_id30a2/gphl-setup.xml

This file was deleted.

91 changes: 91 additions & 0 deletions mxcubecore/configuration/esrf_id30a2/gphl-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

_initialise_class:
class: mxcubecore.HardwareObjects.GphlWorkflowConnection.GphlWorkflowConnection

directory_locations:
# Directory locations. Can also be used with ${} syntax in this file
GPHL_INSTALLATION: /users/blissadm/applications/GPhL_WorkFlow_beta-academic_20220601
# GPHL_WRAPPERS: /data/users/p3l-gleb1/gphl/


# If set, run workflow through ssh with selected options
# and quote parameters as appropriate
# NB The Host option is mandatory
# ConfigFile is the ssh configuration file, passed to ssh with the -F option
#ssh_options:
# Host: lonsdale
# IdentityFile: /home/rhfogh/.ssh/wf_test_id
# User: rhfogh
# StrictHostKeyChecking: no
# ConfigFile: /path/to/ssh/config/file

# Directory used for GPhL workflow persistence data and workflow logs:
# Used to set the wdir workflow option
# If relative designates a subdirectory under Session.get_process_directory()
# If absolute taken as it stands
gphl_subdir: GPHL
# root name of persistence layer file; suffix'.xml. is added
gphl_persistname: persistence

#Hosts and ports for py4j java-python gateway, all OPTIONAL
#If not set will use py4j default values, which are as given below
#NB python_host is set automatically to localhost or socket.gethostname()
#NB java_host is not needed as all communication is effectively one-way
#connection_parameters:
# python_port: 25334
# java_port: 25333

#NB Non-absolute file names are interpreted relative to one of the
#HardwareRepository directories on the lookup path

software_paths:
# Mandatory. Directory with workflow config input, e.g. instrumentation.nml
gphl_beamline_config: gphl/config_esrf_id30a1

# MANDATORY for CCP4 => $GPHL_CCP4_PATH/bin/ccp4.setup-sh,
# unless already sourced in environment
GPHL_CCP4_PATH: /opt/pxsoft/ccp4/v7.1/ubuntu20.04-x86_64/ccp4-7.1/bin

# MANDATORY for XDS => $GPHL_XDS_PATH/xds_par
# unless already sourced in environment
GPHL_XDS_PATH: /opt/pxsoft/bin

GPHL_INSTALLATION: /home/opid30/GPhL_WorkFlow_beta-academic

# OPTIONAL for java binary => defaults to just 'java'
# java_binary: "/alt/rhfogh/Software/GPhL/mxcube_setup/jre1.8.0_144/bin/java"

# gphl test samples directory - for collection emulation
# gphl_test_samples: gphl/test_samples

#Location of installation used for processing queue (if not reachable from BCS computer.
#Passed as environmental variable GPHL_PROC_INSTALLATION. Optional
# gphl_wf_processing_installation: /users/pkeller/GPhL-ESRF/exe

# Software paths that are passed to global phasing workflow as java properties
# Used to specify locations of alternative executables (wrappers)
# More (unused) properties are described in the ASTRA workflow documentation
software_properties:
#Location of GPhL .license directory
#defaults to GPHL_INSTALLATION
#Only needed if you do NOT use the gphl installation wrapper scripts in .../exe :
# co.gphl.wf.bdg_licence_dir: "{GPHL_RELEASE}/gphl_release/latest"

# MANDATORY pending change in workflow
co.gphl.wf.stratcal.bin: "{GPHL_INSTALLATION}/exe/run_stratcal_wrap.py"

# OPTIONAL location of alternative executables (wrappers) supported by the workflow
# Each has an option (rarely used) to specify a specific license directory -->
# co.gphl.wf.process.bin: {GPHL_WRAPPERS}/scripts/aP_wf_process
# co.gphl.wf.process.bdg_licence_dir/fill/me/in
# co.gphl.wf.diffractcal.bin: {GPHL_WRAPPERS}/scripts/aP_wf_rotcal
# co.gphl.wf.diffractcal.bdg_licence_dir/fill/me/in
# co.gphl.wf.simcal_predict.bin: {GPHL_WRAPPERS}/scripts/simcal_predict
# co.gphl.wf.simcal_predict.bdg_licence_dir/fill/me/in
# co.gphl.wf.transcal.bin: {GPHL_WRAPPERS}/scripts/transcal
# co.gphl.wf.transcal.bdg_licence_dir/fill/me/in
# co.gphl.wf.recen.bin: {GPHL_WRAPPERS}/scripts/recen
# co.gphl.wf.recen.bdg_licence_dir/fill/me/in

# OPTIONAL. simcal *binary* For Mock collection emulation only. Not used by ASTRA workflow
# co.gphl.wf.simcal.bin: "{GPHL_INSTALLATION}/autoPROC/bin/linux64/simcal"
Loading