def find_mlc_peak(self, mlc_center): """Determine the center of the picket.""" mlc_rows = np.arange(mlc_center - self.sample_width, mlc_center + self.sample_width + 1) if self.settings.orientation == orientations['UD']: pix_vals = np.median(self.picket_array[mlc_rows, :], axis=0) else: pix_vals = np.median(self.picket_array[:, mlc_rows], axis=1) if max(pix_vals) > np.percentile(self.picket_array, 80): prof = SingleProfile(pix_vals) fw80mc = prof.get_FWXM_center(70, interpolate=True) return fw80mc + self.approximate_idx - self.spacing
def _determine_center(self, plane): """Automatically find the center of the field based on FWHM.""" if not self._img_is_loaded: raise AttributeError("An image has not yet been loaded") self.check_inversion() self.ground() col_prof = np.median(self.array, 0) col_prof = SingleProfile(col_prof) row_prof = np.median(self.array, 1) row_prof = SingleProfile(row_prof) x_cen = col_prof.get_FWXM_center(round=True) y_cen = row_prof.get_FWXM_center(round=True) if _is_crossplane(plane): return y_cen elif _is_inplane(plane): return x_cen elif _is_both_planes(plane): return y_cen, x_cen