parameters: (self, data_set, run_number, first_run_of_set, sequence_number)
docstring: Write out a template using the reduction parameters that we have used.
              @param data_set: DataSets object
              @param run_number: run number according to the data file name
              @param first_run_of_set: first run in the sequence (sequence ID)
              @param sequence_number: the ID of the data set within the sequence of runs
docstring_summary: Write out a template using the reduction parameters that we have used.
docstring_tokens: Write out a template using the reduction parameters that we have used .
function: def _write_template(self, data_set, run_number, first_run_of_set, sequence_number):
          """
              Write out a template using the reduction parameters that we have used.
              @param data_set: DataSets object
              @param run_number: run number according to the data file name
              @param first_run_of_set: first run in the sequence (sequence ID)
              @param sequence_number: the ID of the data set within the sequence of runs
          """
          # Write out a template for this run
          xml_str = "<Reduction>\n"
          xml_str += "  <instrument_name>REFL</instrument_name>\n"
          xml_str += "  <timestamp>%s</timestamp>\n" % time.ctime()
          xml_str += "  <python_version>%s</python_version>\n" % sys.version
          xml_str += "  <platform>%s</platform>\n" % platform.system()
          xml_str += "  <architecture>%s</architecture>\n" % str(platform.architecture())
          xml_str += "  <mantid_version>%s</mantid_version>\n" % mantid.__version__
  
          # Copy over the existing series, up to the point we are at
          new_data_sets = []
          for i in range(int(run_number) - int(first_run_of_set) + 1):
              if i >= len(self.data_series_template.data_sets):
                  logger.warning("Sequence is corrupted: run=%s, first run of set=%s" % (str(run_number),
                                                                                         str(first_run_of_set)))
                  break
              d = self.data_series_template.data_sets[i]
              d.data_files = [int(first_run_of_set) + i]
              new_data_sets.append(d)
          # Make copy over the parameters we actually used
          new_data_sets[sequence_number - 1] = data_set
  
          self.data_series_template.data_sets = new_data_sets
  
          xml_str += self.data_series_template.to_xml()
          xml_str += "</Reduction>\n"
          template_file = open(self._get_output_template_path(first_run_of_set), 'w')
          template_file.write(xml_str)
          template_file.close()
function_tokens: def _write_template ( self , data_set , run_number , first_run_of_set , sequence_number ) : # Write out a template for this run xml_str = "<Reduction>\n" xml_str += "  <instrument_name>REFL</instrument_name>\n" xml_str += "  <timestamp>%s</timestamp>\n" % time . ctime ( ) xml_str += "  <python_version>%s</python_version>\n" % sys . version xml_str += "  <platform>%s</platform>\n" % platform . system ( ) xml_str += "  <architecture>%s</architecture>\n" % str ( platform . architecture ( ) ) xml_str += "  <mantid_version>%s</mantid_version>\n" % mantid . __version__ # Copy over the existing series, up to the point we are at new_data_sets = [ ] for i in range ( int ( run_number ) - int ( first_run_of_set ) + 1 ) : if i >= len ( self . data_series_template . data_sets ) : logger . warning ( "Sequence is corrupted: run=%s, first run of set=%s" % ( str ( run_number ) , str ( first_run_of_set ) ) ) break d = self . data_series_template . data_sets [ i ] d . data_files = [ int ( first_run_of_set ) + i ] new_data_sets . append ( d ) # Make copy over the parameters we actually used new_data_sets [ sequence_number - 1 ] = data_set self . data_series_template . data_sets = new_data_sets xml_str += self . data_series_template . to_xml ( ) xml_str += "</Reduction>\n" template_file = open ( self . _get_output_template_path ( first_run_of_set ) , 'w' ) template_file . write ( xml_str ) template_file . close ( )