mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
211 stars 124 forks source link

Copy instrument parameters does not work if Instrument_Parameter_XXX.xml files have different validity scopes #9925

Closed abuts closed 9 years ago

abuts commented 10 years ago

This ticket is blocks : TRAC9364

Assume you have LET_Definition.xml file and LET_Parameters.xml file valid for now and LET_Definition_2to7.xml file and LET_Parameters_2to7.xml file valid in the past (these files are attached to the ticket.)

CopyInstrumentParameters algorithm then nullifies instrument parameters map as illustrated by the scrip below (the files used by this script are in SystemTests->Data folder.

This may be reasonable behaviour in some situations but not in the one illustrated by the script -- if this is the case, a parameter explicitly requesting overwriting parameter map should be introduced.

wb= LoadRaw(Filename='LET0000'+str(5545)+'.raw');
iwb = wb.getInstrument();
print '**************** Wanadium parameters : \n',iwb.getParameterNames();
print ' monitor 1: ',iwb.getParameterType('ei-mon1-spec'),' number =',iwb.getIntParameter('ei-mon1-spec')
fname='LET0000'+str(14305)+'.nxs'
w1,w1_monitors=Load(Filename=fname,OutputWorkspace='w1',LoadMonitors='1');
iws = w1.getInstrument();
print '**************** Run parameters : \n',iws.getParameterNames();
print ' monitor 1: ',iws.getParameterType('ei-mon1-spec'),' number =',iws.getIntParameter('ei-mon1-spec')

CopyInstrumentParameters(InputWorkspace=wb,OutputWorkspace=w1)

w1=mtd['w1'];
iws = w1.getInstrument();
print '**************** Run calibrated parameters : \n',iws.getParameterNames();
abuts commented 9 years ago

This issue was originally trac ticket 9082

abuts commented 9 years ago

http://trac.mantidproject.org/mantid/raw-attachment/ticket/9082/LET_Definition.xml (uploaded by @abuts on 2014-02-25T10:34:55)


http://trac.mantidproject.org/mantid/raw-attachment/ticket/9082/LET_Parameters.xml (uploaded by @abuts on 2014-02-25T10:35:17)


http://trac.mantidproject.org/mantid/raw-attachment/ticket/9082/LET_Definition_dr2to7.xml (uploaded by @abuts on 2014-02-25T10:35:29)


http://trac.mantidproject.org/mantid/raw-attachment/ticket/9082/LET_Parameters_dr2to7.xml (uploaded by @abuts on 2014-02-25T10:35:38)