Ticket #1668: SANSReduction.py

File SANSReduction.py, 17.4 KB (added by Steve Williams, 10 years ago)
Line 
1######################################################################
2#Python Script Generated by Algorithm History Display
3######################################################################
4LoadRaw(Filename="W:/Instrument/data/cycle_09_2/SANS2D00000930.raw",OutputWorkspace="930_sans_raw")
5LoadRaw(Filename="W:/Instrument/data/cycle_09_2/SANS2D00000919.raw",OutputWorkspace="919_trans_raw",SpectrumMax="8")
6LoadRaw(Filename="W:/Instrument/data/cycle_09_2/SANS2D00000907.raw",OutputWorkspace="907_sans_raw")
7LoadRaw(Filename="W:/Instrument/data/cycle_09_2/SANS2D00000985.raw",OutputWorkspace="985_trans_raw",SpectrumMax="8")
8LoadRaw(Filename="W:/Instrument/data/cycle_09_2/SANS2D00000908.raw",OutputWorkspace="908_trans_raw",SpectrumMax="8")
9MoveInstrumentComponent(Workspace="930_sans_raw",ComponentName="some-sample-holder")
10MoveInstrumentComponent(Workspace="930_sans_raw",ComponentName="rear-detector",X="-0.087499999999999994",Y="0.19727500000000001",Z="-0.00092800000000000001")
11MoveInstrumentComponent(Workspace="907_sans_raw",ComponentName="some-sample-holder")
12MoveInstrumentComponent(Workspace="907_sans_raw",ComponentName="rear-detector",X="-0.087499999999999994",Y="0.19727500000000001",Z="-0.00092800000000000001")
13CropWorkspace(InputWorkspace="930_sans_raw",OutputWorkspace="Monitor",StartWorkspaceIndex="1",EndWorkspaceIndex="1")
14CropWorkspace(InputWorkspace="930_sans_raw",OutputWorkspace="930rear_1D_1.25_4.2",StartWorkspaceIndex="8",EndWorkspaceIndex="36871")
15MaskDetectorsInShape(Workspace="930rear_1D_1.25_4.2",ShapeXML="<infinite-cylinder id="shape"><centre x="0.0" y="0.0" z="0.0" /><axis x="0" y="0" z="1" /><radius val="0.041" /></infinite-cylinder>
16<algebra val="shape" />")
17MaskDetectors(Workspace="930rear_1D_1.25_4.2",SpectraList="9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,36489,36490,36491,36492,36493,36494,36495,36496,36497,36498,36499,36500,36501,36502,36503,36504,36505,36506,36507,36508,36509,36510,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36523,36524,36525,36526,36527,36528,36529,36530,36531,36532,36533,36534,36535,36536,36537,36538,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36558,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36710,36711,36712,36713,36714,36715,36716,36717,36718,36719,36720,36721,36722,36723,36724,36725,36726,36727,36728,36729,36730,36731,36732,36733,36734,36735,36736,36737,36738,36739,36740,36741,36742,36743,36744,36745,36746,36747,36748,36749,36750,36751,36752,36753,36754,36755,36756,36757,36758,36759,36760,36761,36762,36763,36764,36765,36766,36767,36768,36769,36770,36771,36772,36773,36774,36775,36776,36777,36778,36779,36780,36781,36782,36783,36784,36785,36786,36787,36788,36789,36790,36791,36792,36793,36794,36795,36796,36797,36798,36799,36800,36801,36802,36803,36804,36805,36806,36807,36808,36809,36810,36811,36812,36813,36814,36815,36816,36817,36818,36819,36820,36821,36822,36823,36824,36825,36826,36827,36828,36829,36830,36831,36832,36833,36834,36835,36836,36837,36838,36839,36840,36841,36842,36843,36844,36845,36846,36847,36848,36849,36850,36851,36852,36853,36854,36855,36856,36857,36858,36859,36860,36861,36862,36863,36864,36865,36866,36867,36868,36869,36870,36871,36872,9,201,393,585,777,969,1161,1353,1545,1737,1929,2121,2313,2505,2697,2889,3081,3273,3465,3657,3849,4041,4233,4425,4617,4809,5001,5193,5385,5577,5769,5961,6153,6345,6537,6729,6921,7113,7305,7497,7689,7881,8073,8265,8457,8649,8841,9033,9225,9417,9609,9801,9993,10185,10377,10569,10761,10953,11145,11337,11529,11721,11913,12105,12297,12489,12681,12873,13065,13257,13449,13641,13833,14025,14217,14409,14601,14793,14985,15177,15369,15561,15753,15945,16137,16329,16521,16713,16905,17097,17289,17481,17673,17865,18057,18249,18441,18633,18825,19017,19209,19401,19593,19785,19977,20169,20361,20553,20745,20937,21129,21321,21513,21705,21897,22089,22281,22473,22665,22857,23049,23241,23433,23625,23817,24009,24201,24393,24585,24777,24969,25161,25353,25545,25737,25929,26121,26313,26505,26697,26889,27081,27273,27465,27657,27849,28041,28233,28425,28617,28809,29001,29193,29385,29577,29769,29961,30153,30345,30537,30729,30921,31113,31305,31497,31689,31881,32073,32265,32457,32649,32841,33033,33225,33417,33609,33801,33993,34185,34377,34569,34761,34953,35145,35337,35529,35721,35913,36105,36297,36489,36681,200,392,584,776,968,1160,1352,1544,1736,1928,2120,2312,2504,2696,2888,3080,3272,3464,3656,3848,4040,4232,4424,4616,4808,5000,5192,5384,5576,5768,5960,6152,6344,6536,6728,6920,7112,7304,7496,7688,7880,8072,8264,8456,8648,8840,9032,9224,9416,9608,9800,9992,10184,10376,10568,10760,10952,11144,11336,11528,11720,11912,12104,12296,12488,12680,12872,13064,13256,13448,13640,13832,14024,14216,14408,14600,14792,14984,15176,15368,15560,15752,15944,16136,16328,16520,16712,16904,17096,17288,17480,17672,17864,18056,18248,18440,18632,18824,19016,19208,19400,19592,19784,19976,20168,20360,20552,20744,20936,21128,21320,21512,21704,21896,22088,22280,22472,22664,22856,23048,23240,23432,23624,23816,24008,24200,24392,24584,24776,24968,25160,25352,25544,25736,25928,26120,26312,26504,26696,26888,27080,27272,27464,27656,27848,28040,28232,28424,28616,28808,29000,29192,29384,29576,29768,29960,30152,30344,30536,30728,30920,31112,31304,31496,31688,31880,32072,32264,32456,32648,32840,33032,33224,33416,33608,33800,33992,34184,34376,34568,34760,34952,35144,35336,35528,35720,35912,36104,36296,36488,36680,36872")
18MaskDetectorsInShape(Workspace="930rear_1D_1.25_4.2",ShapeXML="<infinite-plane id="pla"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="-1.0" y="-1.22460635382e-016" z="0" /></infinite-plane><infinite-plane id="pla2"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="-1.0" y="-2.44921270764e-016" z="0" /></infinite-plane><infinite-plane id="pla3"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="1.0" y="2.44921270764e-016" z="0" /></infinite-plane><infinite-plane id="pla4"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="1.0" y="1.22460635382e-016" z="0" /></infinite-plane><algebra val="#(pla pla2)" />")
19ConvertUnits(InputWorkspace="Monitor",OutputWorkspace="Monitor",Target="Wavelength")
20Rebin(InputWorkspace="Monitor",OutputWorkspace="Monitor",Params="1.25,0.125,4.2")
21ConvertUnits(InputWorkspace="930rear_1D_1.25_4.2",OutputWorkspace="930rear_1D_1.25_4.2",Target="Wavelength")
22Rebin(InputWorkspace="930rear_1D_1.25_4.2",OutputWorkspace="930rear_1D_1.25_4.2",Params="1.25,0.125,4.2")
23Divide(LHSWorkspace="930rear_1D_1.25_4.2",RHSWorkspace="Monitor",OutputWorkspace="reduce_temp_workspace")
24ConvertUnits(InputWorkspace="919_trans_raw",OutputWorkspace="919_trans_raw_tmp",Target="Wavelength")
25Rebin(InputWorkspace="919_trans_raw_tmp",OutputWorkspace="919_trans_raw_tmp",Params="1.25,0.125,4.2")
26ConvertUnits(InputWorkspace="908_trans_raw",OutputWorkspace="908_trans_raw_tmp",Target="Wavelength")
27Rebin(InputWorkspace="908_trans_raw_tmp",OutputWorkspace="908_trans_raw_tmp",Params="1.25,0.125,4.2")
28CalculateTransmission(SampleRunWorkspace="919_trans_raw_tmp",DirectRunWorkspace="908_trans_raw_tmp",OutputWorkspace="919_trans_sample_2.0_14.0",MinWavelength="2",MaxWavelength="14",OutputUnfittedData="1")
29Divide(LHSWorkspace="reduce_temp_workspace",RHSWorkspace="919_trans_sample_2.0_14.0",OutputWorkspace="reduce_temp_workspace")
30CorrectToFile(WorkspaceToCorrect="reduce_temp_workspace",Filename="M:/myproj~1/SANS/data/DIRECT_RUN524_4m_25Nov09.dat",OutputWorkspace="reduce_temp_workspace")
31Q1D(InputWorkspace="reduce_temp_workspace",InputForErrors="930rear_1D_1.25_4.2",OutputWorkspace="930rear_1D_1.25_4.2",OutputBinning="0.001,0.00125,0.351")
32RenameWorkspace(InputWorkspace="930rear_1D_1.25_4.2",OutputWorkspace="930rear_1D_1.25_4.2_sam_tmp")
33CropWorkspace(InputWorkspace="907_sans_raw",OutputWorkspace="Monitor",StartWorkspaceIndex="1",EndWorkspaceIndex="1")
34CropWorkspace(InputWorkspace="907_sans_raw",OutputWorkspace="930rear_1D_1.25_4.2_can_tmp",StartWorkspaceIndex="8",EndWorkspaceIndex="36871")
35MaskDetectorsInShape(Workspace="930rear_1D_1.25_4.2_can_tmp",ShapeXML="<infinite-cylinder id="shape"><centre x="0.0" y="0.0" z="0.0" /><axis x="0" y="0" z="1" /><radius val="0.041" /></infinite-cylinder>
36<algebra val="shape" />")
37MaskDetectors(Workspace="930rear_1D_1.25_4.2_can_tmp",SpectraList="9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,36489,36490,36491,36492,36493,36494,36495,36496,36497,36498,36499,36500,36501,36502,36503,36504,36505,36506,36507,36508,36509,36510,36511,36512,36513,36514,36515,36516,36517,36518,36519,36520,36521,36522,36523,36524,36525,36526,36527,36528,36529,36530,36531,36532,36533,36534,36535,36536,36537,36538,36539,36540,36541,36542,36543,36544,36545,36546,36547,36548,36549,36550,36551,36552,36553,36554,36555,36556,36557,36558,36559,36560,36561,36562,36563,36564,36565,36566,36567,36568,36569,36570,36571,36572,36573,36574,36575,36576,36577,36578,36579,36580,36581,36582,36583,36584,36585,36586,36587,36588,36589,36590,36591,36592,36593,36594,36595,36596,36597,36598,36599,36600,36601,36602,36603,36604,36605,36606,36607,36608,36609,36610,36611,36612,36613,36614,36615,36616,36617,36618,36619,36620,36621,36622,36623,36624,36625,36626,36627,36628,36629,36630,36631,36632,36633,36634,36635,36636,36637,36638,36639,36640,36641,36642,36643,36644,36645,36646,36647,36648,36649,36650,36651,36652,36653,36654,36655,36656,36657,36658,36659,36660,36661,36662,36663,36664,36665,36666,36667,36668,36669,36670,36671,36672,36673,36674,36675,36676,36677,36678,36679,36680,36681,36682,36683,36684,36685,36686,36687,36688,36689,36690,36691,36692,36693,36694,36695,36696,36697,36698,36699,36700,36701,36702,36703,36704,36705,36706,36707,36708,36709,36710,36711,36712,36713,36714,36715,36716,36717,36718,36719,36720,36721,36722,36723,36724,36725,36726,36727,36728,36729,36730,36731,36732,36733,36734,36735,36736,36737,36738,36739,36740,36741,36742,36743,36744,36745,36746,36747,36748,36749,36750,36751,36752,36753,36754,36755,36756,36757,36758,36759,36760,36761,36762,36763,36764,36765,36766,36767,36768,36769,36770,36771,36772,36773,36774,36775,36776,36777,36778,36779,36780,36781,36782,36783,36784,36785,36786,36787,36788,36789,36790,36791,36792,36793,36794,36795,36796,36797,36798,36799,36800,36801,36802,36803,36804,36805,36806,36807,36808,36809,36810,36811,36812,36813,36814,36815,36816,36817,36818,36819,36820,36821,36822,36823,36824,36825,36826,36827,36828,36829,36830,36831,36832,36833,36834,36835,36836,36837,36838,36839,36840,36841,36842,36843,36844,36845,36846,36847,36848,36849,36850,36851,36852,36853,36854,36855,36856,36857,36858,36859,36860,36861,36862,36863,36864,36865,36866,36867,36868,36869,36870,36871,36872,9,201,393,585,777,969,1161,1353,1545,1737,1929,2121,2313,2505,2697,2889,3081,3273,3465,3657,3849,4041,4233,4425,4617,4809,5001,5193,5385,5577,5769,5961,6153,6345,6537,6729,6921,7113,7305,7497,7689,7881,8073,8265,8457,8649,8841,9033,9225,9417,9609,9801,9993,10185,10377,10569,10761,10953,11145,11337,11529,11721,11913,12105,12297,12489,12681,12873,13065,13257,13449,13641,13833,14025,14217,14409,14601,14793,14985,15177,15369,15561,15753,15945,16137,16329,16521,16713,16905,17097,17289,17481,17673,17865,18057,18249,18441,18633,18825,19017,19209,19401,19593,19785,19977,20169,20361,20553,20745,20937,21129,21321,21513,21705,21897,22089,22281,22473,22665,22857,23049,23241,23433,23625,23817,24009,24201,24393,24585,24777,24969,25161,25353,25545,25737,25929,26121,26313,26505,26697,26889,27081,27273,27465,27657,27849,28041,28233,28425,28617,28809,29001,29193,29385,29577,29769,29961,30153,30345,30537,30729,30921,31113,31305,31497,31689,31881,32073,32265,32457,32649,32841,33033,33225,33417,33609,33801,33993,34185,34377,34569,34761,34953,35145,35337,35529,35721,35913,36105,36297,36489,36681,200,392,584,776,968,1160,1352,1544,1736,1928,2120,2312,2504,2696,2888,3080,3272,3464,3656,3848,4040,4232,4424,4616,4808,5000,5192,5384,5576,5768,5960,6152,6344,6536,6728,6920,7112,7304,7496,7688,7880,8072,8264,8456,8648,8840,9032,9224,9416,9608,9800,9992,10184,10376,10568,10760,10952,11144,11336,11528,11720,11912,12104,12296,12488,12680,12872,13064,13256,13448,13640,13832,14024,14216,14408,14600,14792,14984,15176,15368,15560,15752,15944,16136,16328,16520,16712,16904,17096,17288,17480,17672,17864,18056,18248,18440,18632,18824,19016,19208,19400,19592,19784,19976,20168,20360,20552,20744,20936,21128,21320,21512,21704,21896,22088,22280,22472,22664,22856,23048,23240,23432,23624,23816,24008,24200,24392,24584,24776,24968,25160,25352,25544,25736,25928,26120,26312,26504,26696,26888,27080,27272,27464,27656,27848,28040,28232,28424,28616,28808,29000,29192,29384,29576,29768,29960,30152,30344,30536,30728,30920,31112,31304,31496,31688,31880,32072,32264,32456,32648,32840,33032,33224,33416,33608,33800,33992,34184,34376,34568,34760,34952,35144,35336,35528,35720,35912,36104,36296,36488,36680,36872")
38MaskDetectorsInShape(Workspace="930rear_1D_1.25_4.2_can_tmp",ShapeXML="<infinite-plane id="pla"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="-1.0" y="-1.22460635382e-016" z="0" /></infinite-plane><infinite-plane id="pla2"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="-1.0" y="-2.44921270764e-016" z="0" /></infinite-plane><infinite-plane id="pla3"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="1.0" y="2.44921270764e-016" z="0" /></infinite-plane><infinite-plane id="pla4"><point-in-plane x="0" y="0" z="0" /><normal-to-plane x="1.0" y="1.22460635382e-016" z="0" /></infinite-plane><algebra val="#(pla pla2)" />")
39ConvertUnits(InputWorkspace="Monitor",OutputWorkspace="Monitor",Target="Wavelength")
40Rebin(InputWorkspace="Monitor",OutputWorkspace="Monitor",Params="1.25,0.125,4.2")
41ConvertUnits(InputWorkspace="930rear_1D_1.25_4.2_can_tmp",OutputWorkspace="930rear_1D_1.25_4.2_can_tmp",Target="Wavelength")
42Rebin(InputWorkspace="930rear_1D_1.25_4.2_can_tmp",OutputWorkspace="930rear_1D_1.25_4.2_can_tmp",Params="1.25,0.125,4.2")
43Divide(LHSWorkspace="930rear_1D_1.25_4.2_can_tmp",RHSWorkspace="Monitor",OutputWorkspace="reduce_temp_workspace")
44ConvertUnits(InputWorkspace="985_trans_raw",OutputWorkspace="985_trans_raw_tmp",Target="Wavelength")
45Rebin(InputWorkspace="985_trans_raw_tmp",OutputWorkspace="985_trans_raw_tmp",Params="1.25,0.125,4.2")
46ConvertUnits(InputWorkspace="908_trans_raw",OutputWorkspace="908_trans_raw_tmp",Target="Wavelength")
47Rebin(InputWorkspace="908_trans_raw_tmp",OutputWorkspace="908_trans_raw_tmp",Params="1.25,0.125,4.2")
48CalculateTransmission(SampleRunWorkspace="985_trans_raw_tmp",DirectRunWorkspace="908_trans_raw_tmp",OutputWorkspace="985_trans_can_2.0_14.0",MinWavelength="2",MaxWavelength="14",OutputUnfittedData="1")
49Divide(LHSWorkspace="reduce_temp_workspace",RHSWorkspace="985_trans_can_2.0_14.0",OutputWorkspace="reduce_temp_workspace")
50CorrectToFile(WorkspaceToCorrect="reduce_temp_workspace",Filename="M:/myproj~1/SANS/data/DIRECT_RUN524_4m_25Nov09.dat",OutputWorkspace="reduce_temp_workspace")
51Q1D(InputWorkspace="reduce_temp_workspace",InputForErrors="930rear_1D_1.25_4.2_can_tmp",OutputWorkspace="930rear_1D_1.25_4.2_can_tmp",OutputBinning="0.001,0.00125,0.351")
52Minus(LHSWorkspace="930rear_1D_1.25_4.2_sam_tmp",RHSWorkspace="930rear_1D_1.25_4.2_can_tmp",OutputWorkspace="930rear_1D_1.25_4.2")
53ReplaceSpecialValues(InputWorkspace="930rear_1D_1.25_4.2",OutputWorkspace="930rear_1D_1.25_4.2",NaNValue="0",InfinityValue="0")
54CropWorkspace(InputWorkspace="930rear_1D_1.25_4.2",OutputWorkspace="930rear_1D_1.25_4.2",XMin="0.014749999999999999",XMax="0.35135100000000002")
55AddSampleLog(Workspace="930rear_1D_1.25_4.2",LogName="UserFile",LogText="MASKSANS2D_092N_REAR.txt")
56RenameWorkspace(InputWorkspace="930rear_1D_1.25_4.2",OutputWorkspace="SANS_h8CB_40C")
57