Skip to content

Commit

Permalink
Moved cleaning. Output seems to be much better. This refs #8045
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanBilheux committed Sep 27, 2013
1 parent aa77366 commit e6674c6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,12 @@ def PyExec(self):
dataBackRange,
'data')

# wks_utility.ouput_big_ascii_file('/mnt/hgfs/j35/Dropbox/temporary/data_file_not_integrated.txt',
# wks_utility.ouput_big_ascii_file('/mnt/hgfs/j35/Desktop/DebugMantid/DataAndNormBeingSameFile/data_file_back_sub_not_integrated.txt',
# data_tof_axis,
# data_y_axis,
# data_y_error_axis)


# # ## DEBUGGING ONLY
# [inte_data_y_axis, inte_data_y_error_axis] = wks_utility.integratedOverPixelDim(data_y_axis, data_y_error_axis)
# name_output_ws = self.getPropertyValue("OutputWorkspace")
Expand Down Expand Up @@ -259,18 +260,27 @@ def PyExec(self):
normBackRange,
'normalization')

# wks_utility.ouput_big_ascii_file('/mnt/hgfs/j35/Desktop/DebugMantid/DataAndNormBeingSameFile/norm_file_back_sub_not_integrated.txt',
# norm_tof_axis,
# norm_y_axis,
# norm_y_error_axis)

# get average mean of peak region for each TOF
# [av_norm, av_norm_error] = wks_utility.meanOfRange(norm_y_axis,
# norm_y_error_axis)

[av_norm, av_norm_error] = wks_utility.fullSumWithError(norm_y_axis,
norm_y_error_axis)





# ## DEBUGGING ONLY
# wks_utility.ouput_ascii_file('/mnt/hgfs/j35/Dropbox/temporary/norm_file.txt',
# norm_tof_axis,
# av_norm,
# av_norm_error)
# wks_utility.ouput_ascii_file('/mnt/hgfs/j35/Desktop/DebugMantid/DataAndNormBeingSameFile/norm_file_back_sub_integrated.txt',
# norm_tof_axis,
# av_norm,
# av_norm_error)

# ## DEBUGGING ONLY
# [inte_data_y_axis, inte_data_y_error_axis] = wks_utility.integratedOverPixelDim(data_y_axis, data_y_error_axis)
Expand All @@ -296,6 +306,7 @@ def PyExec(self):
av_norm,
av_norm_error)


# ## DEBUGGING ONLY
# my_x_axis = zeros((17,240))
# for i in range(17):
Expand All @@ -308,11 +319,12 @@ def PyExec(self):
# final_data_y_axis,
# final_data_y_error_axis)

# cleanup data
[final_data_y_axis, final_data_y_error_axis] = wks_utility.cleanupData(final_data_y_axis,
final_data_y_error_axis)


wks_utility.ouput_big_ascii_file('/mnt/hgfs/j35/Desktop/DebugMantid/DataAndNormBeingSameFile/data_over_norm_file_not_integrated.txt',
tof_axis,
final_data_y_axis,
final_data_y_error_axis)

# ## debugging only
# name_output_ws = self.getPropertyValue("OutputWorkspace")
Expand Down Expand Up @@ -488,14 +500,19 @@ def PyExec(self):



# # cleanup data
[final_y_axis, final_y_error_axis] = wks_utility.cleanupData1D(final_y_axis,
final_error_axis)


# create final workspace
import time
_time = int(time.time())
name_output_ws = self.getPropertyValue("OutputWorkspace")
name_output_ws = name_output_ws + '_#' + str(_time) + 'ts'
final_workspace = wks_utility.createFinalWorkspace(final_x_axis,
final_y_axis,
final_error_axis,
final_y_error_axis,
name_output_ws)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,32 @@ def cleanupData(final_data_y_axis, final_data_y_error_axis):



def cleanupData1D(final_data_y_axis, final_data_y_error_axis):

sz = final_data_y_axis.shape
nbrTof = sz[0]

for t in range(nbrTof):

_data = final_data_y_axis[t]
_error = final_data_y_error_axis[t]

# if error is > value, remove point
if _error >= _data:
_data = 0
_error = 0

# if value is below 10^-12
if _data < 1e-12:
_data = 0
_error = 0

final_data_y_axis[t] = _data
final_data_y_error_axis[t] = _error

return [final_data_y_axis, final_data_y_error_axis]





Expand Down

0 comments on commit e6674c6

Please sign in to comment.