You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FrameworkIssues and pull requests related to components in the FrameworkStaleThis label is automatically applied to issues that are automatically closed by the stale bot
In addition to that, script below can be used to generate test md workspace (The data to test are on also on VATES validation in ftp://ftp.nd.rl.ac.uk/scratch/VATES_Validation/Fe_data.zip archive)
Then, running the script 3, generates error message
ValueError: Invalid value for property InputWorkspace (MatrixWorkspace) "cut1_1D": Workspace cut1_1D is not of the correct type
at line 18 in 'D:/users/abuts/SVN/Mantid/VATES_Validation/Russell/cut2D_1D.py'
caused by line 568 in 'C:/mprogs/MantidNightlyInstall/bin\mantid\simpleapi.py'
caused by line 530 in 'C:/mprogs/MantidNightlyInstall/bin\mantid\simpleapi.py'
And attempt to run ConvertToMatrixWorkspace from GUI crashes Mantid
Script 2: Build test mD workspace
import os
#
data_path=os.path.dirname(os.path.realpath(__file__))
config.appendDataSearchDir(data_path)
config['defaultsave.directory']=data_path
# set up target ws name and remove target workspace with the same name which can occasionally exist.
# list of MD files (workspaces) to combine into target MD workspace
MD_FilesList='';
# define convetr to MD parameters
pars = dict();
pars['InputWorkspace']=''
pars['QDimensions']='Q3D'
pars['dEAnalysisMode']='Direct'
pars['Q3DFrames']='HKL'
pars['QConversionScales']='HKL'
pars['PreprocDetectorsWS']='preprDetMantid'
pars['MinValues']='-3,-3,-3,-40.0'
pars['MaxValues']='7,7,3,380.0'
pars['SplitInto']=50
pars['MaxRecursionDepth']=1
pars['MinRecursionDepth']=1
pars['OverwriteExisting']=1 # Change this to false, if the files should/can be added in memory
# test script combines all contributed files in memory
pars['OverwriteExisting']=0 # Change this to false, if the files should/can be added in memory
#
#---> Start loop over contributing files
psi=range(0,90,2)
#psi=range(0,4,2)
for n in range(len(psi)):
source_file = 'map'+str(15052+n)+'_ei400.nxspe'; # redefine source files list as function of loop number
target = 'MDMAP_psi'+str(n*2)+'.nxs';
# check if the file already been converted to MD and is there
if not(os.path.exists(target )):
print 'Converting ',source_file
current_ws=LoadNXSPE(Filename=source_file)
#### For the sample script, simulate load operation above
#current_ws = CreateSimulationWorkspace(Instrument='MAP',BinParams=[-3,1,3],UnitX='DeltaE',OutputWorkspace=source_file)
AddSampleLog(Workspace=current_ws,LogName='Ei',LogText='400.0',LogType='Number')
#### Add iformation which is not stored in the nxspe file
# Add UB matrix (lattice and the beam direction)
SetUB(Workspace=current_ws,a='2.87',b='2.87',c='2.87',u='1,0,0',v='0,1,0')
# Add crystal rotation (assume rotation abgle Psi=5*n where n is file number. Define list of angles if this is not correct
AddSampleLog(Workspace=current_ws,LogName='Psi',LogText=str(psi[n])+'.',LogType='Number') # --correct Psi value may be already in nxspe file. This operation is then unnecessary
# set crystal rotation
SetGoniometer(Workspace=current_ws,Axis0='Psi,0,1,0,1')
# Convert to MD
pars['InputWorkspace']=current_ws;
md_ws=ConvertToMD(**pars)
# save MD for further usage -- disabled in test script
SaveMD(md_ws,Filename=target);
DeleteWorkspace(md_ws); # delete intermediate workspace to save memory
DeleteWorkspace(current_ws);
# add the file name of the file to combine
if (len(MD_FilesList) == 0):
MD_FilesList = target;
else:
MD_FilesList=MD_FilesList+','+target;
#---> End loop
print(MD_FilesList)
# merge md files into file-based MD workspace
md_ws = MergeMDFiles(MD_FilesList,OutputFilename='TestSQW_1.nxs',Parallel='0');
# plot results using sliceviewer
#plotSlice(md_ws)
# produce some test output
#print "Resulting MD workspace contains {0} events and {1} dimensions".format(md_ws.getNEvents(),md_ws.getNumDims())
#print "MD workspace ID is:\n",md_ws.id
print "--------------------------------------------"
Script 3: Make cut and convert:
import os
#
data_path=os.path.dirname(os.path.realpath(__file__))
config.appendDataSearchDir(data_path)
config['defaultsave.directory']=data_path
if 'md_ws' in mtd:
md_ws=mtd['md_ws'];
else:
md_ws=LoadMD(Filename='TestSQW_1.nxs');
cut2_MD=SliceMD(InputWorkspace='md_ws', AxisAligned=False, NormalizeBasisVectors=False,\
BasisVector0='[h:k:0],rlu,1,1,0,0', BasisVector1='dE,mEv,0,0,0,1', BasisVector2='[mh:k:0],rlu,-1,1,0,0', BasisVector3='l,rlu,0,0,1,0', OutputExtents='-3,3,0,280,-1.1,-0.9,-0.1,0.1', OutputBins='120,70,1,1')
cut1_1D=BinMD(cut2_MD,AxisAligned=True,AlignedDim0='[h:k:0],-3,3,120',AlignedDim1='dE,100,110,1')
cut1D_1d_mws=ConvertToMatrixWorkspace(cut1_1D)
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you feel this is incorrect please comment to keep it alive, with a reason why.
To prevent closure, e.g. for long-term planning issues, add the "Never Stale" label.
stalebot
added
the
Stale
This label is automatically applied to issues that are automatically closed by the stale bot
label
Feb 23, 2021
FrameworkIssues and pull requests related to components in the FrameworkStaleThis label is automatically applied to issues that are automatically closed by the stale bot
This issue was originally TRAC 10523
This ticket is blocks : TRAC10526
The script below fails with mysterious message:
If one uncomments penultimate statement and comment the one before it, then it passes.
The data used in the script are in ftp://ftp.nd.rl.ac.uk/scratch/VATES_Validation/ folder.
In addition to that, script below can be used to generate test md workspace (The data to test are on also on VATES validation in ftp://ftp.nd.rl.ac.uk/scratch/VATES_Validation/Fe_data.zip archive)
Then, running the script 3, generates error message
And attempt to run ConvertToMatrixWorkspace from GUI crashes Mantid
Script 2: Build test mD workspace
Script 3: Make cut and convert:
The text was updated successfully, but these errors were encountered: