User Tools

Site Tools


processing:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
processing:start [2019/06/07 15:11]
matthias
processing:start [2019/06/07 16:00] (current)
matthias [Workflow: Getting a list of grains and their orientations]
Line 5: Line 5:
 {{ ::​processing:​workflow.jpg?​nolink&​600 |}} {{ ::​processing:​workflow.jpg?​nolink&​600 |}}
  
-===== Workflow for getting grains and their orientations (outline) ​=====+===== Data collection ​=====
  
-The goal of this workflow ​is to get a list of grains and their specific orientations. If you want to check your workflow you can start with a simulation (see [[workflow_training|here]]. This outline is for dealing with real diffraction data consisting of a series of 2D diffraction images which was acquired during a 3D scan. More info on the experimental setup can be found [[dac_experiments:​geometry|here]]. +Usually, the data is collected in synchrotron facilities by stepwise rotating ​the sample while the detector is acquiring diffraction imagesFor more information, click [[dac_experiments:geometry|here]].
-  - Perform a calibration to obtain ​the exact sample-detector ​distance and the exact beam center. This calibration ​is crucial since all further processing depends on itYou can use Dioptas or fit2D and Maudfor example. +
-  - If necessary, convert your series of images to //EDF// format (click [[xray_data:convertfileseries|here]] for further information on that). +
-  - Have a closer look at your images (with [[software:​fabian|Fabian]] or Dioptas, for example). Throw out all bad images and replace them with empty or average images. +
-  - Create median and average images. +
-  - Refine the average image with any refinement software (for example, [[software:​maud|Maud]]) to obtain the exact cell parameters of your sample material. +
-  - Remove diamond spots (and shadow). +
-  - Perform a [[software:​peaksearch|PeakSearch]]. +
-  - In [[software:​imaged11|ImageD11]] the found peaks are fitted to the parameters of the sample and experiment, followed by the calculation of the g-vectors. +
-  - With the calculated g-vectors the grains will now be indexed, using [[software:​grainspotter|GrainSpotter]].+
  
-===== Workflow ​for getting grains and their orientations (full) ​=====+===== Workflow: Training with simulated data =====
  
-<WRAP center round tip 60%> +Starting ​with real data might be complicated if you are a beginner in MGC. Training ​the actual ​workflow with simulated data can help you to verify if your workflow is correctIt also makes you familiar ​with the software. ​Pitfalls are better visible ​with artificial data.
-The following chapter deals with the actual ​use of all the software mentioned aboveWe describe a path where you can see what you can do with the software ​when it's workingIf you need help with installing or running the software you should check out the wiki pages of the individual software. +
-</​WRAP>​+
  
-==== Calibration ​of the standard ==== +But even when you are working with real data, you can compare your results with the outcome ​of the simulation to prove if they are reasonable
-...+
  
-==== Conversion of the file series to EDF ==== +[[processing:workflow_training|Click here to train your workflow ​with a simulated dataset.]]
-Most of the used [[software:start|software]] can work only with [[fileformat:​edf|EDF]] imagesUnfortunately,​ most of the beamlines don't provide their data in this format but in MarCCD (//.mccd//) or Tiff (//.tif//). To convert them, you can use one of the TIMEleSS tools: [[convertfileseries|//​timelessTiff2EDF//​ or //​timelessMarCCD2EDF//​]].+
  
-==== Remove bad images ​==== +===== Workflow: Find out the phases in your sample and their cell parameters ===== 
-The removal and exchange of bad images ​is not a process which is done once and then finishedDuring the processing ​it may happen several times that you have to throw out an image which you considered all right in previous ​step.\\ +This step is actually ​not part of the MGC but normal Rietveld refinementHowever, ​it is necessary ​step for further processing workflows.
-**What is a bad image and why do they have to be removed?​**\\ +
-A bad image is one where you have artefacts which cannot be removed by any software. Frequent examples are : +
  
-{{ :​processing:​diamonddoublediffraction_anotee.png?​nolink&​400 |}} +===== WorkflowGetting ​list of grains ​and their orientations ​===== 
- +This workflow will provide ​you with list of grains, as well as an orientation ​of each single grain in your sample. [[processing:workflow_dac_data|Click here when you feel ready to rock]]
-While the simulation is running you can already look at the images, which are already created. For this, open a new tab in the Konsole and open Fabian: +
-  fabian.py +
- +
-This is convenient because you can already see at this point if your simulation works. And in case it does not, you can stop the simulation process right now and you don't need to wait until all images are created, which can take very long time. While you're at it, check also the O-matrix. You find it in Fabian under //Image// --> //​Orientation//​. Choose the one which is the same as in your input file. +
- +
-==== Working on background ​==== +
-To get rid of the background we now add up all the diffraction images and calculate an average and a median image. Then, every image is subtracted by this average/​median image which should remove the background. Of course, if you switched off the background in the previous simulation this process won't change anything. But in case you have real data, this procedure is essential! +
- +
-For calculating the average and median you use [[software:imagemath|Image Math]]. Type to the Konsole: +
-  image_math_petra 'name stem of the .edf file' 'first image number'​ 'last image number'​ median +
-  or +
-  ./​image_math_petra.bin 'name stem of the .edf files including their directory path' 'first image number'​ 'last image number'​ median +
- +
-For more information on which syntax you should use, check the [[software:​imagemath|Image Math wiki page]]. The calculation will create three additional //.edf// files which are automatically stored in the same folder. They share the same name with the other //.edf// files except for an additional letter **m** (for median) in the middle of the name. So look carefully not to oversee them. The images are numbered from 1 to 3. Since they are also //.edf// images, you can also have look at them with Fabian if you like.  +
-  * Image //m1// is the **average** image +
-  * Image //m2// is the **median** image +
-  * Image //m3// is the **??** image +
- +
-Next, the actual images have to be subtracted by one of these three images. Usually the m2 image (median) is used for this, because it is less affected by outliers. Before you do this, make sure you have a separate folder to avoid mixing up the actual data with the processed data! Raw data should never be modified! +
- +
-Look at the images in Fabian, go to //Image// --> //​Correction//​ --> //Subtract background// ​and choose the m2 image. Now every image which is currently loaded (including those which you can access by clicking on //next// and //​previous//​) gets subtracted by this m2 image (median). If it is not simulated data without noise etc. you should see a difference. The peaks should appear clearer. +
- +
-==== Peak extraction ​==== +
- +
-From these processed images ​you can now extract the peaks. Look at some random peaks from several images by zooming in (in Fabian) and check out their intensity. Try to estimate ​threshold value which defines how intense a peak must be to be seen by the algorithm. Try to define a threshold, which separates peaks from background (everything above the threshold value is a peak, everything below is background). If you are not sure you can also define several threshold values. +
- +
-When you defined one (or more) threshold(s) you can start the [[software:​peaksearch|PeakSearch]] algorithm:​ +
-  peaksearch.py -n ../'​directory'/'​name stem' -f 'first image number'​ -l 'last image number'​ -d ../'​directory'/'​median.edf file' -t '​threshold value 1' -t '​threshold value 2' ... +
- +
-To check the outcome ​of PeakSearchyou can load the peaks, which were found, into Fabian and see if they match the actual peak positions. To do this, you have to go click on //​CrystTools//​ --> //Peaks// --> //Read peaks// and choose the //.flt// file which PeakSearch just created. They should appear ​as red circles on the diffraction image. You can switch on/off the diffraction spots by clicking on //​CrystTools//​ --> //Peaks// --> //Show//. +
- +
-==== Experimental parameters ==== +
- +
-From these peaks you can now fit the experimental parameters. To do this, open [[software:​imaged11|ImageD11]] by typing the following to the Konsole: +
-  ImageD11_gui.py +
-To load the PeakSearch file click on //​Transformation//​ --> //Load filtered peaks// and choose the //.flt// file from the separate folder with the processed data. Although the image is loaded, it is not plotted automatically,​ because there are two different ways of plotting. One plotting option is the 2D diffraction image which is similar to Fabian (y/z plot). The other possibility is a cake plot (tth/eta plot). Both options can be accessed by clicking on //​Transformation//​. Note that plotting both options at once is not making sense because the software is using the same scale for both images (which makes it look weird). To switch from one plot to the other just click on the //Clear// button (bottom of the window) and then plot the other one. //Clear// does only erase the plot, the data is still there. +
- +
-Before you check the plots you should enter the measurement parameters. Go to //​Transformation//​ --> //Edit parameters//​ and enter all parameters for your sample. ​Some of them can be found in the calbration files of the beamline (such as the [[fileformat:poni|poni file]]). Remove all check marks from the vary boxes and press //Ok//.  +
- +
-Next you can have a look at the //tth/eta plot//. Most of the peaks should appear to be on imaginary vertical lines. Zoom in and check, if these lines are completely vertical. If not, you might have strain in your sample. If the line looks like a sinus curve of exactly one period this is due to a wrong beam center. To fix this, go back to //Edit parameters//​ and activate the check marks for the //​y-position//​ and //​z-position//​ of the detector. Press //Ok// and click on //Fit// for several times until the spots don't move anymore. The imaginary lines should now be completely straight (if you don't have strain). If they are not, you can try to fit other parameters. +
- +
-At some point you can click on //​Transformation//​ --> //Add unit cell peaks//. Red tick marks will appear which indicate the expected positions of the vertical lines. With this you can check whether your input parameters (cell parameters, detector distance, ...) were correct.+
  
 +===== ... =====
 +More to come ...
processing/start.1559920288.txt.gz · Last modified: 2019/06/07 15:11 by matthias