Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of bounds error in IntegratePeaksShoeboxTOF #38143

Open
RichardWaiteSTFC opened this issue Oct 3, 2024 · 0 comments
Open

Out of bounds error in IntegratePeaksShoeboxTOF #38143

RichardWaiteSTFC opened this issue Oct 3, 2024 · 0 comments
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS Single Crystal Issues and pull requests related to single crystal
Milestone

Comments

@RichardWaiteSTFC
Copy link
Contributor

Describe the bug

Error in execution of algorithm IntegratePeaksShoeboxTOF:
index 0 is out of bounds for axis 0 with size 0
  at line 434 in '/mnt/ceph/home/rw1061637/.conda/envs/mantid-unstable/plugins/python/algorithms/IntegratePeaksShoeboxTOF.py'

To Reproduce
Found integrating predicted peaks in run SXD34361
(1) Ask me for .nxs files of workspace and peaks
(2) Run this script

ws = Load(Filename='SXD34361_processed.nxs', OutputWorkspace='SXD34361')
peaks = Load(Filename='SXD34361_peaks.nxs', OutputWorkspace='SXD34361 _peaks')

params = {"NRows": 7, "NCols": 7, "GetNBinsFromBackToBackParams": True, 
          "NFWHM": 3, "NShoeboxInWindow": 3, 
          "WeakPeakThreshold": 20, 
          "WeakPeakStrategy": "NearestStrongPeak",
          "IntegrateIfOnEdge": False, "LorentzCorrection": True}
          
peaks_int = IntegratePeaksShoeboxTOF(InputWorkspace=ws, PeaksWorkspace=peaks, OutputWorkspace='peaks_int', **params)

Expected behavior
Would not crash - the problem seems to be here

ipos = [*np.argwhere(ispecs == weak_pk.ispec)[0], np.argmin(abs(x - weak_pk.tof))]

It looks like weak_pk.ispec is not in ispecs perhaps because the shoebox has been moved/optimised?

Screenshots

Platform/Version (please complete the following information):

  • OS: [e.g. Windows, RHEL 7, Ubuntu, macOS]
  • OS Version:
  • Mantid Version [e.g. 6.0.0]

Additional context

@RichardWaiteSTFC RichardWaiteSTFC added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction Single Crystal Issues and pull requests related to single crystal ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS labels Oct 3, 2024
@RichardWaiteSTFC RichardWaiteSTFC added this to the Release 6.11 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS Single Crystal Issues and pull requests related to single crystal
Projects
Status: No status
Development

No branches or pull requests

1 participant