def get_detector(self, id): """Get detector by id""" dcfg = Detector(self, id) rows = dcfg.get('pixels:rows', default=Detector.nrows_DFLT) cols = dcfg.get('pixels:columns', default=Detector.ncols_DFLT) pixel_size = dcfg.get('pixels:size', default=Detector.pixel_size_DFLT) saturation_level = dcfg.get('saturation_level', default=Detector.saturation_level_DFLT) tvec = dcfg.get('transform:t_vec_d', default=Detector.t_vec_d_DFLT) tilt = dcfg.get('transform:tilt_angles', default=Detector.tilt_angles_DFLT) bvec = self.beam.vector evec = self._cfg.get('eta_vec', default=constants.eta_vec) # Distortion # FIXME: DISTORTION KLUDGE dparams = dcfg.get('distortion:parameters', default=None) distortion = (dfunc, dparams) if dparams is not None else None d = instrument.PlanarDetector(rows=rows, cols=cols, pixel_size=pixel_size, tvec=tvec, tilt=tilt, bvec=bvec, evec=evec, saturation_level=saturation_level, distortion=distortion) return d
def display_panel(self, sizes, mps): del_x = sizes[0] del_y = sizes[1] ncols_map = int(del_x/mps) nrows_map = int(del_y/mps) display_panel = instrument.PlanarDetector( rows=nrows_map, cols=ncols_map, pixel_size=(mps, mps), tvec=self.tvec, tilt=self.tilt) return display_panel