|
1 | 1 | import sys |
2 | 2 |
|
| 3 | +sys.path.append('/opt/Mantid/scripts') |
| 4 | +sys.path.append('/opt/Mantid/scripts/SANS') |
| 5 | +sys.path.append('/opt/Mantid/lib') |
| 6 | +sys.path.append('/opt/Mantid/scripts/Inelastic') |
| 7 | +sys.path.append('/opt/Mantid/scripts/Engineering') |
| 8 | +sys.path.append('/opt/Mantid/scripts/Interface') |
| 9 | +sys.path.append('/opt/Mantid/scripts/Diffraction') |
| 10 | + |
3 | 11 | AUTOREDUCTION_DIR = r"/autoreduce/data-archive/NDXINTER/user/scripts/autoreduction" |
4 | 12 | sys.path.append(AUTOREDUCTION_DIR) |
5 | 13 |
|
|
13 | 21 | def main(input_file, output_dir): |
14 | 22 | standard_params = web_var.standard_vars |
15 | 23 | advanced_params = web_var.advanced_vars |
16 | | - |
17 | 24 | config['defaultsave.directory'] = output_dir |
18 | | - |
19 | | - OutputWorkspaceBinned, OutputWorkspace, OutputWorkspaceFirstTransmission, OutputWorkspaceSecondTransmission = ReflectometryISISLoadAndProcess(InputRunList=input_file, |
20 | | - FirstTransmissionRunList=standard_params['first_transmission_run_list'], |
21 | | - SecondTransmissionRunList=standard_params['second_transmission_run_list'], |
22 | | - ThetaIn=standard_params['theta_in'], |
23 | | - DetectorCorrectionType=standard_params['detector_correction_type'], |
24 | | - AnalysisMode=standard_params['analysis_mode'], |
25 | | - TransmissionProcessingInstructions=standard_params['transmission_processing_instructions'], |
26 | | - ProcessingInstructions=standard_params['processing_instructions']) |
27 | | - |
28 | | - SaveNexus(OutputWorkspaceBinned, os.path.join(output_dir, OutputWorkspaceBinned.name()+".nxs")) |
29 | | - SaveNexus(OutputWorkspace, os.path.join(output_dir, OutputWorkspace.name()+".nxs")) |
| 25 | + |
| 26 | + alg=AlgorithmManager.create("ReflectometryISISLoadAndProcess") |
| 27 | + properties = { |
| 28 | + "InputRunList" : standard_params['input_run_list'], |
| 29 | + "FirstTransmissionRunList" : standard_params['first_transmission_run_list'], |
| 30 | + "SecondTransmissionRunList" : standard_params['second_transmission_run_list'], |
| 31 | + "ThetaIn" : standard_params['theta_in'], |
| 32 | + "DetectorCorrectionType" : standard_params['detector_correction_type'], |
| 33 | + "MonitorBackgroundWavelengthMin" : standard_params['monitor_background_wavelength_min'], |
| 34 | + "MonitorBackgroundWavelengthMax" : standard_params['monitor_background_wavelength_max'], |
| 35 | + "MonitorIntegrationWavelengthMin" : standard_params['MonitorIntegrationWavelengthMin'], |
| 36 | + "MonitorIntegrationWavelengthMax" : standard_params['MonitorIntegrationWavelengthMax'], |
| 37 | + "WavelengthMin" : standard_params['WavelengthMin'], |
| 38 | + "WavelengthMax" : standard_params['WavelengthMax'], |
| 39 | + "I0MonitorIndex" : standard_params['IZeroMonitorIndex'], |
| 40 | + "AnalysisMode" : standard_params['analysis_mode'], |
| 41 | + "StartOverlap" : standard_params['StartOverlap'], |
| 42 | + "EndOverlap" : standard_params['EndOverlap'], |
| 43 | + "TransmissionProcessingInstructions" : standard_params['transmission_processing_instructions'], |
| 44 | + "ProcessingInstructions" : standard_params['processing_instructions'] |
| 45 | + } |
| 46 | + alg.setProperties(properties) |
| 47 | + alg.execute() |
| 48 | + |
| 49 | + OutputWorkspace=alg.getPropertyValue("OutputWorkspace") |
| 50 | + OutputWorkspaceBinned=alg.getPropertyValue("OutputWorkspaceBinned") |
| 51 | + |
| 52 | + SaveNexus(OutputWorkspace, os.path.join(output_dir, OutputWorkspace+".nxs")) |
| 53 | + SaveNexus(OutputWorkspaceBinned, os.path.join(output_dir, OutputWorkspaceBinned+".nxs")) |
30 | 54 |
|
31 | 55 | if __name__ == "__main__": |
32 | 56 | main('', '') |
|
0 commit comments