Skip to content

Commit 3791c8d

Browse files
committed
bugfix for issue StingraySoftware#851
1 parent 818f913 commit 3791c8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stingray/simulator/transfer.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ def simple_ir(dt=0.125, start=0, width=1000, intensity=1):
252252
# Fill in 0 entries until the start time
253253
h_zeros = np.zeros(int(start / dt))
254254

255-
# Define constant impulse response
256-
h_ones = np.ones(int(width / dt)) * intensity
255+
# Define constant impulse response (Fixed the bug)
256+
num_ones = max(int(np.round(width / dt)), 1) # Ensure at least one bin
257+
h_ones = np.ones(num_ones) * intensity
257258

258259
return np.append(h_zeros, h_ones)
259260

0 commit comments

Comments
 (0)