Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate Flat background removes backgound from monitors. #10155

Closed
abuts opened this issue Apr 8, 2014 · 1 comment
Closed

Calculate Flat background removes backgound from monitors. #10155

abuts opened this issue Apr 8, 2014 · 1 comment
Assignees
Labels
Framework Issues and pull requests related to components in the Framework
Milestone

Comments

@abuts
Copy link
Member

abuts commented Apr 8, 2014

This ticket is blocks : TRAC9135

This should never happens.

The script below provides workspace 2 match either when calculateFlatBackground is disabled or when one explicitly provides the list of the spectra, which excludes monitors. This actually means that it removes background from monitors which is useless operation and dangerous operation. Instrument scientists were complaining to me about strange behaviour of the background removal, but I did not understood the reason behind this.

Should be fixed.

######################################################################
#Python Script Generated by GeneratePythonScript Algorithm
######################################################################
Load(Filename=r'd:\Data\MantidSystemTests\Data\MAR11001.raw',OutputWorkspace='MAR11001.raw')
LoadDetectorInfo(Workspace='MAR11001.raw',DataFilename=r'd:\Data\MantidSystemTests\Data\MAR11060.raw',RelocateDets='1')

GetEi(InputWorkspace='MAR11001.raw',Monitor1Spec='2',Monitor2Spec='3',EnergyEstimate='12')
ScaleX(InputWorkspace='MAR11001.raw',OutputWorkspace='11001.spe',Factor='-6536.707778516824',Operation='Add',InstrumentParameter='DelayTime',Combine='1')
MoveInstrumentComponent(Workspace='11001.spe',ComponentName='Moderator',Z='-1.4419999999999999',RelativePosition='0')

ConvertToDistribution(Workspace='11001.spe')
spectra=range(3,921);
CalculateFlatBackground(InputWorkspace='11001.spe',OutputWorkspace='11001.spe',WorkspaceIndexList=spectra,StartX='11463.292221483176',EndX='12963.292221483176',Mode='Mean')
ConvertFromDistribution(Workspace='11001.spe')
#
CropWorkspace(InputWorkspace='11001.spe',OutputWorkspace='11001_OldCFine.spe',StartWorkspaceIndex='3',EndWorkspaceIndex='921')
#
NormaliseToMonitor(InputWorkspace='11001.spe',OutputWorkspace='11001.spe',MonitorSpectrum='1',IntegrationRangeMin='-5536.7077785199999',IntegrationRangeMax='-4536.7077785199999',IncludePartialBins='1')
CropWorkspace(InputWorkspace='11001.spe',OutputWorkspace='11001_step1aOldC.spe',StartWorkspaceIndex='3',EndWorkspaceIndex='921')
############################################################################################################

######################################################################
#Python Script Generated by GeneratePythonScript Algorithm
######################################################################
Load(Filename=r'd:\Data\MantidSystemTests\Data\MAR11001.raw',OutputWorkspace='MAR11001.raw',LoadMonitors='Separate')
LoadDetectorInfo(Workspace='MAR11001.raw',DataFilename=r'd:\Data\MantidSystemTests\Data\MAR11060.raw',RelocateDets='1')

GetEi(InputWorkspace='MAR11001.raw_Monitors',Monitor1Spec='2',Monitor2Spec='3',EnergyEstimate='12')
AddSampleLog(Workspace='MAR11001.raw',LogName='Ei',LogText='12.9728953307',LogType='Number')
ScaleX(InputWorkspace='MAR11001.raw_Monitors',OutputWorkspace='11001.spe_monitors',Factor='-6536.707778516824',Operation='Add',InstrumentParameter='DelayTime',Combine='1')
ScaleX(InputWorkspace='MAR11001.raw',OutputWorkspace='11001.spe',Factor='-6536.707778516824',Operation='Add',InstrumentParameter='DelayTime',Combine='1')
MoveInstrumentComponent(Workspace='11001.spe',ComponentName='Moderator',Z='-1.4419999999999999',RelativePosition='0')
#
ConvertToDistribution(Workspace='11001.spe')
CalculateFlatBackground(InputWorkspace='11001.spe',OutputWorkspace='11001.spe',StartX='11463.292221483176',EndX='12963.292221483176',Mode='Mean')
ConvertFromDistribution(Workspace='11001.spe')
#
CloneWorkspace(InputWorkspace='11001.spe',OutputWorkspace='11001NewFine')

rez=CheckWorkspacesMatch('11001NewFine','11001_OldCFine.spe');
print ' Match1=',rez

# Causes difference:
NormaliseToMonitor(InputWorkspace='11001.spe',OutputWorkspace='11001.spe',MonitorWorkspace='11001.spe_monitors',IntegrationRangeMin='-5536.7077785199999',IntegrationRangeMax='-4536.7077785199999',IncludePartialBins='1')
#AddSampleLog(Workspace='11001.spe',LogName='DirectInelasticReductionNormalisedBy',LogText='monitor-1')


rez=CheckWorkspacesMatch('11001_step1aOldC.spe','11001.spe');
print ' Match2=',rez


@abuts
Copy link
Member Author

abuts commented Jun 3, 2015

This issue was originally trac ticket 9312

@abuts abuts added the Framework Issues and pull requests related to components in the Framework label Jun 3, 2015
@abuts abuts self-assigned this Jun 3, 2015
@abuts abuts added this to the Release 3.2 milestone Jun 3, 2015
@abuts abuts closed this as completed Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework
Projects
None yet
Development

No branches or pull requests

1 participant