def doCalibration(self, calibrant='Si', calibrant_x=0, calibrant_y=0, calibrant_exposure=1.0): if self.calibration_required: mycalibrant=Finder.getInstance().find("calibrant_name") mycalibrant.moveTo(calibrant) dummyScannable=DummyScannable("dummyScannable") #additional_plugin_list = pixium.getAdditionalPluginList()[0] #Detector calibration if self.calibration_required: self.stage_x.moveTo(calibrant_x) self.stage_y.moveTo(calibrant_y) scan([dummyScannable, 1, 1, 1, self.pixium, calibrant_exposure]) #TODO GDA .nxs file, not EPICS h5 file scan_data_point_provider = InterfaceProvider.getScanDataPointProvider() self.calibrant_file_name = scan_data_point_provider.getLastScanDataPoint().getCurrentFilename() #calibrant_file_name = additional_plugin_list.getFullFileName() #do detector calibration on cluster serevrs builder = OSCommandRunnerBuilder.defaults() builder=builder.command([LocalProperties.get("org.opengda.lde.pixium.data.reduction.script","/dls_sw/apps/i11-scripts/bin/LDE-RunFromGDAAtEndOfScan.sh")]) builder=builder.keepOutput(True) builder = builder.inputFilename(self.calibrant_file_name) builder = builder.outputFilename(os.path.splitext(self.calibrant_file_name)[0]+"_output.log") builder=builder.noTimeout() builder.build() self.calibration_required=False
def doSampleDataCollection(self, sample_x_start=None, sample_x_stop=None, sample_x_step=None, sample_y_start=None, sample_y_stop=None, sample_y_step=None, sample_exposure=1.0): # sample diffraction data args=[] if sample_x_start is not None or sample_x_stop is not None or sample_x_step is not None: args.append(self.stage_x) if sample_y_start is not None: args.append(sample_x_start) if sample_y_stop is not None: args.append(sample_x_stop) if sample_y_step is not None: args.append(sample_x_step) if sample_y_start is not None or sample_y_stop is not None or sample_y_step is not None: args.append(self.stage_y) if sample_y_start is not None: args.append(sample_y_start) if sample_y_stop is not None: args.append(sample_y_stop) if sample_y_step is not None: args.append(sample_y_step) if args.count!=0: args.append(self.pixium) args.append(sample_exposure) scan(args) #sample_file_name = additional_plugin_list.getFullFileName() scan_data_point_provider = InterfaceProvider.getScanDataPointProvider() sample_file_name = scan_data_point_provider.getLastScanDataPoint().getCurrentFilename() #builder = OSCommandRunnerBuilder.defaults() builder = OSCommandRunnerBuilder.defaults() builder=builder.command([LocalProperties.get("org.opengda.lde.pixium.data.reduction.script","/dls_sw/apps/i11-scripts/bin/LDE-RunFromGDAAtEndOfScan.sh"),self.calibrant_file_name]) builder=builder.keepOutput(True) builder = builder.inputFilename(sample_file_name) builder = builder.outputFilename(os.path.splitext(sample_file_name)[0]+"_output.log") builder=builder.noTimeout() builder.build()