def _save_t0(self, run_number, name='_t_ws'): """ Create temporary events file with delayed emission time from moderator removed :param run: run number :param name: name for the output workspace :return: file name of event file with events treated with algorithm ModeratorTzeroLinear. """ ws = LoadEventNexus(Filename=self._makeRunFile(run_number), NXentryName='entry-diff', OutputWorkspace=name) ws = ModeratorTzeroLinear(InputWorkspace=ws.name(), OutputWorkspace=ws.name()) file_name = self._spawn_tempnexus() SaveNexus(ws, file_name) return file_name
def _save_t0(self, run_number, name='_t_ws'): """ Create temporary events file with delayed emission time from moderator removed :param run: run number :param name: name for the output workspace :return: file name of event file with events treated with algorithm ModeratorTzeroLinear. """ ws = LoadEventNexus(Filename=self._makeRunFile(run_number), NXentryName='entry-diff', OutputWorkspace=name) ws = ModeratorTzeroLinear(InputWorkspace=ws.name(), OutputWorkspace=ws.name()) file_name = self._spawn_tempnexus() SaveNexus(ws, file_name) return file_name
def _mask_t0_crop(self, run_number, name): """ Load a run into a workspace with: 1. Masked detectors 2. Delayed emission time from moderator removed 3. Conversion of units to momentum 4. Remove events outside the valid momentum range :param run_number: BASIS run number :param name: name for the output workspace :return: workspace object """ ws = LoadEventNexus(Filename=self._makeRunFile(run_number), NXentryName='entry-diff', SingleBankPixelsOnly=False, OutputWorkspace=name) MaskDetectors(ws, MaskedWorkspace=self._t_mask) ws = ModeratorTzeroLinear(InputWorkspace=ws.name(), OutputWorkspace=ws.name()) ws = ConvertUnits(ws, Target='Momentum', OutputWorkspace=ws.name()) ws = CropWorkspace(ws, OutputWorkspace=ws.name(), XMin=self._momentum_range[0], XMax=self._momentum_range[1]) return ws
def _mask_t0_crop(self, run_number, name): """ Load a run into a workspace with: 1. Masked detectors 2. Delayed emission time from moderator removed 3. Conversion of units to momentum 4. Remove events outside the valid momentum range :param run_number: BASIS run number :param name: name for the output workspace :return: workspace object """ ws = LoadEventNexus(Filename=self._makeRunFile(run_number), NXentryName='entry-diff', SingleBankPixelsOnly=False, OutputWorkspace=name) MaskDetectors(ws, MaskedWorkspace=self._t_mask) ws = ModeratorTzeroLinear(InputWorkspace=ws.name(), OutputWorkspace=ws.name()) ws = ConvertUnits(ws, Target='Momentum', OutputWorkspace=ws.name()) ws = CropWorkspace(ws, OutputWorkspace=ws.name(), XMin=self._momentum_range[0], XMax=self._momentum_range[1]) return ws