Ticket #8108 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

SNS ADARA files: Load the instrument from the Nexus file

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: critical Milestone: Release 3.0
Component: Framework Keywords: ADARA
Cc: Blocked By:
Blocking: #8100 Tester: Andrei Savici

Description

The nexus files from ADARA-enabled instruments include the full instrument definition XML. We should load that if it's available.

This will allow HYSPECA (an alias for HYSPEC while files were being generated by both the ADARA & legacy systems) to go away (but the files to still be loadable). In time, it will also mean that an updated instrument definition doesn't necessitate a patch release.

Change History

comment:1 Changed 7 years ago by Russell Taylor

  • Status changed from new to inprogress

Re #8108. Generalise where to look for instrument.

Remove the hard-coding pointing to the ISIS place in favour of the variable that's used everywhere else.

Changeset: 095164a382d6f0e92320d446fe27541043b606fe

comment:2 Changed 7 years ago by Russell Taylor

Re #8108. Use the LoadEventNexus loadInstrument static method.

As well as reducing code duplication, this method tries to load the instrument from the nexus file if possible.

Changeset: 594aff25cbea0eb0a16bf96edb6cb46f1ed60020

comment:3 Changed 7 years ago by Russell Taylor

Re #8108. Add a test that the instrument is read in correctly.

This is for a nexus file that contains the full instrument XML. Right now, it's still reading the external IDF - this test will make sure things still work after the refactoring.

Changeset: 1cfc94e1d659f1d0cf59a6d8656ec6d564e4d3f1

comment:4 Changed 7 years ago by Russell Taylor

Re #8108. Generalise where to look for instrument.

Remove the hard-coding pointing to the ISIS place in favour of the variable that's used everywhere else.

Changeset: ce1e29a1ecfac4a64e1b5f70b0864061b4bd3629

comment:5 Changed 7 years ago by Russell Taylor

Re #8108. Use the LoadEventNexus loadInstrument static method.

As well as reducing code duplication, this method tries to load the instrument from the nexus file if possible.

Changeset: f2f0bdaed27029784f6a46b78730276a42debd9f

comment:6 Changed 7 years ago by Russell Taylor

Re #8108. Refactor to correctly load from SNS ADARA files.

While also continuing to work for the other files that have the instrument XML inside the nexus file (processed, ISIS files).

Changeset: b424c810dcc41ac136b57923a64e96ec73ba8b92

comment:7 Changed 7 years ago by Russell Taylor

Re #8108. Add .nxs.h5 to list of file extensions.

Also fix some formatting.

Changeset: 8d799faeeacb57b59155306f272972788ed37118

comment:8 Changed 7 years ago by Russell Taylor

Re #8108. Add loading of the parameter file to LoadIDFFromNexus.

However, the algorithm doesn't fail if the parameter file is missing.

Changeset: f36487fb8724f264dcac25f765ef7d5433f1ab24

comment:9 Changed 7 years ago by Russell Taylor

Re #8108. Fix and enable the last test.

As far as I can tell, setting the filename at this point in ExperimentInfo is not necessary.

Changeset: 029f69253d3a4b53495badb0b629183068f5ee66

comment:10 Changed 7 years ago by Russell Taylor

Re #8108. Throw if unable to load instrument from IDF

Previously, this failure would just log and the calling algorithm thought it had succeeded when it hadn't.

Changeset: c7234148297d4b7958728aab0ebc0288fa99d9c7

comment:11 Changed 7 years ago by Russell Taylor

Re #8108. Remove redundant code.

The strings will be empty on construction anyway.

Changeset: ccd65b8378a1e34afd0312e47dfe3854a1f44d68

comment:12 Changed 7 years ago by Russell Taylor

Re #8108. Check early for presence of IDF in nexus file.

It seemed rather heavyweight to launch and plough through most of LoadIDFFromNexus & ExperimentInfo::loadNexus when the thing we want isn't there anyway.

Changeset: 2984b2aecfc245d14eff5a7492d797255cbbe8a7

comment:13 Changed 7 years ago by Russell Taylor

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

Tester: Branch is feature/8108_load_inst_from_adara_nexus_files

This should probably be tested at the SNS on SEQUOIA or HYSPEC files. It should be checked on an analysis that would be affected if the instrument and the parameters were not loaded correctly.

All the unit and system tests are passing so I'm fairly confident that I haven't broken anything else. There's a rudimentary unit test, but really it's not too easy to tell from the 'outside' where the instrument was loaded from. The best test is that in #8100 HYSPECA_Definition.xml was removed (this is on develop) which would mean that trying to load a HYSA file (as the unit test and one system test - StepScan - do) would fail if this had not been done correctly.

comment:14 Changed 7 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester set to Andrei Savici

comment:15 Changed 7 years ago by Andrei Savici

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Does not work as expected. I loaded HYS_28371.nxs.h5 (IPTS-9477) and it looks fine. Then I deleted HYSPEC_Definition.xml, HYSPEC_Definition.vtp, and HYSPEC_Parameters.xml from the instrument directory, and restarted MantidPlot. When I load the file, it shows some instrument, but the tank is not rotated at ~70 degrees, and monitor positions are wrong. Hyspec geometry depends on some log values, and it seems like the instrument is defined before the logs are read (or not using the logs). Strangely, if the IDF is there, it says that instrument definition is read from the nexus file, but obviously something is different

comment:16 Changed 7 years ago by Russell Taylor

  • Status changed from reopened to inprogress

Re #8108. Add a magic line to tie logfile params to components.

Changeset: 119d6b080add1c7118d43cfde80feddc35d5485e

comment:17 Changed 7 years ago by Russell Taylor

Re #8108. Fix cut-and-paste mistake.

Changeset: 564bf4ad466542c85177902a3fa12a9217ba8f99

comment:18 Changed 7 years ago by Russell Taylor

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

The problem raised in comment:15 should now be fixed.

comment:19 Changed 7 years ago by Andrei Savici

  • Status changed from verify to verifying

comment:20 Changed 7 years ago by Andrei Savici

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8108_load_inst_from_adara_nexus_files'

Full changeset: 084c85a5dc8098a8993afbb7bac63724086b50c7

comment:21 Changed 7 years ago by Andrei Savici

Tested by removing HYSPEC definition and parameter files. Instrument shows up correctly

comment:22 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8953

Note: See TracTickets for help on using tickets.