Ticket #10351 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Enable Second white beam in ISIS reduction

Reported by: Alex Buts Owned by: Alex Buts
Priority: blocker Milestone: Release 3.3
Component: Direct Inelastic Keywords:
Cc: devashibhai.adroja@… Blocked By:
Blocking: Tester: Federico M Pouzols

Description

User needs it to process his data from recent cycle

Attachments

Vanadium.png (14.8 KB) - added by Alex Buts 6 years ago.

Change History

comment:1 Changed 6 years ago by Martyn Gigg

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Alex Buts

  • Status changed from assigned to inprogress

refs #10351 This should do it

Changeset: d2d639c41a71a85b62b4655e1eb504265e7a34ab

comment:3 Changed 6 years ago by Alex Buts

REFS #10351 a bit more needs to change

Changeset: 7450a0f59198821516d50c343eca702c0a019d87

comment:4 Changed 6 years ago by Alex Buts

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

Changes to the dgreduce are trivial and tested providing white beam vanadium run number corresponding to the new vanadium number. (Script provided below) Instrument scientist should be an ultimate judge of the changes correctness.

If you want to look at the results, here it is: The picture illustrates new (smaller mass) vanadium reduced as sample using old white-beam and new white-beam as the base for normalization integral. (It also divided by 10 -- Mslice feature)

the "Straight line" should me at 41 mb/sr but is lower by the ratio of white beam vanadium masses. (32/7.8) To account for changes one has to multiply the target workspace by the ratio of the masses

After consultation with instrument scientist I have not put this ratio into general reduction but placed it into particular user script below.

Due to specific nature of the changes and very narrow range of their usage I suggest just merge the changes into master if all system test completed successfully.

"""
sample Direct inelastic reduction for MERLIN performed in absolute units
"""
from qtiGenie import *
#from PySlice2 import *

# Calculates

inst='MER'
iliad_setup(inst)

# where to save results (usually specified in Mantid, data search directories)
config['defaultsave.directory']=r'd:\Data\Mantid_Testing\14_10_02'
save_dir = config.getString('defaultsave.directory')

print "Data will be saved into: ",save_dir
# map mask and cal file, again the values from Mantid, data search directories can be modified here
config.appendDataSearchDir(r'c:\Users\wkc26243\Documents\work\InstrumentFiles\merlin')
# data (raw or nxs) run files -- values from data search directories can be modified here
config.appendDataSearchDir(r'd:\Data\Mantid_Testing\14_10_02')
#load vanadium file   
whitebeamfile="14338" #old white beam vanadium with sample data
if not('wb_wksp' in mtd):
    wb_wksp=LoadRaw(Filename=whitebeamfile,LoadLogFiles="0")
MonoVanWB="wb_wksp"


# Mandatory positional parameters
ei=60
rebin_params=[-50, 0.2, 58]
MonoVanRun=[23635]  #white beam vanadium run for this is 23012

if not('monovan_wksp' in mtd):
    monovan_wksp,monovan_wksp_monitors=Load(Filename=str(MonoVanRun[0]),LoadLogFiles="0",LoadMonitors='1')
else:
    monovan_wksp = mtd['monovan_wksp'];
    
#RenameWorkspace(InputWorkspace="monovan_wksp_Monitors",OutputWorkspace="monovan_wksp_monitors")


#params['monovan_mapfile']='rings_125.map'
#   Other positional  parameters
mapfile='rings_125' # ring map file is used for powder.  if absent, idf file value is used instead
# key-coded parameters
params={}
params['vanadium-mass']=7.85 #32.62   #   7.85
params['monovan_integr_range']=[-50,50]
params['norm_method']='current'
params['det_cal_file']='det_corr_125.dat'  #det_cal_file must be specified if the reduction sends out put to a workspace
params['sample_mass']=3.51 # 32.62 #14.25 # CeRuSi3 3.56   #CePdSi3
params['sample_rmm']= 330.7925# 325.4450 # CeRuSi3 #330.750  #CePdSi3
params['monovan_mapfile']= 'rings_125.map'  #'ringTo1Ring212.map' This is only for Mono van absolute normalization on Rings## good

params['hardmaskOnly']='Bjorn_mask.msk'

runs=[14693]  # this is old sample run

############## normal reduction####################
#

for runfile in runs:
    save_file=inst+str(runfile)+'_abs.nxspe'
    LoadRaw(Filename=str(runfile),OutputWorkspace="run_wksp",LoadLogFiles="0",LoadMonitors='Separate')

    
    w1=iliad("wb_wksp","run_wksp",ei,rebin_params,mapfile,monovan_wksp,23012,**params)
    # one has to  multiply by old vanadium to new to vanadium mass ratio to compensate for different white in beam vanadium mass-es
    w1*=(32.62/7.85)
    

    SaveNXSPE('w1',save_file)
print "All done"


Last edited 6 years ago by Alex Buts (previous) (diff)

Changed 6 years ago by Alex Buts

comment:5 Changed 6 years ago by Federico M Pouzols

  • Status changed from verify to verifying
  • Tester set to Federico M Pouzols

comment:6 Changed 6 years ago by Federico M Pouzols

  • Status changed from verifying to closed

It passed all the system tests successfully...

100% tests passed, 0 tests failed out of 218 (33 skipped)
All tests passed? True

The new/changed code looks sensible and clear. It adds a new option and is apparently fully backwards compatible so it should not interfere with with other users' work.

comment:7 Changed 6 years ago by Federico Montesino Pouzols

Merge remote-tracking branch 'origin/feature/10351_secondWhite'

Full changeset: f892eab565a4340e4fbbff7858c4303490e8f4d2

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11193

Note: See TracTickets for help on using tickets.