Skip to content

Commit

Permalink
Re #4373 Save reduction params with xml output for HFIR
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Dec 29, 2011
1 parent 469da45 commit 20e82a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is a fake version of the Reducer for testing purposes.
"""
import time
import os
from scripter import BaseReductionScripter

class HFIRReductionScripter(BaseReductionScripter):
Expand Down Expand Up @@ -32,7 +33,13 @@ def to_script(self, file_name=None):
if item.state() is not None:
script += str(item.state())

script += "SaveIqAscii()\n"
xml_process = "None"
if file_name is None:
xml_process = os.path.join(self._output_directory, "HFIRSANS_process.xml")
xml_process = os.path.normpath(xml_process)
self.to_xml(xml_process)

script += "SaveIqAscii(process=%r)\n" % xml_process
script += "Reduce1D()\n"

if file_name is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ def Background(datafile):
def NoBackground():
ReductionSingleton().set_background(None)

def SaveIqAscii(reducer=None):
def SaveIqAscii(reducer=None, process=None):
if reducer is None:
reducer = ReductionSingleton()
reducer.set_save_Iq(sans_reduction_steps.SaveIqAscii())
reducer.set_save_Iq(sans_reduction_steps.SaveIqAscii(process=process))

def NoSaveIq():
ReductionSingleton().set_save_Iq(None)
Expand Down

0 comments on commit 20e82a3

Please sign in to comment.