DEFINE INSTRUMENT tof_imaging( lambda1=3.7, lambda2=4.4, sample_detector_distance=0.05, moderator_pinhole_distance=30.0, pinhole_sample_distance=0.25, sample_x = 0.0, thickness = 0.010, string sample_file="Fe.nxs", string moderator_face="water" ) DECLARE %{ %} INITIALIZE %{ %} TRACE /* COMPONENT progress = Progress_bar( percent=1, flag_save=0 ) AT (0,0,0) ABSOLUTE */ COMPONENT a1 = Arm() AT (0,0,0) ABSOLUTE COMPONENT moderator = ISIS_moderator( Face = moderator_face, Emin = -lambda1, Emax = -lambda2, dist = 4.0, xwidth = 0.02, yheight = 0.02, focus_xw = 0.02, focus_yh = 0.02, CAngle = 0.0, SAC = 1 ) AT (0.0, 0.0, 0.0) RELATIVE a1 COMPONENT pinhole = Slit( xwidth = 0.02, yheight = 0.02 ) AT (0.0, 0.0, moderator_pinhole_distance) RELATIVE moderator COMPONENT sample1 = sample_nxs( xwidth = 0.015, yheight = 0.015, zthick = thickness, //radius = 0.005, nxsFileName = sample_file, //strainFileName = "diffractionData_VAMAS_theory.dat", geometry = "bunny.off", max_hkl=3, TransOnly = 1, IncohScat = 1, MultiScat = 0 //d_phi = 110.0 ) AT (sample_x, 0.0, pinhole_sample_distance) RELATIVE pinhole ROTATED (0,0,0) ABSOLUTE COMPONENT sample2 = sample_nxs( xwidth = 0.005, yheight = 0.01, zthick = 0.05, nxsFileName = "Al.nxs", max_hkl=3, TransOnly = 1, IncohScat = 1, MultiScat = 0 //d_phi = 110.0 ) AT (sample_x+0.005, 0, pinhole_sample_distance+0.1) RELATIVE pinhole ROTATED (0,0,0) ABSOLUTE COMPONENT sample = Arm() AT (0,0,0) RELATIVE sample1 ROTATED (0,0,0) RELATIVE sample1 //COMPONENT psdemon = PSD_E_monitor( // xmin=-0.015, xmax=0.015, ymin=-0.015, ymax=0.015, // nx=200, ny=200, nE=10, Emin=1, Emax=6, filename="psd_e_mon.psd" //) AT (-sample_x, 0, sample_detector_distance) RELATIVE sample COMPONENT psdmon = PSD_monitor( xmin=-0.015, xmax=0.015, ymin=-0.015, ymax=0.015, nx=200, ny=200, filename="output.psd" ) AT (-sample_x, 0, sample_detector_distance) RELATIVE sample COMPONENT tofmon = TOF_monitor( nt = 1000, filename = "tofmon.dat", xwidth = 0.02, yheight = 0.02, tmin = 15000, tmax = 45000, restore_neutron = 1 ) AT (-sample_x, 0, sample_detector_distance) RELATIVE sample COMPONENT lmon = L_monitor( nL = 1000, filename = "lmon.dat", xwidth = 0.02, yheight = 0.02, Lmin = lambda1, Lmax = lambda2, restore_neutron = 0 ) AT (-sample_x, 0, sample_detector_distance) RELATIVE sample FINALLY %{ %} END