Skip to content

Commit

Permalink
fix absorption range issue
Browse files Browse the repository at this point in the history
  • Loading branch information
y8z committed Oct 5, 2024
1 parent c267227 commit dc891ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions total_scattering/file_handling/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ def load(ws_name, input_files, group_wksp,
OutputWorkspace="absorption_wksp_rb",
Params=qparams_use,
PreserveEvents=align_and_focus_args["PreserveEvents"])
for i in range(mtd["absorption_wksp_rb"].getNumberHistograms()):
orig_y_tmp = mtd["absorption_wksp_rb"].readY(i)
new_y = np.nan_to_num(orig_y_tmp, nan=0)
new_y[np.abs(new_y) < 1.E-5] = 1.
mtd["absorption_wksp_rb"].setY(i, new_y)
Divide(LHSWorkspace=mtd[ws_name],
RHSWorkspace="absorption_wksp_rb",
OutputWorkspace=ws_name,
Expand Down

0 comments on commit dc891ed

Please sign in to comment.