MTEST Practical User Manual

Dear User,

Hi! Welcome to the MTEST diffractometer!

You applied successfully for beamtime at the MTEST diffractometer. Congratulations! We are trying to keep your euphoria over your visit!

How to operate the instrument?

Basically, after you filled the sample cans and closed them, it should be mounted on the sample position. The first section explains the details for the room temperature rotating sample changer. If you use the furnace, I recommend to skip this part, because it will be mounted by your host. The second section deals with writing measurement control files and in the third the details of run and checks are introduced.

Mounting samples on the room temperature sample changer

  1. Please, open a terminal window on the computer, and check the current position of the detector by:

    ./mtest 2Theta
    
  2. If it was not at 57.5 degrees, let’s move to it! The following command moves the detector to higher angle position, allowing to access the rotation stage easy and carrying the positioning microscopes roughly parallel and perpendicular to the monochromatic beam:

    ./mtest 2Theta 57.5
    
  3. Your host will close the beam and remove the already measured samples.

  4. Mount the sample holders by the mounting screews and go to the next place via manual control! To do this, grab the manual control box and you will handle it with the uppermost switches:

    • pushing only the left switch: slow motion
    • pushing both switches: fast motion
  5. After you mounted all of your samples, you should align them. Your operator connects the cameras of the microscopes via USB on a portable computer. Use the manual control switches to be in the center on the image of the perpendicular camera. After that, check it by the parallel camera. If it was not in the center, adjust the lower part of the sample can to get there by gently pushing it by a screewdriver. Repeat this procedure for all of the mounted samples.

  6. Now, all of the samples are aligned. We should figure out, at what value of the Phi axis will be the samples centered. To do so, we are using only the perpendicular camera (so, take the screwdriver back to the box!). Please choose the first sample, direction of rotation and move to the opposite direction at least 40 degrees by command in computer terminal:

    ./mtest Phi position
    

    Then carefully find the right position. If you found it, write it down and go to the next sample, which is placed about 18 degrees from the present and repeat the procedure!

    Important

    Always keep the same direction, otherwise the positions will not be reproducible. Choose slightly less difference in angles, before attempting larger change!

  7. Unplug cameras from computer and prepare for the measurement!

Writing measurement control files

The perform experiment, we use the following command syntax:

./mtest FILENAME 2Theta RUN_NUMBERS START_RUN_NO 23. 24.5 57.5 33. MEASUREMENT_TIME COMMENT

In words, let’s run RUN_NUMBERS times from START_RUN_NO the following procedure: move the detector to 23 degrees, then start the measurement at 24.5 degrees, then at 57.5 (=24.5+33) degrees for MEASUREMENT_TIME seconds for each and save to FILENAME with your COMMENT.

Note

In the COMMENT spaces should be avoided. Please use underscore “_” instead of it!

This would be done easy, but in reality we are using bash scripts. The script should look like the following:

#!/bin/bash
CAMNO=0
./mtest Phi 0

In the first line the interpreter is set. In the second, the camera number should be specified if it was connected to the computer by USB (if not, just comment out this line by placing a “#” before it). In the third line, the initial position on Phi axis (sample changer) should be specified (here it was 0).

Then, the following code block should be repeated for each samples:

LIBTOSAVE=cycle_2019_12_1/2019_12_02_something
PRODUCEDFILENAME=something
COMMENT=something_8mm_in_highvacuum_175C
./mtest Phi 73.65
switch_camera_light.sh on ${CAMNO}; take_snapshot ${CAMNO} snap_${PRODUCEDFILENAME}.png; switch_camera_light.sh off ${CAMNO}
./mtest ${PRODUCEDFILENAME} 2Theta 9 1 23 24.5 57.5 33. 3600 ${COMMENT}
mkdir $LIBTOSAVE
mv ${PRODUCEDFILENAME}_* $LIBTOSAVE
mv snap_${PRODUCEDFILENAME}.png $LIBTOSAVE
echo "Measurement of ${PRODUCEDFILENAME} has been finishing" | mail -s "MTEST measurement message" "your_host@e-mail.hu"

The first 3 lines are self-comprehensives. In line 4, the sample changer moves the next sample into the center position. In line 5, we took picture on the sample for checking its correct centering. Then, in the following line, we do the measurement, taking roughly 18 hours along (9 run x 2 position x 3600s). When it will be finished, the library is created, which is filled with data and the picture is archived. Finally, an e-mail will be sent to your host about the measurement has been finishing.

Finally, let’s save it as something.sh!

Note

  • due to latency of the camera, it might be advisible to not connect it to the computer. This case clear or comment out the relevant lines.

  • if you use furnace:

    • your host disables the moving of the Phi motor: clear or comment out the relevant lines.

    • you can control the furnace from command line of from the script by

      ./program_furnace requested_regulator_temperature_in_C rate_in_C/hour
      

      or

      ./program_furnace stop
      
  • you are free to edit the file during the run, but only that part, which have not been executed yet!

  • after you created the something.sh file, you can check its time requirement by typing:

    ./checktime.sh comething.sh hour min
    

Starting the measurement and checking the run

You can start the measurement by typing the following command:

nice -0 bash something.sh &>> z.log &

This command runs your script by the highest priority in the background and all outputs and error messages writes (by appending to its content) to the z.log file.

Note

After you started the program, always exit from the terminal window by typing exit ! It prevents accidental end of running, if you closes the terminal window.

You can any time stop the measurement by typing the following command in terminal:

touch stop

It will took effect within 1 second if a motor is currently move or less than 30 minutes (or end of the measurement) if acquisition already started.

Warning

If you stop a running script, the script execution thread continues the execution from the next line in the script. To prevent it, please comment out the remaining measurement lines, or give the series of touch stop until the script execution finishes.

You can check the flow of the execution either by looking at the end of the z.log file or simply observing, which files have been created. The produced datafile names follow the convention of PRODUCEDFILENAME_RunNo_PositionNo_SnapShotNo.dat and the symbolic link of PRODUCEDFILENAME_RunNo_PositionNo always points to the last saved entry (see the next part for its detailed description). According to default values, each 30 minutes a snapshot is saved or the measurement finishes – whichever happens earlier, but the first snapshot is created at the start of data acquisition.

You can plot the content of snapshot files the following way:

  1. In terminal window type xmgrace
  2. After the plotting program loaded, in Data/Import/Ascii change the filter to *_? and push Filter button at the bottom.
  3. You can see filtered entries in the Files part of this window. Click on that, which you are interested in and change Load as to NXY and click to OK. This will plot all of the detector signals.

If you wish to compare the evolution of detector signals (sum of all counts) normalized by monitor counter for each elapsed run, use the following command:

./mtest_check_signal.sh something 2 7

This will plot the 7th detector signal evolution for something_*_2 files.

How should I obtain the datasets and get into standard format?

In this part, file format of the measurement datafile and data evaluation steps are discussed.

Measurement fileformat

We are introducing the data format through an example:

# MTEST RAW datafile version 1 BULK
# Sample: something_8mm_in_highvacuum_175C

The first line contains header information, while the second one contains your COMMENT. Here and below all non-numerical entries start with # line, because they evaluated as comment by some plotting programs.

# Setup information (M-monochromator, S-sample, D-detector):
#       MS collimator: no collimator - before monitor slits: 10wx40h mm (changed: 19.02.2019 11:50), upstream-closer2monitor: 15.6wx47h mm, upstream-closer2mono: 22wx47h mm
#       MS slits: r6.5/h4.0/u23/d18 (set: 04-02-2020 17:04;telescopic distance: 79 mm; vertical: visual check at 11:20 25-10-2019: u3.0/d-2./r1.5/h-1.0; horizontal: beam at 04-11-2019 13:20 center r1.5/h-1.0)
#       S environment: furnace(z=+3mm set at 2020.03.16)+ shield (130mm and 96 mm from the top -- 2020.06.10. readjusted, after disassembling and cleaning both parts)
#       S holder: vananadium can 8mm
#       SD slits: regular MTEST ver 3.1 (common woodden block front 140 mm from sample) adjusted at 09-09-2019 (slightly adjusted lower bank low angle side at 04-11-2019)+ hi and low Cd wings (adjusted 16-03-2020)
#       D position: regular_position+Ordela LLD 1.0->0.56 (2020.02.05 12:25)

These lines contain various information about the setup to be reproducible as possible. MS means neutron path between monochromator and sample, SD means neutron path between sample and detector. Your host sets them – to find out, what they are, please look at the instrument description or ask your host!

# Number of stationary motors: 9
#       name position_in_pulses position_in_angles
#       MTilt 2637
#       MShift 4000
#       MRotate 32769 20.4222
#       DArmRotate 3101 39.73
#       Phi 35272 25.04
#       Chi 32770 0.02
#       Omega -1 4.29493e+07
#       X_NA 32768 0
#       Y_NA 32768 0

Motor positions, which are actially not scanned. For each entry, it contains the name, position in pulses and for some of them the position in angles, if it was meaningful. The first 4 make the monochromator and diffractometer arm move, while the following 3 make axes of Eulerian craddles move. The last 2 are refer to an obsolate setup.

# Number of scanning motors: 1
#       name position_in_pulse position_in_degrees
#       2Theta 35218 24.5

These lines refer to the motors, whoose position is changed. Similar to the stationary motors, it contain their actual positions.

# Measurement started(LOCAL): 2020-06-10 20:25:51 snapshot taken(LOCAL): 2020-06-10 20:55:53

Information about measurement times.

# Number of counters: 20
#        counter_name number_of_channels number_of_additionals [channel_couts] [additional_counts] [captions]
#        Monitor 2 0 9440481 1800 Counts Time-sec
#        ORDELA 1024 2 * 1801.96 1790.5 RealTime-s LiveTime-s
#        High_near_down_81_position 1024 4 * 37 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_near_cent_79_position 1024 4 * 43 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_near_up_82_position 1024 4 * 52 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_far_downcent_83_position 1024 4 * 43 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_far_centup_88_position 1024 4 * 37 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Low_down_85_position 1024 4 * 51 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Low_cent_86_position 1024 4 * 42 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Low_up_87_position 1024 4 * 38 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Small_tube_position 1024 4 * 40 55 280 790 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_near_down_81_amplitude 1024 4 * 37 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_near_cent_79_amplitude 1024 4 * 43 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_near_up_82_amplitude 1024 4 * 52 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_far_downcent_83_amplitude 1024 4 * 43 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        High_far_centup_88_amplitude 1024 4 * 37 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Low_down_85_amplitude 1024 4 * 51 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Low_cent_86_amplitude 1024 4 * 42 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Low_up_87_amplitude 1024 4 * 38 55 280 800 Tube_gain Module_LLD Software_LLD Software_HLD
#        Small_tube_amplitude 1024 4 * 40 55 280 790 Tube_gain Module_LLD Software_LLD Software_HLD

These entries contain the parameters of the counters. In the mess of data, we can distinguish 3 kind of counters. The Monitor is the monitor counter and it registers two quantities: the counts (here 9440481) and the elapsed time (1800s). The next one is the ORDELA detector (central detector bank), whose entries appear in the second column (see below – but there are real and live times entries in the line). The third kind of counters are the PSD tubes: they have both position and amplitude channels. Their name convention is DetectorBank_PositionToTheSample_VerticalPosition_DetectorNo_AmplitudeOrPosition, which is followed by some additional values, like applied gain of the tube, low level discriminator of the module, software low and high level of discriminators.

Finally, the counts are listed for each channel the ORDELA, positions of the 9 PSD detectors and after that their amplitudes:

# caption_of_maximum [counts]
1 0 0 0 0 0 0 0 0 0 0 3 5 6 1 1 3 4 4 1
...

Evaluating the measured datasets

I recommend to do this in a separate directory:

  1. Collect the datasets to be evaluated, at least the symbolic link files.

  2. Check sample stability by the mtest_check_signal program introduced previously.

  3. Correct the detector signals for deadtime, detector efficiency and normalize by the monitor counter. Also, create averaged data from the so calculated ones in one step.

    python mtest_summarize.py something calibration_file.name normalization_file_path_name something_?_?
    

    This took calibration file and normalization data files and process something_?_? datasets. If you run more than 9 times, do not forget to add something_??_? to the end!

    By running this program, something_POSITION&DETECTORNUMBER_ndt.dat files are created. The columns contain the following information:

    1. Q [Å-1]
    2. normalized intensity
    3. uncertainty
    4. 2\(\Theta\) [degrees]
    5. detector channel
    6. calibrated channel indicator [0/1]
    7. individual normalized datasets together with its uncertainty
  4. Absorption correction and correcting by empty can:

    You should create a file need to perform corrections: corr_something.txt

    10 2
    

    Number of detectors and measurement positions

    something ../empty/empty
    

    Filenames for measurement, empty container and optionally cadmium rod

    N 1.44A
    

    Neutron with 1.44A wavelength

    4.0 1.0 2 2.46G
    

    4 mm of sample radius, filled full, it consist of 2 elements, density is 2.46\(\frac{g}{cm^3}\)

    Si 1.
    O  2.
    

    Symbol of element/isotope, then its contribution. Here SiO2 is supposed

    .1524 1.0 1 0.0719N
    V 1
    

    Repeat the same for the container: 0.1524 mm wall thickness, filled full, single element (vanadium), 0.0719\(\frac{1}{Å^3}\) number density

    To run the program, please type:

    python absorption_correction.py corr_something.txt
    

    This will produce something_POSITION&DETECTORNUMBER_corr.dat files. It has the following format:

    1. Q[Å-1]
    2. Corrected_data
    3. Uncertainty
    4. Scattering cross-sections in barns: coherent, incoherent and inelastic (not implemented)
    5. 2\(\Theta\) [degrees]
    6. Polarization (always 1)
    7. Transmission coefficients for standalone sample; for sample together with can; for the standalone can and the can together with the sample
    8. Normalized intensity for sample and container
  5. Unifying different detector banks data and creating final result:

    Let’s first plot all of the datasets by the following command:

    bash plot_data.sh something corr
    

    If you were content with the result, you can summarize Q-space data with 0.02 Å-1 resolution by:

    python merge_datasets.py 1 2 3 0.02 0.5 something_q_02.dat something_*_corr.dat
    

    The first three numbers are the x, y, dy column numbers in something_*_corr.dat. Concerning the others, you can find detailed documentation, if you type just python merge_datasets.py. The output contains the merged x, y and dy columns.

    Usually, this dataset might need to be rescaled and slightly refined further by MCGR program for liquid, amorphous materials. Please, refer to the program manual to do this.

    For crystalline investigations, the 2\(\Theta\) scaling is more abound:

    python merge_datasets.py 7 2 3 0.05 0.5 something_angular.dat something_*_corr.dat
    

    However, it is normalized by the vanadium, which might not be suitable for your Rietveld refinement program. To be in line with the common criterion, intensity should be rescaled using the equation valid for the Poisson statistics as \(\sigma(N) = \sqrt{N}\). The following program finds the maximal intensity point and calculates the multiplication factor, based on the intensity and its uncertainty:

    bash convert2rietveld.sh something_angular.dat
    

    This will create a something_rietveld.dat file.

From the source to the detector at the MTEST diffractometer

Note

This is a short introduction. If you do not understand it or if you interesting to the details, do not hesitate to ask your host!

The MTEST diffractometer is installed on the 6th thermal horizontal beamport of the reactor pointing towards its core. To be kept neutron production self-sustainable, slowing down of neutrons by repetative collisions on the nucleus of the moderator materials are essential. Due to this process, thermal neutrons start to behave like ideal room temperature gas, whose speed distribution follows a continous Maxwellian speed distribution. The speeds are non-relativistic, so kinetic energy and the corresponding wavelength (through de Broglie-equation) can be obtained.

As this distribution spreads broadly in speed, we will select single wavelength for our studies. We are using the Bragg-scattering fenomenon on monochromator crystals. However, not only the requested wavelength can be obtained but its \(1/n\), where \(n=2, 3, ...\) To supress the “overtones”, oriented sapphire single crystal act as high-pass (in wavelength) filter, filtering out short wavelength (and also fast) neutrons. The instrument currently uses copper (fcc structure) monochromators with (111) and (220) orientations and germanium (111) crystals. The last has the advantage of overtones starts from \(1/3\), because it posses diamond crystal structure, which ceases all even reflections, whose sum is not integer multiple of 4. If you look at the blue-colored monochromator house, it absorbs neutrons, but most importantly the \(\gamma\) radiation, which comes directly from the core of the reactor.

The monochromatized neutron optionally pass through collimators (devices eating neutrons too spreading) and the thin-layer enriched uranium coated monitor counter. The detection phenomenon is like in the reactor: fission happens and electric signal of highly charged fission products are detected. Before the sample area, slits are placed in order to reduce the beam to your sample.

Your samples are generally placed in vanadium cans: we favour vanadium as it simply produce only very tiny Bragg-peaks (its coherent scattering length is close to zero). If the neutrons might not scattered on your sample, the paraffin blocks at downstream absorb or distribute them.

If the neutrons are scattered on your sample, they might reach one of the 10 detectors placed in the end of fan-shaped wooden shielding. All of the detectors are filled with 3He, which absorbs neutrons and produces isotopes of hydrogen: a proton and a tritium (contains a proton and two neutrons). Both of them are charged particles, which are detected in the position sensitive tubes.