Commit 562b1f89 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Update WAND_satellite_test.py

parent ab97dce1
......@@ -81,7 +81,8 @@ count = Load(Filename='/HFIR/HB2C/IPTS-{}/nexus/HB2C_{}.nxs.h5'.format(van_ipts,
CalculateCountRate(Workspace=count, NormalizeTheRate=False)
s = count.getRun()
s = count.getRun()data_norm = LoadMD('/home/rwp/WAND_satellite_test.nxs')
van_average_per_pixel = s.getProperty('block_count_rate').value.mean()*s.getProperty('duration').value*60/(3840*512)*eval(grouping.replace('x','*').replace('None','1'))
......@@ -265,3 +266,61 @@ clone=CloneMDWorkspace(data_norm)
#HHL.getExperimentInfo(0).run().addProperty('W_MATRIX',[1,1,0,1,-1,0,0,0,1], True)
HKL = ConvertQtoHKLMDHisto(clone,Extents='-5.01,5.01,-5.01,5.01,-0.21,0.81',Bins='501,501,51')
clone.delete()
#####
ModVector1 = [0.05,0.05,0]
ModVector2 = [-0.1,0.05,0]
ModVector3 = [-0.05,0.1,0]
PeakRadius = [0.05,0.05,0.1]
peaks = PredictPeaks(InputWorkspace=data_norm,
ReflectionCondition=ReflectionCondition,
Wavelength=wavelength,
OutputType='LeanElasticPeak',
CalculateWavelength=False,
MinDSpacing=0.8)
peaks = CentroidPeaksMD(InputWorkspace=data_norm,
PeakRadius=PeakRadiuscen,
PeaksWorkspace=peaks)
IndexPeaks(PeaksWorkspace=peaks,
Tolerance=Tolerance,
RoundHKLs=False,
ModVector1=ModVector1,
ModVector2=ModVector2,
ModVector3=ModVector3,
MaxOrder=MaxOrder,
SaveModulationInfo=True)
peaks = PredictSatellitePeaks(Peaks=peaks,
ModVector1=ModVector1,
ModVector2=ModVector2,
ModVector3=ModVector3,
IncludeIntegerHKL=False,
MaxOrder=MaxOrder)
HFIRCalculateGoniometer(peaks, wavelength)
peaks = IntegratePeaksMD(InputWorkspace=data_norm,
PeakRadius=PeakRadius,
PeaksWorkspace=peaks,
Ellipsoid=True)
peaks = FilterPeaks(InputWorkspace=peaks,
FilterVariable='Intensity',
FilterValue=FilterValue,
Operator='>')
for p in range(peaks.getNumberPeaks()):
peak = peaks.getPeak(p)
lorentz = np.abs(np.sin(peak.getScattering()*np.cos(peak.getAzimuthal())))
peak.setIntensity(peak.getIntensity()*lorentz)
# doing this to avoid bug in sliceviewer SCD #275
clone=CloneMDWorkspace(data_norm)
HKL = ConvertQtoHKLMDHisto(clone,Extents='-5.01,5.01,-5.01,5.01,-0.21,0.81',Bins='501,501,51')
clone.delete()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment