Skip to content

Commit

Permalink
Changed inconsistent parameter name 'exposure' to 'exposure_time'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhfogh committed Feb 16, 2024
1 parent 40f58a1 commit b51c6e4
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions mxcubecore/HardwareObjects/Gphl/GphlWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ def query_collection_strategy(self, geometric_strategy):
"default": str(default_image_width),
"enum": list(str(val) for val in allowed_widths)
}
fields["exposure"] = {
fields["exposure_time"] = {
"title": "Exposure Time (s)",
"type": "number",
"default": default_exposure,
Expand Down Expand Up @@ -1224,12 +1224,12 @@ def query_collection_strategy(self, geometric_strategy):
"column1": {
"ui:order": [
"use_dose",
"exposure",
"exposure_time",
"image_width",
"transmission",
"snapshot_count",
],
"exposure": {
"exposure_time": {
"ui:options": {
"update_on_change": True,
"decimals": 4,
Expand Down Expand Up @@ -1326,7 +1326,7 @@ def query_collection_strategy(self, geometric_strategy):
else:
image_width = self.settings.get("default_image_width", default_image_width)
result[tag] = image_width
# exposure OK as is
# exposure_time OK as is
tag = "repetition_count"
result[tag] = int(result.get(tag) or 1)
tag = "transmission"
Expand Down Expand Up @@ -1447,7 +1447,7 @@ def setup_data_collection(self, payload, correlation_id):
if transmission > 100:
if gphl_workflow_model.characterisation_done or wftype == "diffractcal":
# We are not in characterisation.
# Try to reset exposure time to get desired dose
# Try to reset exposure_time to get desired dose
exposure_time = (
gphl_workflow_model.exposure_time * transmission / 100
)
Expand Down Expand Up @@ -2732,7 +2732,7 @@ def receive_pre_collection_data(self, instruction, parameters):
update_dict = self.adjust_transmission(parameters)
elif instruction in (
"image_width",
"exposure",
"exposure_time",
"repetition_count",
"transmission",
):
Expand Down Expand Up @@ -2838,10 +2838,10 @@ def update_indexing_solution(self, values):
return result

def adjust_dose(self, values):
"""When transmission, image_width, exposure or repetition_count changes,
"""When transmission, image_width, exposure_time or repetition_count changes,
update experiment_time and use_dose in parameter popup, and reset warnings"""
data_model = self._queue_entry.get_data_model()
exposure_time = float(values.get("exposure", 0))
exposure_time = float(values.get("exposure_time", 0))
image_width = float(values.get("image_width", 0))
transmission = float(values.get("transmission", 0))
dose_budget = float(values.get("dose_budget", 0))
Expand Down Expand Up @@ -2878,7 +2878,7 @@ def adjust_transmission(self, values):
In parameter popup"""
data_model = self._queue_entry.get_data_model()
exposure_limits = HWR.beamline.detector.get_exposure_time_limits()
exposure_time = float(values.get("exposure", 0))
exposure_time = float(values.get("exposure_time", 0))
image_width = float(values.get("image_width", 0))
use_dose = float(values.get("use_dose", 0))
dose_budget = float(values.get("dose_budget", 0))
Expand All @@ -2897,7 +2897,7 @@ def adjust_transmission(self, values):
new_transmission = 100 * use_dose / maximum_dose

if new_transmission > 100.0:
# Transmission too high. Try max transmission and longer exposure
# Transmission too high. Try max transmission, longer exposure_time
new_exposure_time = exposure_time * new_transmission / 100
new_transmission = 100.0
max_exposure = exposure_limits[1]
Expand All @@ -2911,13 +2911,13 @@ def adjust_transmission(self, values):
exposure_time=new_exposure_time, image_width=image_width
)
result = {
"exposure": {"value": new_exposure_time,},
"exposure_time": {"value": new_exposure_time,},
"transmission": {"value": new_transmission,},
"use_dose": {"value": use_dose,},
"experiment_time": {"value": new_experiment_time,},
}
elif new_transmission < transmission:
# Try reducing exposure time instead
# Try reducing exposure_time time instead
new_exposure_time = exposure_time * new_transmission / transmission
new_transmission = transmission
min_exposure = exposure_limits[0]
Expand All @@ -2929,7 +2929,7 @@ def adjust_transmission(self, values):
new_exposure_time = min_exposure
result = {
"transmission": {"value":new_transmission},
"exposure": {"value":new_exposure_time},
"exposure_time": {"value":new_exposure_time},
}
else:
result = {"transmission": {"value":new_transmission}}
Expand Down

0 comments on commit b51c6e4

Please sign in to comment.