Skip to content

Slices from sliceviewer exclude regions containing NaN #40226

@ajjackson

Description

@ajjackson

Original reporter: Hamish Cavaye, ISIS

Describe the bug
S(q,w) workspaces from Abins2D use NaN to mask out inaccessible values. The spectrum appears correctly in the Slice Viewer, and regions may be selected for integration. The preview regions look like a correct average over the accessible data. However, when the cuts are saved to a new workspace with "x", "y" or "c" key commands, the NaN values are propagated through the summation and the data range is effectively reduced to a rectangular subregion that is entirely filled with data.

It is not particularly unusual for users to sample across this boundary to get better statistics, and they might reasonably want to reproduce the results with Abins2D.

To Reproduce

  1. Unzip and import this sample 2D workspace, or generate one with Abins2D.
    ethanol-2d-sample.nxs.zip

  2. Right-click and open Slice Viewer

  3. Enable region select from toolbar (square icon) and select a region that includes some "empty" (kinematically inaccessible) S(Q,w) space.

  4. Note that the preview plots cover the whole select (Q,w) range

  5. Export cuts with "c"

  6. Right-click each new cut workspaces and Plot/Spectrum

  7. Note that visible energy/q range of exported data is reduced compared to selection and preview.

Expected behavior
Output workspaces resemble the preview in Slice Viewer, covering the whole selected data range

Screenshots

Image

Platform/Version (please complete the following information):

  • OS: MacOS
  • OS Version: 14.8
  • Mantid Version: Nightly

I have also reproduced with development build on Rocky 8 linux. User was likely on another platform again.

Additional context
I have found that the x-axis behaviour can be fixed by adding RemoveSpecialValues=True to the SumSpectra calls in qt/python/mantidqt/mantidqt/widgets/sliceviewer/models/roi.py. However, I couldn't find a corresponding parameter to Rebin to fix the y-axis as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues and pull requests that are regressions or would be considered a bug by users (e.g. crashing)Reported By UserIssues that were found or highlighted by a user/scientist

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions