Ticket #10454 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Indirect Bayes and Data Analysis should work at any facility

Reported by: Dan Nixon Owned by: Dan Nixon
Priority: major Milestone: Release 3.3
Component: Indirect Inelastic Keywords:
Cc: spencer.howells@… Blocked By: #10094
Blocking: Tester: Lottie Greenwood

Description (last modified by Dan Nixon) (diff)

Currently there are a few restrictions used in these workflows that mean they cannot be used unless the data comes from ISIS instruments.

This should also enable the use of S(Q,w) data in these routines.

The notable issues so far are:

  • Bayes > Quasi
  • Data Analysis > ConvFit
  • Data Analysis > Fury

This block of code causes problems in Bayes:

if facility == 'ISIS':
  CheckAnalysers(samWS,resWS,Verbose)
  efix = getEfixed(samWS)
  theta,Q = GetThetaQ(samWS)

And GetThetaQ assumes that a workspace histogram axis is in specta number (and performs a conversion to Q, which is not needed for a SQw workspace):

def GetThetaQ(ws):
  nhist = mtd[ws].getNumberHistograms() # get no. of histograms/groups
  efixed = getEfixed(ws)
  wavelas = math.sqrt(81.787/efixed) # elastic wavelength
  k0 = 4.0*math.pi/wavelas
  theta = np.array(GetWSangles(ws))
  Q = k0 * np.sin(0.5 * np.radians(theta))
  return theta, Q

GetThetaQ should be modified so that it checks the type of axis and for a workspace with a numerical axis in elastic Q will convert the Q back to angles and for a an axis in spectra number convert to elastic Q.

Change History

comment:1 Changed 6 years ago by Dan Nixon

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Dan Nixon

  • Description modified (diff)

comment:3 Changed 6 years ago by Dan Nixon

  • Status changed from assigned to inprogress

Add code to get Q and theta for spec axis in Q

Refs #10454

Changeset: 26a974efb0e2b9d79be40a92d7652008711cd6ce

comment:4 Changed 6 years ago by Dan Nixon

Allow SQw browsing for resolution

Needed for sites such as SNS who use Sqw for most interfaces

Refs #10454

Changeset: b2485cc0ad760dcae944dee22c0db20d7ea33f29

comment:5 Changed 6 years ago by Dan Nixon

Fixed a couple of issues with Fury with BASIS data

This allows the resolution parameter to be either part fo the analyser component (i.e. like ISIS instruments) or part of the instrument (which would be easier to add to SNS instruments)

Refs #10454

Changeset: 7215c4aba84bf77f6c13fbc04e9760fa974cc8ab

comment:6 Changed 6 years ago by Dan Nixon

Allow calc corrections with SQw

Refs #10454

Changeset: eba11307840a5b81c5b3802967c8b1bf5d6dec79

comment:7 Changed 6 years ago by Dan Nixon

Merge branch 'master' into bugfix/10454_idr_bayes_functional_at_any_facility

Refs #10454

Changeset: f7e4e48e087efe9f634258c0e5379a16b7442f1a

comment:8 Changed 6 years ago by Dan Nixon

ConvFit get param file from inst directory

Refs #10454

Changeset: 898b5e9e369aa31324b95145ac9c84350680c509

comment:9 Changed 6 years ago by Dan Nixon

  • Component changed from Framework to Indirect Inelastic

comment:10 Changed 6 years ago by Dan Nixon

Enable Sqw browsing for Quasi

Refs #10454

Changeset: 61ea63327cda3e7e4f35e8ac7c94f9414703459c

comment:11 Changed 6 years ago by Dan Nixon

Add Sqw to other Bayes tabs

Restruct to RES where needed

Refs #10454

Changeset: 2a3d96debdc9d771c9128d1cd60694c69e806ffd

comment:12 Changed 6 years ago by Dan Nixon

  • Blocked By 10094 added

Conflicting changes here.

comment:13 Changed 6 years ago by Dan Nixon

Merge branch 'feature/10094_support_diffraction_corrections' into bugfix/10454_idr_bayes_functional_at_any_facility

Conflicts:

Code/Mantid/scripts/Inelastic/IndirectAbsCor.py

Refs #10454

Changeset: ce80fbcba1a0149c38c2fe6e89aceefb99cbb5d4

comment:14 Changed 6 years ago by Dan Nixon

Support Sqw in Calculate Corrections

Refs #10454

Changeset: 0884d71ecbbd93c4399f69cb8121906f228ed282

comment:15 Changed 6 years ago by Dan Nixon

Merge branch 'master' into bugfix/10454_idr_bayes_functional_at_any_facility

Conflicts:

Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp

Refs #10454

Changeset: a7b273f5fd1c8a4b6d765cfbc0b267d4ef916ca1

comment:16 Changed 6 years ago by Dan Nixon

Support Sqw of Calc Corr

Refs #10454

Changeset: 0961f06e76ed52b423a8a3ed1ba2c97d04236d96

comment:17 Changed 6 years ago by Dan Nixon

This must be tested on Windows with Mantid built in Release mode.

Testing files are on babylon5/Public/DanNixon/BASIS, 33207_sqw is the sample/input 33213_sqw is the can/container/vanadium, 33213_res is the resolution.

Before starting ensure your facility is set to SNS.

There is a lot to test hence I will omit loading the files and executing the tab from the instructions.

To test:

  • ConvFit
    • Fit Type: Two Lorentzians
    • Increase FWHM a little and tie peak centers if the fit is bad
    • Run Should give a good fit
  • Fury
    • Set sample binning to 1 (Sqw is already rebinned)
    • Run
    • You may get a warning if the number of resolution bins is less than 5
  • FuryFit (optional: the fact Fury works means this must work)
    • Load what came out of Fury
    • Shift EndX to exclude the garbage at the end of the curve (this garbage is normal)
    • Shift LinearBackground.A0 such that it is close to the curve bottom
    • Run, should give a good fit
  • Elwin
    • Load some files (a selection from the elastic_scan folder would be good here)
  • MSD Fit (optional: the fact Elwin works means this must work)
    • Load what came out of Elwin
    • Run, a reasonable fit should be given between the ranges
    • (if you really have a lot of time try running Elwin with all of those runs, this should give a bit better MSD Fit data)
  • ResNorm
    • Plot Result: Fit
    • Should give a good fit
  • Quasi
    • Check Elastic Peak
    • Check Use ResNorm, select workspace created by ResNorm
    • Should give a reasonable fit when run
  • Stretch
    • Enable Elastic Peak and Sequential Fit
    • Contour plots are not great, open the spectra plots for the _Sigma and _Beta workspaces and see the goodness of fit plots between y=0 and y=1

For the next tests we will have to use ISIS SQw files since SaveNexusProcessed does not save detector mapping (#10663).

  • First generate some SQw workspaces from irs26173_graphite002_red and irs26176_graphite002_red
    • Indirect > Data Reduction > SQw
    • Rebin in Q: 0.6, 0.1, 1.8
    • Rebin in energy: -0.5, 0.05, 0.5
  • Calculate Corrections
    • Input workspace: irs26176_graphite002_sqw
    • Can workspace: irs26173_graphite002_sqw
    • Cylinder
    • Radius 1: 0.1
    • Radius 1: 0.2
    • Can Radius: 0.25
    • Step size: 0.005
    • Beam Width: 2.1
    • Sample
      • Number density: 0.1
      • Formula: H2-O
    • Can
      • Number density: 0.1
      • Formula: V
    • Save Result enabled
  • Apply Corrections
    • Input workspace: irs26176_graphite002_sqw
    • Cylinder
    • Can workspace: irs26173_graphite002_sqw
    • Use Corrections: find the file in your default save location that came from Calculate Corrections
    • Run
Last edited 6 years ago by Dan Nixon (previous) (diff)

comment:18 Changed 6 years ago by Dan Nixon

Properly support Sqw on calc/apply corrections

Refs #10454

Changeset: 6db4b71aba73b3893d7666ff7a3eac5819985aab

comment:19 Changed 6 years ago by Dan Nixon

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

comment:20 Changed 6 years ago by Lottie Greenwood

  • Status changed from verify to verifying
  • Tester set to Lottie Greenwood

comment:21 Changed 6 years ago by Lottie Greenwood

  • Status changed from verifying to verify
  • Tester Lottie Greenwood deleted

comment:22 Changed 6 years ago by Lottie Greenwood

  • Status changed from verify to verifying
  • Tester set to Lottie Greenwood

comment:23 Changed 6 years ago by Lottie Greenwood

  • Status changed from verifying to closed

comment:24 Changed 6 years ago by Dan Nixon

Merge branch 'master' into bugfix/10454_idr_bayes_functional_at_any_facility

Refs #10454

Full changeset: f7e4e48e087efe9f634258c0e5379a16b7442f1a

comment:25 Changed 6 years ago by Dan Nixon

Merge branch 'feature/10094_support_diffraction_corrections' into bugfix/10454_idr_bayes_functional_at_any_facility

Conflicts:

Code/Mantid/scripts/Inelastic/IndirectAbsCor.py

Refs #10454

Full changeset: ce80fbcba1a0149c38c2fe6e89aceefb99cbb5d4

comment:26 Changed 6 years ago by Dan Nixon

Merge branch 'master' into bugfix/10454_idr_bayes_functional_at_any_facility

Conflicts:

Code/Mantid/MantidQt/CustomInterfaces/src/ConvFit.cpp

Refs #10454

Full changeset: a7b273f5fd1c8a4b6d765cfbc0b267d4ef916ca1

comment:27 Changed 6 years ago by Lottie Greenwood

Merge remote-tracking branch 'origin/bugfix/10454_idr_bayes_functional_at_any_facility'

Full changeset: bbe0313102f03f236ec28d2fbdd822b086a9f419

comment:28 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11296

Note: See TracTickets for help on using tickets.