Exercise: Insert a sample with two powder lines

  1. Next, let us insert something more interesting. Remove the V_sample and PSD_monitor_4PI and insert a PowderN component with the following parameters:
    COMPONENT sample = PowderN(radius=0.01,h=0.01, d_phi0=0.1, pack=0.5, 
       DW=0.9, frac=0.5, reflections="mylist.dat",
       Vc=3.86*3.86*11.82, sigma_abs=0, sigma_inc=2, barns=1)
      AT (0, 0, 0) RELATIVE \<name of arm at the sample position\>
    
    You should also create a list of reflections and save it as mylist.dat. The list should have the following contents:
    # column_j 3 multiplicity 'j'
    # column_q 1  Scattering vector modulus [Angs^-1]
    # column_F2 2 Scattering factor |F^2| in [barns]
    1 10 8
    1.3 10 4
    
  2. Insert a banana shaped detector:
    COMPONENT BananaDetector = Monitor_nD(
       xwidth=2, yheight = 0.09, 
       options="banana, theta limits [-55 -35] bins=360, file =detector.dat")
      AT (0,0,0) RELATIVE sample
    
    and make sure that the previously inserted beamstop is after the banana detector in the component list. Test that neutrons reach the detector by running a simulation.

    Afterwards, choose trace instead of simulate in the Run simulation window and see the instrument, you have created. To see only the trace of the neutrons, which hit the detector, select the detector component in the list given in the Inspect component box. Also, insert the following after the sample component:

    EXTEND %{ 
    if (!SCATTERED) ABSORB;
    %}
    
    This will insert a command in c-language into the compiled instrument file. The command says that if the simulated neutron does not scatter at the sample, it is absorbed. This removes the direct beam and should be used with caution.
Erik Bergbäck Knudsen 2011-06-16