10/16/13: Stereology Programs The latest version of the limited domain stereology is in 130904_programs.zip Main additions are enhancement of the disor program for computing the disorientation distribution from line segments and the ax_ang_graph that plots the distribution of boundaries in axis angle space. This new version is compatible with the limited domain stereology. 7/28/13: Stereology Programs The latest version of the code is in: 130728_full_domain_stereology.zip This set of codes uses the full domain of misorientations. They are suitable for use with orthorhombic, trigonal, tetragonal, hexagonal, and cubic symmetries. disor: This uses the list of reconstructed grain boundary line segments and calculates a one-dimensional distribution of grain boundaries as a function of disorientation (minimum misorientation) angle. calc_gbcd_stereo_fd: This uses the list of reconstructed grain boundary line segments and calculates the grain boundary character distribution. This a five dimensional array over five grain boundary parameters. It uses the full domain of grain boundary parameters: 0 to 2pi (first Euler angle), 0 to pi (second Euler angle), 0 to 2pi (third Euler angle), 0 to pi/2 (azimuthal angle), and 0 to 2pi (equatorial angle). The output from this is used for the graphing programs: ax_ang_graph_fd: graphs the distribution of boundaries in axis angle space. This ignores the grain boundary plane orientation gbpd_graph_fd: graphs the distribution of grain boundary planes in crystal space. This ignores the misorientation. gbcd_graph_fd: graphs the distribution of grain boundary planes at fixed misorientations 6/1/10: Stereology Programs 100601_stereo.zip contains the latest versions of the stereology program, with many refinements. 1/26/09: Stereology Programs All programs in 090126_version_folder.zip are compiled using gfortran running on MAC OSX (10.5.6) with 2 2.8 GHz Quad Core Intel Xeon processors. The programs should run on any MAC with and Intel processor. All programs are initiated from the terminal window by entering the name of the executable file. The programs can be recompiled easily on other machines using GCC 4.4 see (http://hpc.sourceforge.net/) All programs in 090126_vers-pccomp.zipare similarly compiled for use in a windows environment. PRELIMINARIES The starting point for these programs is a list of reconstructed line segments produced by TSL OIM software. For the TSL software to produce the reconstructed line segments, you need to begin with a *.ang file on a hex grid. To convert square to hex grids, use OIMTools. (If starting from an HKL orientation map, you have to read the ctf file into the OIM software and save it as a *.ang file, convert it to a hex grid using OIMTools, then convert the output using change_ang_h.f; this program reformats the header and columns so that the output can be read by the OIM software). Examples of list of reconstructed line segments are found in ~/Examples/ni_031908_segs. COMBINE_SEGMENTS Each orientation map leads to a single list of reconstructed segments. To generate an adequate data set, it is necessary to combine all of the segments into a single file. This can be done by manual cutting and pasting, or automatically using the program combine_segs. To run this program, all of the segment files must be in the combine_segments directory and labeled as specified in the footer of 'input.txt'. If you move the files from ~/Examples/ni_031908_segs into this directory, the program should run with no changes to produce a new file labeled all_segments.txt. CALC_GBCD This program calculates the grain boundary character distribution from the line segments. The input is explained in the footer of 'input.txt'. If you move all_segments.txt to this directory, calc_gbcd should run with no further changes to produce gbcd_all_segments.txt. TWIN_FILTER This program analyzes the twin content (sigma three, cubic) of a list of reconstructed boundaries and writes three new files. 'report' quantifies the twin content, 'sig3_out.txt' is a list of all line segments corresponding to sigma 3 grain boundaries, and not_sig3_out.txt' is a list of all line segments corresponding to other grain boundaries. If you move all_segments.txt to this directory, twin_filter should run with no further changes to produce gbcd_all_segments.txt. GRAPHICS Note that the programs included here do not by themselves draw graphs. They produces text files that are used as input to other graphics programs (either GMT or 3Dfield). GMT can be obtained for free at http://www.soest.hawaii.edu/gmt/ and 3Dfield can be obtained for a small fee at http://field.hypermart.net/. 3D field works only on windows machines, GMT works on a variety of platforms. The type of graphic output is specified in the input file of graph5 and graph2. If you are using GMT, use the use the script file 'Draw_stereograms' to produce plots. GRAPH5 This program writes files that can be used to graph stereographic projections of the distribution of grain boundary planes in the bicrystal reference frame. If you move gbcd_all_segments.txt to this directory, it should run with no further changes to produce the plane distribution for sigma 3 boundaries that is suitable for input to GMT. To control the graph types, follow the instructions in the footer of 'graph_input.txt'. GRAPH2 This program writes files that can be used to graph stereographic projections of the distribution of grain boundary planes in the crystal reference frame (regardless of misorientation). If you move gbcd_all_segments.txt to this directory, it should run with no further changes to produce the plane distribution suitable for input to GMT. To control the graph types, follow the instructions in the footer of 'input.txt'. update 7/22/08 In the revised version of graph2, you can now select plot type= 4: this will label the output file, and create a command line appropriate to initiate Draw_Stereograms in such a way that only the standard triangle is plotted. Note that only the main and the version of Draw_Stereograms (from Tony Rollett) have changed. This only applies to GMT plots update 6/28/08 There have been many additions, enhancements, and a few corrections over the past nine months. The most recent versions of all programs are in place. update 9/13/07 Minor addition to twin_filter: it now sorts the input data into two output files, one with sigma 3 line segments and one with non-sigma 3 line segments. codes updated 8/27/07 I have added sets of gbcd simulation codes and gbcd analysis codes. Simulation: simulate_gbcd: This code creates standard gbcd files based on predefined functions. The way it is now set up is that you can change the misorientation texture or grain boundary plane texture, but you have to edit the appropriate parameters and recompile the code. The instructions are in the comments. Simulate_obs: This code simulates observations from a planar section. As input, it needs the model gbcd created by simulate_gbcd. It outputs an 'actual' observed gbcd and set of line segments that mimic what would be observed in an experiment. Analysis: compare: computes various metrics illustrating how similar (or different) two standard gbcd files are. find_max: given a gbcd file, this program finds the axis angle representation of the misorientation in the fundamental zone with the maximum value. twin filter: This analyzes files for boundaries with specific misorientations and boundary plane orientations. It is now set up for sigma three twins. It distinguishes sigma threes, non-sigma threes, and boundaries coherent from incoherent, and computes number and length fractions. It also outputs a file measuring deviations of the boundary traces from the ideal twin plane. It does not yet create separate files with the different boundary types, but this is easily added. finally, to the calc_gbcd program, I have made two changes: -degrees to radians conversion is repositioned -it now accepts 'rotation=2' this reference frame is for data produced by the simulate_obs program. Codes updated 7/20/07 Here's a summary of the changes: New symmmetry.f files correct mistake in tetragonal and add operators for orthorhombic The binning has been tweaked once again by adding a small offset in places (eps) to take care of special positions. This mainly affects the graphing, but for consistency was changed throughout. Filenames carry through the gbcd calculation Filenames carry through the graphing 2D graphing has been added Data and results for Ni and MgO are included. There are now two versions of the GBCD calculation. 'conv' is the conventional stereology and I recommend that we continue to use this for the time being. 'MC' is the Monte Carlo corrected stereology. THere are also results for this. It produces different results, but I am not sure yet if it produces 'better' results. I still need to develop some simulated data sets. Codes updated 01/08/07 In this update: The problem binning routine is fixed. Hexagonal data from HKL is automatically rotated -30 so that [2-1-10] is parallel to the x-axis. The structure of the input files has been changed. Notes were added to the input files. The output for the graphics program now tells you the maximum and average MRD values. November 18, 2006 Notes: 1. I have divided the programs so that the calculation of the GBCD is distinct from making graphs. I've also added lots of comments. I hope to improve these as this evolves. 2. The input (intput.txt) files have slightly different formats 3. The folder 'calc_gbcd' has all the stuff for the mean field (MF) calculation. This is the original stereology we have all been using. 4. The folder 'calc_gbcd_new' has all the stuff for the new version of the stereology with an inhomogeneous correction based on Monte Carlo sampling of the errors. I think this will need to be tested more before we use it regularly. 5. Both calc_gbcd programs produce a file labeled 'reconst_gbd.txt'. This is the input for the program that makes graphs 6. The folder graph_gbcd has all the stuff to make stereograms. It outputs files in both the 3D field and GMT formats. 7. Sample data: Two data sets in the folder data are the as received and GBE Ni from integran. 8. Sample results: These two data sets have been run through both programs and the results are in the 'results' folder. These are in qualitative and near quantitative (a few % different here and there) with output from earlier versions. Important Issues: 1. Symmetry operator are slightly different from what we have used in the past. I have check them against the International Table for Crystallography and I believe that they are now correct. 2. Even using the same symmetry operators, there are subtle differences between the results from CSK's original code and this code. When I do a bin-by-bin comparison of the 'reconst_gbd.txt' files produced by the two programs from the same data, the maximum difference is any bin is 0.79 MRD and the average difference over all bins is 0.00029 MRD. A very small fraction of the bins have differences greater than 0.1. These differences are larger in the stereograms that are output by the graphics part of the program. However, A detailed comparison of the binning in this program and CSK's original shows that the difference arises from the process that determines the index of the bin associated with a certain boundary type. The programs sometimes select different, but neighboring bins. For example, one code generates index '6' and the other '7'. The differences occur almost exclusively in the second and fourth index. These are the indices where a 'cos' function call is used in the determination of the index. I surmise that there are small differences in the implementation of the cos function on the two platforms. Unless somebody has a good idea, I probably will not pursue this further. 3. I have not yet implemented the "expanded" domain that Tony has been working one. As soon as we get that issue sorted out, I will incorporate the changes. 4. I also plan to implement filtering, but have not done this yet. 5. the 'new' stereology uses a monte carlo sampled correction, contained in the file 'omega'. I have to check with CSK about how he did this. If he used the "old" symmetry elements, we will probably have to recalculate this.