Skip to content

Commit

Permalink
Delete Temporary Workspaces used for Calibration re #5414
Browse files Browse the repository at this point in the history
More work is needed on this because it deletes after each tube calibration so slowing down the calibration.

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Oct 26, 2012
1 parent 2c2dc18 commit 5dfd141
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Code/Mantid/scripts/Calibration/tube_calib.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,23 @@ def get3pointsFor3pointMethod ( IntegratedWorkspace, whichTube, fitParams):
C = g[1][1]
else:
C = (A+B)/2.0 # If we haven't got a centre peak, we put one half way between the end points.

# Delete temporary workspaces
DeleteWorkspace( 'get3pointsFor3pointMethod')
DeleteWorkspace('Z1_NormalisedCovarianceMatrix')
DeleteWorkspace('Z1_Parameters')
DeleteWorkspace('Z1_Workspace')
DeleteWorkspace('CentrePoint_NormalisedCovarianceMatrix')
DeleteWorkspace('CentrePoint_Parameters')
DeleteWorkspace('CentrePoint_Workspace')
DeleteWorkspace('LeftPoint_NormalisedCovarianceMatrix')
DeleteWorkspace('LeftPoint_Parameters')
DeleteWorkspace('LeftPoint_Workspace')
DeleteWorkspace('RightPoint_NormalisedCovarianceMatrix')
DeleteWorkspace('RightPoint_Parameters')
DeleteWorkspace('RightPoint_Workspace')


return A, B, C

def getPeaksForNSlitsMethod ( IntegratedWorkspace, eP, eHeight, eWidth, whichTube):
Expand Down Expand Up @@ -304,6 +321,14 @@ def correctTubeToIdealTube( tubePoints, idealTubePoints, nDets, TestMode=False )
for i in range( len(usedTubePoints) ):
#print "used point",i,"shoving pixel",int(usedTubePoints[i]+0.5)
xResult[ int(usedTubePoints[i]+0.5) ] = xResult[0]


# Delete temporary workspaces
DeleteWorkspace('QuadraticFittingWorkspace')
DeleteWorkspace('QF_NormalisedCovarianceMatrix')
DeleteWorkspace('QF_Parameters')
DeleteWorkspace('QF_Workspace')


# print xResult
return xResult
Expand Down

0 comments on commit 5dfd141

Please sign in to comment.