def calibrate(self):
        self.updateROI()
        self.checkFourierFilter()

        controlMatrix = self.proxy.calibrate(numPokeSteps=5)
        userConfig.setValue("dm_controlMatrix",
                            np.ndarray.tolist(controlMatrix))
    def sysFlatCalc(self):
        self.updateROI()
        self.checkFourierFilter()
        self.checkIfCalibrated()

        z_ignore = np.zeros(self.no_actuators)
        if self.sysFlatNollZernike is not None:
            z_ignore[self.sysFlatNollZernike - 1] = 1
        sys_flat_values, best_z_amps_corrected = self.proxy.flatten_phase(
            iterations=self.sys_flat_num_it,
            error_thresh=self.sys_error_thresh,
            z_modes_ignore=z_ignore,
        )

        userConfig.setValue("dm_sys_flat", np.ndarray.tolist(sys_flat_values))
        return sys_flat_values, best_z_amps_corrected
    def characterise(self):
        self.updateROI()
        self.checkFourierFilter()
        self.checkIfCalibrated()
        assay = self.proxy.assess_character()

        if np.mean(assay[1:, 1:]) < 0:
            controlMatrix = self.proxy.get_controlMatrix()
            self.proxy.set_controlMatrix((-1 * controlMatrix))
            assay = assay * -1
            userConfig.setValue("dm_controlMatrix",
                                np.ndarray.tolist(controlMatrix))

        # The default system corrections should be for the zernike
        # modes we can accurately recreate.
        self.sysFlatNollZernike = ((np.diag(assay) > 0.75).nonzero()[0]) + 1

        return assay
 def OnSave(self, event: wx.CommandEvent) -> None:
     del event
     roi = [x * self._scale_factor for x in self.ROI]
     userConfig.setValue("dm_circleParams", (roi[1], roi[0], roi[2]))
Example #5
0
 def SavedBottom(self, pos: float) -> None:
     userConfig.setValue('savedBottom', pos)
     self._saved_bottom = pos
     events.publish(events.STAGE_TOP_BOTTOM)
Example #6
0
 def SavedTop(self, pos: float) -> None:
     userConfig.setValue('savedTop', pos)
     self._saved_top = pos
     events.publish(events.STAGE_TOP_BOTTOM)