1
1
from datetime import datetime
2
+ from mslice .models .alg_workspace_ops import get_range_end
2
3
from mslice .models .labels import get_recoil_key
3
4
from mslice .util .intensity_correction import IntensityType , IntensityCache
4
5
import re
@@ -220,10 +221,8 @@ def add_cut_lines_with_width(errorbars, script_lines, cuts, intensity_correction
220
221
for cut in cuts :
221
222
integration_start = cut .integration_axis .start
222
223
integration_end = cut .integration_axis .end
223
- cut_start , cut_end = (
224
- integration_start ,
225
- min (integration_start + cut .width , integration_end ),
226
- )
224
+ cut_start = integration_start
225
+ cut_end = get_range_end (integration_start , integration_end , cut .width )
227
226
intensity_range = (cut .intensity_start , cut .intensity_end )
228
227
norm_to_one = cut .norm_to_one
229
228
algo_str = "" if "Rebin" in cut .algorithm else f', Algorithm="{ cut .algorithm } "'
@@ -253,6 +252,7 @@ def add_cut_lines_with_width(errorbars, script_lines, cuts, intensity_correction
253
252
f"IntensityCorrection={ intensity_correction_arg } , SampleTemperature={ cut .raw_sample_temp } )\n "
254
253
)
255
254
return_ws_vars .append (cut_ws )
255
+
256
256
plot_over = False if index == 0 else True
257
257
if intensity_range != (None , None ):
258
258
script_lines .append (
@@ -265,7 +265,8 @@ def add_cut_lines_with_width(errorbars, script_lines, cuts, intensity_correction
265
265
f"lw={ width } , plot_over={ plot_over } )\n \n "
266
266
)
267
267
268
- cut_start , cut_end = cut_end , min (cut_end + cut .width , integration_end )
268
+ cut_start = cut_end
269
+ cut_end = get_range_end (cut_end , integration_end , cut .width )
269
270
index += 1
270
271
cut .reset_integration_axis (cut .start , cut .end )
271
272
return return_ws_vars
0 commit comments