Ticket #8990 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Loading Monitors on EventWorkspaces

Reported by: Owen Arnold Owned by: Federico M Pouzols
Priority: critical Milestone: Release 3.3
Component: Framework Keywords:
Cc: Blocked By:
Blocking: #10595 Tester: Roman Tolchenov

Description

There is an option fro MonitorsAsEvents on LoadEventNexus. Having this selected or deselected always results in having monitors as Event Workspaces. Tested using POLREF00009955.nxs

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

Bulk move to assigned at the introduction of the triage step

comment:2 Changed 6 years ago by Federico M Pouzols

  • Owner changed from Anyone to Federico M Pouzols
  • Milestone changed from Backlog to Release 3.3

comment:3 Changed 6 years ago by Federico M Pouzols

  • Blocking 10595 added

comment:4 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from assigned to inprogress

Add new 'MonitorsAsEvents' property in LoadNexusMonitors, re #8990

Changeset: e5e77eeed220019ffdc0d56ae855dfbcac63413d

comment:5 Changed 6 years ago by Federico Montesino Pouzols

Support for MonitorsAsEvents option, re #8990

Changeset: 4f1b8d1f131960b069b88c9badc467efc0264cdd

comment:6 Changed 6 years ago by Federico Montesino Pouzols

fix doc and clean comments, re #8990

Changeset: 03f3307e8b84edd3060e2b6a51bc5943aafc1be7

comment:7 Changed 6 years ago by Federico M Pouzols

  • Status changed from inprogress to verify
  • Resolution set to fixed

This is what I was experiencing:

Untick 'Load Monitors' => correct behavior, you just get the event workspace and no monitor workspace

But when I tick 'Load Monitors' I get the following (regardless of whether I tick or not 'MonitorsAsEvents'):

  • with POLREF00004699.nxs (does not have event monitor data, hasEventMonitors()==0) : all monitor workspaces are Workspace2D
  • with POLREF00009955.nxs (has event monitor data, hasEventMonitors()==1): all monitor workspaces are EventWorkspace

I think the issue lies in that the LoadEventNexus algorithm is using LoadNexusMonitors as a child algorithm to load monitors. LoadNexusMonitors will create an EventWorkspace if the input file contains event monitors, and a Workspace2D otherwise. To me this looks consistent. LoadEventNexus provides the option 'MonitorsAsEvents' but it seems that such functionality was not implemented (for non event monitors) or was lost when other changes were made.

LoadEventNexus is relying on LoadNexusMonitors which will load into the appropriate type of workspace depending on what data is found in the file (EventWorkspace if there are event data or Workspace2D if there are spectra). This ignores the 'MonitorsAsEvents' option as noted in the ticket description. LoadEventNexus calls LoadNexusMonitors which finds events in monitors (POLREF00009955) and constructs an EventWorkspace.

Solution: a new property 'MonitorsAsEvents' has been added to LoadNexusMonitors(), with a default value of True (consistent with previous behavior). If you set it to false, then LoadNexusMonitors will not try to load events and will generate a Workspace2D.

Note that the documentation of LoadNexusMonitors is outdated and says that it only loads into Workspace2D, and only SNS files. This is being fixed in ticket #10595. There's another ticket related to LoadNexusMonitors: #9248, and as suggested by Anders I might be opening a maintenance ticket for LoadEventNexus.

To test:

Use at least:

  • a file that has event monitor data (example: POLREF00009955.nxs, from ISIS machines you find it under \\ISIS\inst$\NDXPOLREF\Instrument\data\cycle_14_4, or contact me)
  • a file without event monitor data (example: POLREF00004699.nxs, found in Test/AutoTestData/UsageData)

Apply/execute LoadEventNexus on these files, enabling LoadMonitors, and check that

  • you get the monitor data into an EventWorkspace if you select/tick 'MonitorsAsEvents',
  • but you get them into a Workspace2D if you deselect/untick 'MonitorsAsEvents'.

This should be the behavior for both types of files.

By mistake I called this a "feature/..." where it should be 'bugfix/...' branch, although after finding out what was the issue it's not clear if this is a bugfix or a feature that is being implemented.

Last edited 6 years ago by Federico M Pouzols (previous) (diff)

comment:8 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to reopened
  • Resolution fixed deleted

I can't be 100% sure but I think this may have broken a system test: http://builds.mantidproject.org/job/develop_systemtests_rhel6/lastCompletedBuild/testReport/SystemTests/StepScan/StepScanWorkflowAlgorithm/

There is an error message:

LoadNexusMonitors-[Error] Error in execution of algorithm LoadNexusMonitors:
LoadNexusMonitors-[Error] NXopendata(data) failed
LoadEventNexus-[Error] Error while loading the monitors from the file. File may contain no monitors.
Last edited 6 years ago by Martyn Gigg (previous) (diff)

comment:9 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from reopened to inprogress

back to old, in case this is breaking a systemtest, re #8990

Changeset: 52253c0f9e80f0e911dedfcc5066c205b52b8fea

comment:10 Changed 6 years ago by Federico Montesino Pouzols

Catch exception by ref, re #8990

Changeset: ce82c1046910e9aa350dca0c8c468767f3ccbb32

comment:11 Changed 6 years ago by Federico M Pouzols

  • Status changed from inprogress to verify
  • Resolution set to fixed

Yes, this ticket was breaking the StepScan system test. That test loads a file that happens to be NeXus, requesting to load monitors but not as event data. But the file only has event data for monitors so it is not possible to load histogram data. This has been fixed by adding a check for that kind of inconsistency, and when it happens the code will show a warning and load what can be loaded. Note that there are more cases in LoadEventNexus and LoadNexus... that need to be handled more gracefully. That is being done in tickets #9248 and #10619. System tests seem to have been happy for a while now.

For an explanation of what was happening, and how to test, go up to comment:7.

Last edited 6 years ago by Federico M Pouzols (previous) (diff)

comment:12 Changed 6 years ago by Federico M Pouzols

  • Summary changed from Loading Montitors on EventWorkspaces to Loading Monitors on EventWorkspaces

comment:13 Changed 6 years ago by Federico M Pouzols

To test: please follow instructions at the end of comment:7

comment:14 Changed 6 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

comment:15 Changed 6 years ago by Roman Tolchenov

  • Status changed from verifying to reopened
  • Resolution fixed deleted

The algorithm works fine but there is a conflict in LoadNexusMonitors.h when merging it into master.

comment:16 Changed 6 years ago by Federico M Pouzols

  • Status changed from reopened to verify
  • Resolution set to fixed

Aha, two method declarations had been added in the same place from two different branch. But they're compatible. I've just merged master into this branch and sorted out the conflict. Hopefully it will work well now...

comment:17 Changed 6 years ago by Roman Tolchenov

  • Status changed from verify to verifying

comment:18 Changed 6 years ago by Federico Montesino Pouzols

  • Status changed from verifying to closed

Merge branch 'master' into feature/8990_loading_monitors_or_not_in_load_event_nexus

Conflicts:

Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors.h

Two methods were added in the same place, but they are not conflicting

Full changeset: 7f700385005af9a4ce1dc49e7412104e08d9722c

comment:19 Changed 6 years ago by Federico Montesino Pouzols

Merge branch 'master' into feature/8990_loading_monitors_or_not_in_load_event_nexus

Full changeset: 788886192d627e3a5abc75b2f54bee01a8561126

comment:20 Changed 6 years ago by Roman Tolchenov

Merge remote-tracking branch 'origin/feature/8990_loading_monitors_or_not_in_load_event_nexus'

Full changeset: 1030fae41630d29dfd7b3a6d1ea5c354bbe3fe35

comment:21 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9833

Note: See TracTickets for help on using tickets.