Ticket #8378 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Implement gamma correction for vesuvio

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: blocker Milestone: Release 3.1
Component: Indirect Inelastic Keywords:
Cc: Blocked By:
Blocking: Tester: Roman Tolchenov

Description (last modified by Martyn Gigg) (diff)

Andrew Seel has sent the fortran code for the current gamma correction on VMS. We need to include this within Mantid.

The attached image shows the results from the VMS manual.

Attachments

IMG_20131209_111244.jpg (2.9 MB) - added by Martyn Gigg 7 years ago.
IP0004_10.par (7.2 KB) - added by Martyn Gigg 7 years ago.

Change History

comment:1 Changed 7 years ago by Martyn Gigg

  • Summary changed from Implement gaama correction for vesuvio to Implement gamma correction for vesuvio

comment:2 Changed 7 years ago by Martyn Gigg

  • Status changed from new to inprogress

comment:3 Changed 7 years ago by Martyn Gigg

Add foil & foil-changer positions to Vesuvio IDF.

Refs #8378

Changeset: 125d559f02e864cb1edf603e3648e079c4d49c03

comment:4 Changed 7 years ago by Martyn Gigg

Rename VESUVIO analyser parameters to make way for foil parameters.

There are foil parameters that will require similar names so they have been made more explicit. Refs #8378

Changeset: 68b834993da79d891cf538a4bcdc6b8097576b80

comment:5 Changed 7 years ago by Martyn Gigg

Add resolution parameters for the foil components.

Refs #8378

Changeset: 7dfd416920aeb81b0988b0dcad45656cd863ac68

comment:6 Changed 7 years ago by Martyn Gigg

Skeleton algorithm & test.

Refs #8378

Changeset: 0b5f5561908cfd44358cb6f7f5a33223e52fdb3c

comment:7 Changed 7 years ago by Martyn Gigg

Have separate names in Vesuvio definition for foils in position 0 & 1.

Refs #8378

Changeset: 5a4e7e52d8495f716a86f703b6ef42b21e246ee1

comment:8 Changed 7 years ago by Martyn Gigg

Add/rename some helper methods in ComptonProfileTestHelpers.

Refs #8378

Changeset: 8e62e0cbfc68827e50cc9be080fdd6587bf1eb82

comment:9 Changed 7 years ago by Martyn Gigg

Fix VESUVIO foil shape/location definitions.

The shapes are slightly more accurate to improve theta calculation. Refs #8378

Changeset: 3af0c0cc7d4d72746d48791157bfeeacaa833c39

comment:10 Changed 7 years ago by Martyn Gigg

Algorithm now caches required instrument geometry.

Refs #8378

Changeset: f39772071928b3ac5a0f2a46a8a2d63cc9593cd4

comment:11 Changed 7 years ago by Martyn Gigg

Convert CalculateGammaBackground to use input function.

This will allow it to use the same function types that has been set during the fitting procedure and does not then hard-code the mass profiles that will be used to calculate the spectrum. VESUVIO parameters have been tidied up and the foil-specific ones added. Refs #8378

Changeset: 6e6f7e1732cfbcf785fdeead97c2e356f0b872cd

comment:12 Changed 7 years ago by Martyn Gigg

Fix foil position definitions so that they sit at phi=0

The foil-changer also has been changed to switch the radius with the height. This now gives the correct integration range for CalculateGammaBackground Refs #8378

Changeset: cca181b5ffc08425809ea3467a46b9e6258ee6b1

comment:13 Changed 7 years ago by Martyn Gigg

Fix the theta/phi angles for the forward scattering detectors.

They all had the incorrect sign as the VMS detpos.dat file says that they all belong in the mirror positions to each other. The absolute scattering angle remains the same so the original fitting is unaffected. It does, however, affect the gamma background calculation as this relies on knowing the distance between a given foil & detector. Refs #8378

Changeset: 4c8c3b51fe39f89df419028b34a8113a4386f170

comment:14 Changed 7 years ago by Martyn Gigg

Fix spectrum Y values that do not fall in forward scattering range.

Refs #8378

Changeset: d2e7e1e2bc4216d881614a88b6c6be960423f3f5

comment:15 Changed 7 years ago by Martyn Gigg

Fix ComptonProfile attribute storage.

If the base class method is not called then the IFunction::asString method does not work as expected. Refs #8378.

Changeset: 4095a83f5da06ae23e660a89d033224a433a66ac

comment:16 Changed 7 years ago by Martyn Gigg

Refactor tests to use the same helper function.

This eliminates a function that was not used in some cpp files and could cause a compiler warning. Refs #8378

Changeset: 4da04053c1ac735b54c7a9e6cdc3f1429aa22d42

comment:17 Changed 7 years ago by Martyn Gigg

  • Description modified (diff)

Changed 7 years ago by Martyn Gigg

comment:18 Changed 7 years ago by Martyn Gigg

  • Description modified (diff)

Changed 7 years ago by Martyn Gigg

comment:19 Changed 7 years ago by Martyn Gigg

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

Branch: feature/8378_gamma_correction

Tester: The required files are EVS14188-14195 on the ISIS archive along with the attached IP file. Download the IP file & tick archive searching in the manage user directories and this should fine the required files. The script is a stripped down version of what would be used by the users. The Fit-like function string will usually be created by a separate method using the results from an earlier Fit.

Here the results of plotting the final 3 workspaces together should reproduce the attached image from the VMS manual. As usual ultimate acceptance will have to be provided by the instrument scientists but this should at least give a very good start.

from mantid.simpleapi import *

#
# Load
# 
runs = "14188-14195"
spectra = "135-142"
diff_type="SingleDifference" # Allowed values=Single,Double,Thick
ip_file = "IP0004_10.par"

raw_ws = LoadVesuvio(Filename=runs, SpectrumList=spectra,
                     Mode=diff_type,InstrumentParFile=ip_file)
raw_ws = CropWorkspace(raw_ws,XMin=50.0,XMax=562.0)


#
# Correct - Usually this string would come out of being constructed from Fit
#
mass1_str = "name=GramCharlierComptonProfile,WorkspaceIndex=0,Mass=1.007900,HermiteCoeffs=1 0 0,Width=4.226288,FSECoeff=0.498073,C_0=57.941101"
mass2_str = "name=GaussianComptonProfile,WorkspaceIndex=0,Mass=27.000000,Width=13.000000,Intensity=1.626268"
mass3_str = "name=GaussianComptonProfile,WorkspaceIndex=0,Mass=91.200000,Width=26.000000,Intensity=2.977515"
func_str = "%s;%s;%s" %(mass1_str,mass2_str,mass3_str)

background,corrected = CalculateGammaBackground(InputWorkspace=raw_ws, ComptonFunction=func_str)

raw_ws = SumSpectra(InputWorkspace=raw_ws)
background = SumSpectra(InputWorkspace=background)
corrected = SumSpectra(InputWorkspace=corrected)

comment:20 Changed 7 years ago by Roman Tolchenov

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

comment:21 Changed 7 years ago by Roman Tolchenov

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8378_gamma_correction'

Full changeset: 763efca88d62a873a55fbf7285b4cb0a0c5d3ca4

comment:22 Changed 7 years ago by Nick Draper

  • Component changed from Framework to Indirect Inelastic

comment:23 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9223

Note: See TracTickets for help on using tickets.