/******************************************************************************* * Instrument: () * * %I * Written by: * Date: * Origin: * Release: * Version: * %INSTRUMENT_SITE: * * (instrument short description) * * %D * (instrument description) * * Example: (parameters=values) * * %P * (parameter1): [(unit)] (parameter1 description) * ... * * %L * (reference/HTML link) * * %E *******************************************************************************/ /* instrument definition: name, parameters & default values */ DEFINE INSTRUMENT Test_scans(lambda=4.2, string materialfile="Cu.nxs") /* declare variables and functions in C syntax */ DECLARE %{ %} /* any C code here is executed when the simulation starts */ INITIALIZE %{ %} /* in the TRACE section, the instrument is defined as a sequence of components. */ TRACE /* Progress_bar() is an Arm() displaying simulation progress */ COMPONENT origin = Progress_bar() AT (0, 0, 0) ABSOLUTE /* -------------------------------------------------------My Source---------------------------------------*/ COMPONENT source = Source_Maxwell_3(size = 0.155, Lmin = 3.5, Lmax = 4.3, dist = 1.55, focus_xw = 0.035, focus_yh = 0.12, T1 = 45, T2 = 45, T3 = 45, I1 = 8.5e11, I2 = 1, I3 = 1) AT (0, 0, 0) RELATIVE origin //COMPONENT SlitInfrontOfsample = Slit( // xwidth = 0.005, yheight = 0.005) // AT (0, 0, 2) RELATIVE origin COMPONENT Sample_test = sample_nxs( TransOnly = 1, IncohScat = 0, MultiScat = 0, radius = 0.005,yheight = 0.01, nxsFileName = materialfile, d_phi = 110) AT (0, 0, 2.05) RELATIVE origin ROTATED (0,0,0) ABSOLUTE COMPONENT psd_detector_position= PSD_monitor( nx = 200, ny = 200, filename = "PSD_Monitor_DetectorPosition.dat", xwidth = 0.015, yheight = 0.015 ) AT (0, 0, 2.10) RELATIVE origin COMPONENT Lmon_detector_position = L_monitor( nL = 61, filename = "L_Monitor_DetectorPosition.dat", xwidth = 0.0075, yheight = 0.0075, Lmin = 3.69516, Lmax = 4.305 ,restore_neutron=1) AT (0, 0,2.101) RELATIVE origin /* any C code here is executed when the simulation ends */ FINALLY %{ %} /* The END token marks the instrument definition end */ END