diff --git a/scripts/Inelastic/Direct/DirectEnergyConversion.py b/scripts/Inelastic/Direct/DirectEnergyConversion.py index 0a0ddd837c06de5f7eaf3bfbf8f97ca20989fffa..c467d16265748502cbbcbcefdd347c17211f4406 100644 --- a/scripts/Inelastic/Direct/DirectEnergyConversion.py +++ b/scripts/Inelastic/Direct/DirectEnergyConversion.py @@ -350,7 +350,7 @@ class DirectEnergyConversion(object): """ # Support for old reduction interface: self.prop_man.set_input_parameters_ignore_nan\ - (wb_run=wb_run,sample_run=sample_run,incident_energy=ei_guess,energy_bins=rebin, + (wb_run=wb_run,sample_run=sample_run,incident_energy=ei_guess,energy_bins=rebin,\ map_file=map_file,monovan_run=monovan_run,wb_for_monovan_run=wb_for_monovan_run) # self.prop_man.set_input_parameters(**kwargs) @@ -791,16 +791,16 @@ class DirectEnergyConversion(object): psp = workspace.getSpectrum(specID) detIDs = psp.getDetectorIDs() for detID in detIDs: - MoveInstrumentComponent(Workspace=workspace,ComponentName= 'Detector', - DetectorID=detID,X=detPos.getX(),Y=detPos.getY(), + MoveInstrumentComponent(Workspace=workspace,ComponentName= 'Detector',\ + DetectorID=detID,X=detPos.getX(),Y=detPos.getY(),\ Z=detPos.getZ(),RelativePosition=False) wsIDs.append(specID) if len(spectra_list) == 1: - ExtractSingleSpectrum(InputWorkspace=workspace,OutputWorkspace=target_ws_name, + ExtractSingleSpectrum(InputWorkspace=workspace,OutputWorkspace=target_ws_name,\ WorkspaceIndex=wsIDs[0]) else: - SumSpectra(InputWorkspace=workspace,OutputWorkspace=target_ws_name, + SumSpectra(InputWorkspace=workspace,OutputWorkspace=target_ws_name,\ ListOfWorkspaceIndices=wsIDs) ws = mtd[target_ws_name] sp = ws.getSpectrum(0) @@ -837,7 +837,7 @@ class DirectEnergyConversion(object): # Calculate the incident energy #Returns: ei,mon1_peak,mon1_index,tzero - ei,mon1_peak,mon1_index,_ = \ + ei,mon1_peak,_,_ = \ GetEi(InputWorkspace=monitor_ws, Monitor1Spec=ei_mon_spectra[0], Monitor2Spec=ei_mon_spectra[1], EnergyEstimate=ei_guess,FixEi=fix_ei) @@ -1145,8 +1145,8 @@ class DirectEnergyConversion(object): # Calculate the incident energy and TOF when the particles access Monitor1 try: ei,mon1_peak,mon1_index,_ = \ - GetEi(InputWorkspace=monitor_ws, Monitor1Spec=mon_1_spec_ID, - Monitor2Spec=mon_2_spec_ID, + GetEi(InputWorkspace=monitor_ws, Monitor1Spec=mon_1_spec_ID,\ + Monitor2Spec=mon_2_spec_ID,\ EnergyEstimate=ei_guess,FixEi=fix_ei) mon1_det = monitor_ws.getDetector(mon1_index) mon1_pos = mon1_det.getPos() @@ -1492,7 +1492,7 @@ class DirectEnergyConversion(object): --------> Abs norm factors: Sigma^2: {9} --------> Abs norm factors: Poisson: {10} --------> Abs norm factors: TGP : {11}\n"""\ - .format(ws_name,minmax[0],minmax[1],nhist,sum(signal),sum(error),izerc,scale_factor, + .format(ws_name,minmax[0],minmax[1],nhist,sum(signal),sum(error),izerc,scale_factor,\ norm_factor['LibISIS'],norm_factor['SigSq'],norm_factor['Poisson'],norm_factor['TGP']) log_value = log_value + log1_value propman.log(log_value,'error') diff --git a/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py b/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py index 75cf83abb894cc3e4979ffbe92bd62fc559bbaee..673c66b8cf8e036934ab54e3d443db534061cf65 100644 --- a/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py +++ b/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py @@ -36,8 +36,8 @@ class UserProperties(object): if args[0] is None: return if len(args) == 1: - input = str(args[0]) - param = input.split() + input_str = str(args[0]) + param = input_str.split() self._user_id = param[0] if len(param) == 5: self.set_user_properties(param[1], param[2], param[3], param[4]) @@ -160,13 +160,13 @@ class UserProperties(object): consisting of string RB and string representation of RB number e.g. RB1510324, used on the date specified - """ + """ return os.path.basename(self._rb_dirs[exp_date]) # def get_rb_dir(self,exp_date): - """Returns full name name of user's RB folder correspinding to the + """Returns full name name of user's RB folder correspinding to the experiment, with the data provided. - """ + """ return self._rb_dirs[exp_date] @property @@ -285,12 +285,12 @@ class UserProperties(object): if not isinstance(rb_folder_or_id, str): raise RuntimeError("RB Folder {0} should be a string".format(rb_folder_or_id)) else: - base, rbf = os.path.split(rb_folder_or_id) + f_path, rbf = os.path.split(rb_folder_or_id) if len(rbf) != 9: try: rbf = int(rbf) rbf = "RB{0:07}".format(rbf) - rb_folder_or_id = os.path.join(base, rbf) + rb_folder_or_id = os.path.join(f_path, rbf) except ValueError: raise RuntimeError( "RB Folder {0} should be a string containing RB number at the end".format(rb_folder_or_id)) @@ -337,13 +337,13 @@ class MantidConfigDirectInelastic(object): """ # pylint: disable=too-many-instance-attributes # It has as many as parameters describing ISIS configuration. - def __init__(self, mantid='/opt/Mantid/', home='/home/', \ + def __init__(self, mantid='/opt/Mantid/', home_dir='/home/', \ script_repo='/opt/UserScripts/', \ map_mask_folder='/usr/local/mprogs/InstrumentFiles/'): """Initialize generic config variables and variables specific to a server""" self._mantid_path = str(mantid) - self._home_path = str(home) + self._home_path = str(home_dir) self._script_repo = str(script_repo) self._map_mask_folder = str(map_mask_folder) # check if all necessary server folders specified as class parameters are present @@ -449,10 +449,10 @@ class MantidConfigDirectInelastic(object): else: return False # - + # def get_user_file_description(self,instr_name=None): """returbs full file name (with path) for an xml file which describes - files, which should be copied to a user. + files, which should be copied to a user. If instrument name is known or provided, function calculates this name wrt. the location of the file in the Mantid user @@ -830,7 +830,7 @@ class MantidConfigDirectInelastic(object): self.make_map_mask_links(user_path) users_cycles = self._user.get_all_cycles() - + # for cycle in users_cycles: instr = self._user.get_instrument(cycle) self.copy_reduction_sample(self.get_user_file_description(instr),cycle) @@ -930,7 +930,7 @@ if __name__ == "__main__": rb_user_folder = os.path.join(mcf._home_path, user.userID) user.rb_dir = rb_user_folder if not user.rb_dir_exist: - print "RB folder {0} for user {1} should exist and be accessible to configure this user".format(user.rb_dir, + print "RB folder {0} for user {1} should exist and be accessible to configure this user".format(user.rb_dir,\ user.userID) exit() # Configure user