Ticket #3318 (closed)

Opened 9 years ago

Last modified 5 years ago

Have maskWorkspaceIndex function for EventWorkspace

Reported by: Michael Reuter Owned by: Janik Zikovsky
Priority: major Milestone: Iteration 30
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Reuter

Description

The function maskWorkspaceIndex should be able to work on an EventWorkspace. Currently, it throws an exception:

EventWorkspace::dataY cannot return a non-const array: you can't modify the histogrammed data in an EventWorkspace!

I think is should erase the events and/or make the weights zero and remove the histogram representation.

Change History

comment:1 Changed 9 years ago by Janik Zikovsky

  • Status changed from new to accepted

Have been putting this in as part of my ISpectrum initiative.

comment:2 Changed 9 years ago by Janik Zikovsky

(In [13047]) - Refs #3203: Implemented ISpectrum. It is the base class of EventList and Histogram and contains the spectrum number and list of detector IDs for a given spectrum.

  • ISpectrum return X/Y/E vectors. EventList, e.g. calculates the histogram on the fly.
  • Moved the EventWorkspace MRU list of histograms to be contained within the EventList; better code separation. Made a EventWorkspaceMRU class to encapsulate this more easily.
  • Workspaces must implement getSpectrum (const/not const) to return a ISpectrum object. dataX(i), etc. methods on MatrixWorkspaces no longer need to be overridden since they call getSpectrum()
  • Got rid of EventWorkspace::getEventListatPixelID() and doneLoadingData()
  • replaceSpectraMap() methods offers backwards-compatibility with SpectraDetectorMaps by setting the specNo and detector list when called. Must be called AFTER creating all the spectra in a workspace.
  • Refs #3318: maskWorkspaceIndex() implemented as part of ISpectrum.

comment:3 Changed 9 years ago by Janik Zikovsky

  • Status changed from accepted to closed
  • Resolution set to fixed

In [13193]:

Fixes #3318: maskWorkspaceIndex tested for EventWorkspaces.

comment:4 Changed 9 years ago by Nick Draper

  • Status changed from closed to verify
  • Resolution fixed deleted

Corrected status to verify

comment:5 Changed 9 years ago by Russell Taylor

In [13296]:

As it previously did, MatrixWorkspace::maskWorkspaceIndex should zero the data even if there's no detector related to the spectrum. Re #3318.

comment:6 Changed 9 years ago by Michael Reuter

  • Status changed from verify to verifying
  • Tester set to Michael Reuter

comment:7 Changed 9 years ago by Michael Reuter

  • Status changed from verifying to closed

This seems to be doing the correct thing.

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4165

Note: See TracTickets for help on using tickets.