/******************************************************************************* * * McStas, neutron ray-tracing package * Copyright (C) 1997-2008, All rights reserved * Risoe National Laboratory, Roskilde, Denmark * Institut Laue Langevin, Grenoble, France * * Instrument: templateSANS * * %Identification * Written by: Kim Lefmann * Date: 19th Dec 2003. * Origin: Risoe * Release: McStas CVS_080624 * Version: $Revision: 1.6 $ * %INSTRUMENT_SITE: Templates * * Test instrument for the Sans_spheres component. No guide / velocity selector * etc. Will be developed further at later time. * * %Description * Very simple test instrument for the Sans_spheres componen * * Modified to show a proof of concept method for storing a 'Mantid friendly' type of NeXus file. * * Needed steps: * 1) Compile your instrument with NeXus library support * 2) Generate an IDF using mcdisplay templateSANS_Mantid --format=Mantid -n0 * 3) mcrun templateSANS_Mantid -n1e6 --format=NeXus * * %Example: lambda=6 Detector: detector_I=6.55e-17 * * %Parameters * INPUT PARAMETERS: * lambda: Mean wavelength of neutrons [AA] * dlambda: Wavelength spread of neutrons [AA] * r: Radius of scattering hard spheres [AA] * PHI: Particle volume fraction [1] * Delta_Rho: Excess scattering length density (fm/AA^3) * sigma_abs: Absorption cross section at 2200 m/s [barns] * Qmax: Maximum momentum transfer [AA^-1] * * %Link * * * %End *******************************************************************************/ DEFINE INSTRUMENT templateSANS_Mantid(lambda=6, dlambda=0.05, r=100, PHI=1e-3, Delta_Rho=0.6, sigma_abs=0.5) DECLARE %{ %} INITIALIZE %{ %} TRACE COMPONENT a1 = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT arm = Arm() AT (0, 0, 0) ABSOLUTE COMPONENT sourceMantid = Source_simple( radius = 0.02, dist = 3, focus_xw = 0.01, focus_yh = 0.01, lambda0 = lambda, dlambda = dlambda, flux = 1e8) AT (0, 0, 0) RELATIVE arm COMPONENT coll1 = Slit( radius = 0.005) AT (0, 0, 3) RELATIVE arm COMPONENT coll2 = Slit( radius = 0.005) AT (0, 0, 6) RELATIVE arm SPLIT COMPONENT sampleMantid = Sans_spheres( R=r, Phi=PHI, Delta_rho=Delta_Rho, sigma_abs=sigma_abs, xwidth=0.01, yheight=0.01, zdepth=0.005) AT (0,0,0.2) RELATIVE coll2 COMPONENT STOP = Beamstop( radius = 0.02) AT (0, 0, 2.9) RELATIVE sampleMantid COMPONENT detector = PSD_monitor( nx = 128, ny = 128, filename = "PSD.dat", xmin = -0.3, xmax = 0.3, ymin = -0.3, ymax = 0.3) AT (0, 0, 3) RELATIVE sampleMantid COMPONENT Ldetector = L_monitor( nL = 1000, filename = "Edet.dat", xmin = -0.3, xmax = 0.3, ymin = -0.3, ymax = 0.3, Lmin = 5.5, Lmax = 6.5) AT (0, 0, 3.01) RELATIVE sampleMantid COMPONENT PSDrad = PSD_monitor_rad( filename = "psd2.dat", filename_av = "psd2_av.dat", rmax = 0.3) AT (0, 0, 3.02) RELATIVE sampleMantid COMPONENT nD_Mantid_1 = Monitor_nD( options ="mantid square x limits=[-0.2 0.2] bins=128 y limits=[-0.2 0.2] bins=128, neutron pixel t, list all neutrons", xmin = -0.2, xmax = 0.2, ymin = -0.2, ymax = 0.2, restore_neutron = 1, filename = "bank01_events.dat") AT (0.15, 0, 3.2) RELATIVE sampleMantid COMPONENT nD_Mantid_2 = Monitor_nD( options ="mantid square x limits=[-0.2 0.2] bins=128 y limits=[-0.2 0.2] bins=128, neutron pixel min=1e6 t , list all neutrons", xmin = -0.2, xmax = 0.2, ymin = -0.2, ymax = 0.2, restore_neutron = 1, filename = "bank02_events.dat") AT (-0.15, 0, 3.5) RELATIVE sampleMantid END