-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Problem: Remove unnecessary x and y arguments in 1D optimization routines
Description:
Currently, the black-box function zheight_tune in our 1D optimization routine calls:
tf_acquisition.move_stage_translation_absolute(x=x_old, y=y_old, z=z/1e6)This implies that x_old and y_old must be passed even though the optimization is only being performed over z. This is reflected in [MLlayerBO.py](https://github.com/pycroscopy/pyAutoMic/blob/main/TEM/stemOrchestrator/stemOrchestrator/MLlayer/MLlayerBO.py#L2), specifically in the Tune1d class:
def _acquire_data(self, x):
result = self.python_command(self.old_x, self.old_y, x.item())
return resultHowever, in cases like defocus tuning, where we use:
tf_acquisition.microscope.optics.defocus = z / 1e6there is no need to pass x and y at all. Still, the Tune1d class requires those parameters, which makes the interface unnecessarily rigid and confusing for use cases that do not involve x or y movements.
Suggested Fix:
- Refactor
Tune1dand similar routines to allow optionalxandyarguments. - Update
python_commandcalls accordingly, using only relevant parameters for the specific optimization. - Ensure backward compatibility where
x,y, andzstage control is required.
Metadata
Metadata
Assignees
Labels
No labels