mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
211 stars 124 forks source link

Instrument view crashed on peak overlay #37514

Closed RichardWaiteSTFC closed 3 months ago

RichardWaiteSTFC commented 5 months ago

Describe the bug Overlaying a specific peaks workspace crashes instrument view - the vast majority of peak workspaces are fine so this has been hard to reproduce. But I now have some files for which it is consistently reproducible.

To Reproduce (1) Load in this workspaces (on my babylon)

The instrument workspace is "\\olympic\Babylon5\Public\RWaite\UBs_NickF\SXD34361_processed.nxs" The peaks workspace is "\\olympic\Babylon5\Public\RWaite\UBs_NickF\SXD34361_peaks_predicted.nxs"

If these aren't available let me know I have a copy on my desktop

(2) Open the instrument workspace SXD34361_processed in instrument viewer

(3) Overlay the peaks workspace SXD34361_peaks_predicted by dragging from the workspace list onto the instrument viewer

Mantid crashes, with no error reporter or stack trace

Expected behavior Not crash, would overlay peaks

Platform/Version (please complete the following information):

jclarkeSTFC commented 5 months ago

This particular example is caused by a peak having a detector ID of -1:

image

Maybe the other peak workspaces also have the same thing? We can improve it so that this doesn't take down Mantid in future.

RichardWaiteSTFC commented 5 months ago

Thanks for that - yes I think this can also happen if you predict peaks outside detector coverage for instruments that support extended detector space (e.g. WISH). For instruments that don't it makes sense not to plot them - it would be worth checking on WISH using PredictPeaks and predict outside detector

jclarkeSTFC commented 5 months ago

It looks to me from PeakOverlay::createMarkers() that a peak location for drawing the markers is just taken from the corresponding detector, not from any data on the peak, so it seems like that would need to change in this case.

jhaigh0 commented 5 months ago

Did you move the file you mentioned? I can only see these for SXD34361 image

RichardWaiteSTFC commented 5 months ago

I think all you need is a peak table with a null detector ID - here is the one I was using (renamed to .txt) SXD34361_peaks_predicted.nxs.txt