condition_segs


Download program files. program.
Download sample data. data
Download sample output segments. output


This program prepares line segment data for further analysis. The program converts data to a uniform format so that it can be read accurately by the other programs.


condition_segments writes lists of grain boundary line segments in a format that is compatible with all subsequent programs in the gbXstallography repository. It has three main functions: concatenation, adjusting the number of columns, and deleting bad data

Depending on whether your next step is stereological analysis or 3D analysis, you want all the lines segments to be concatenated into a single file, or kept in 2D layer, respectively. The program can operate in the concatenate or do not concatenate mode. The mode is set by a parameter in input.txt

Depending on the source of the data, it might have 12, 14, 21, or some other number of columns. All programs in this repository expect files with a 10 or 12 column format. Each grain boundary line segment has 10 essential pieces of information:
The three Euler angles for the crystal on one side of the boundary,
the three Euler angles for the crystal on the other side of the boundary,
the x and y coordinates of the start of the segment,
and the x and y coordinates of the end of the segment.
The 10 column format is recommended.

Depending on the source of the data, it might have some Euler angles that are exactly zero and/or some line segments that have zero length. These are not meaningful data and can cause problems later in the analysis. condition_segs removes such data.


Example:
As an example to show how the program works, we will process 30 line segment files produced by extract_GB_traces.
Those files can be downloaded here
The data comes in the .zip form, so you might need to unzip it before use.
The folder should contain 30 text files named segments_Ni_0NN.txt, where NN are integers from 00 to 29.
The 30 files in this folder need to be moved to the folder condition_segs.
The next step is to configure the parameters in input.txt for the run. These parameters are described in the lower part of the input.txt file.
The version of input.txt saved on this site is configured to run the files available at the link above, so do not change anything for this example.
Next, open a terminal window in the condition_segs folder. From here, you simply compile and run the program, as follows:
(base) gr20macmin:condition_segments gr20$ make clean
rm -f main.o
(base) gr20macmin:condition_segments gr20$ make
gfortran -O3 -c -ffixed-line-length-none main.f
gfortran main.o -o condition_segs
(base) gr20macmin:condition_segments gr20$ condition_segs
==============================================
PROGRAM PREPARES GRAIN BOUNDARY SEGMENT FILES
FOR ANALYSIS BY WRITING THEM IN A 10 OR 12
COLUMN FORMAT. MULTIPLE FILES CAN BE
CONCATENATED INTO A SINGLE FILE.

rohrer@cmu.edu
version 05/07/22
==============================================
There are 4031 lines in file 0.
27 lines in the header
There are 3986 lines in file 1.
27 lines in the header
There are 4083 lines in file 2.
27 lines in the header
There are 4008 lines in file 3.
27 lines in the header
There are 3946 lines in file 4.
27 lines in the header
There are 3922 lines in file 5.
27 lines in the header
There are 3795 lines in file 6.
27 lines in the header
There are 3774 lines in file 7.
27 lines in the header
There are 3634 lines in file 8.
27 lines in the header
There are 3584 lines in file 9.
27 lines in the header
There are 3484 lines in file 10.
27 lines in the header
There are 3278 lines in file 11.
27 lines in the header
There are 3179 lines in file 12.
27 lines in the header
There are 3103 lines in file 13.
27 lines in the header
There are 3024 lines in file 14.
27 lines in the header
There are 2980 lines in file 15.
27 lines in the header
There are 2975 lines in file 16.
27 lines in the header
There are 2964 lines in file 17.
27 lines in the header
There are 2981 lines in file 18.
27 lines in the header
There are 2893 lines in file 19.
27 lines in the header
There are 2969 lines in file 20.
27 lines in the header
There are 2897 lines in file 21.
27 lines in the header
There are 2860 lines in file 22.
27 lines in the header
There are 2822 lines in file 23.
27 lines in the header
There are 2847 lines in file 24.
27 lines in the header
There are 2806 lines in file 25.
27 lines in the header
There are 2828 lines in file 26.
27 lines in the header
There are 2866 lines in file 27.
27 lines in the header
There are 3014 lines in file 28.
27 lines in the header
There are 2948 lines in file 29.
27 lines in the header
(base) gr20macmin:condition_segments gr20$


The main output from the program is a single file containing all of the data from the original 30 files. It is named all_segments_Ni.txt. This file is saved here, if you want to check that you get the same thing. This program can then be used to calculate discrete distributions using calc_discrete_dist.



Return To Main Page