diff --git a/Code/Mantid/docs/source/algorithms/DSFinterp-v1.rst b/Code/Mantid/docs/source/algorithms/DSFinterp-v1.rst index 7d52a14d0cf5..c94169978d06 100644 --- a/Code/Mantid/docs/source/algorithms/DSFinterp-v1.rst +++ b/Code/Mantid/docs/source/algorithms/DSFinterp-v1.rst @@ -100,23 +100,25 @@ Finally, we load experimental data for these two temperatures so that we can com LoadNexus(FileName='DSFinterp/{0}.nxs'.format(workspaces[i]), OutputWorkspace=workspaces[i]) #load QENS data target_temps = [175, 225] outworkspaces = ['int175K', 'int225K'] - DSFinterp(Workspaces=workspaces, ParameterValues=temp_flt, RegressionWindow=0, TargetParameters=target_temps, OutputWorkspaces=outworkspaces) - #Now load experimental data for target temperatures - LoadNexus(FileName='DSFinterp/exp175K.nxs', OutputWorkspace='exp175K') - LoadNexus(FileName='DSFinterp/exp225K.nxs', OutputWorkspace='exp225K') - #Compare one of the predicted spectrum with a fit to experimental data - myFunc= 'name=TabulatedFunction,Workspace=int225K,WorkspaceIndex=8,Scaling=1.00424' - fitStatus, chiSq, covarianceTable, paramTable, fitWorkspace =\ - Fit(Function=myFunc, InputWorkspace='exp225K', WorkspaceIndex=8, Output='fit') - - print "The fit was: " + fitStatus - print("Fitted Height value is: %.2f" % paramTable.column(1)[0]) - print("Chi-square is: %.2f" % paramTable.column(1)[1]) + try: + import dsfinterp # Have you installed the dsfinterp module? (pip install dsfinterp) + DSFinterp(Workspaces=workspaces, ParameterValues=temp_flt, RegressionWindow=0, TargetParameters=target_temps, OutputWorkspaces=outworkspaces) + #Now load experimental data for target temperatures + LoadNexus(FileName='DSFinterp/exp175K.nxs', OutputWorkspace='exp175K') + LoadNexus(FileName='DSFinterp/exp225K.nxs', OutputWorkspace='exp225K') + #Compare one of the predicted spectrum with a fit to experimental data + myFunc= 'name=TabulatedFunction,Workspace=int225K,WorkspaceIndex=8,Scaling=1.00424' + fitStatus, chiSq, covarianceTable, paramTable, fitWorkspace =\ + Fit(Function=myFunc, InputWorkspace='exp225K', WorkspaceIndex=8, Output='fit') + #print "The fit was: " + fitStatus + #print("Fitted Height value is: %.2f" % paramTable.column(1)[0]) + #print("Chi-square is: %.2f" % paramTable.column(1)[1]) + except ImportError as exc: + #print("Error: failed to import settings module ({0})".format(exc)) + pass Output: -.. testoutput:: Ex - The fit was: success Fitted Height value is: 1.00 Chi-square is: 2.27