YaleDefm

YALE DEFORMATION PROGRAMS
July 12, 2007

Mark T. Brandon
Department of Geology and Geophysics
Yale University
P.O. Box 208109
New Haven, CT 06520-8109

YALEDEFM Programs here

INTRODUCTION
This zip file contains a series of programs developed for research by Brandon and others (1994), Brandon (1995) and other manuscripts in preparation (see references cited below).

BRIEF DESCRIPTIONS OF THE YALE DEFORMATION PROGRAMS
AZIMUTH  : Average azimuth in thin section of fibers and selvages
AZ2TP    : Converts an azimuth in a thin section to the field-reference frame
CONVAXES : Converts between AXES and EULER methods for specifying strain axes
ERATE    : Convert between strain rate and finite strain
EXHUME   : Estimate contribution that ductile strain makes to exhumation
FBR_SIM  : Simulation of semi-deformable antitaxial fiber growth
FIBER    : Estimate deformation parameters from digitized antitaxial fibers
IROTCALC : Internal rotation for a sample from section rotation measurements
MEANDEFM : Calculate mean strain, internal rotation, and kinematic numbers
MICRODIG : Data acquisition from microscope digitizer
NEWCUT   : Find orientation of a new cut in a rock relative to strain axes
ORIENT:  : Find a new orientation surface for an oriented sample
PDSCALC  : Calculation of SMT strain using the PDS method
RFPSHIM  : Rf-phi analysis using Shimamoto and Ikeda method
SCN2FRY  : Convert a SCN file to a format usable by Erslev’s INSTRAIN program
SHEAR    : Estimating 2D strain using shear-strain markers
STRAIN3D : Calculate best-fit 3D strain from a set of 2D strain ellipses
STRETCH  : Calculate stretch of a line for a specified finite strain tensor
USTAGE   : Analyze and contour data from a 5-axis ustage
XTGFIT   : Finds best-fit strain tensor from X-ray texture data for phylosilicates

The programs are written in Microsoft Professional Basic 7.0, an advanced version of QBasic. The executables will run on any DOS-style  computer. To ensure broad compatibility, the programs have “plain-vanilla” design, and require no more than a monochrome monitor and a standard ASCII printer. Each program first presents a short overview plus a description of the format for any required data file. Data files are constructed using an ASCII-type editor (see examples below and in subdirectory DATA).
If you have any problems getting these programs to run on your
computer, please provide me a concise description of the problem and
I will attempt to fix any bugs and supply you with a modified version.

Files are divided between four directories:
(1) SOURCE original source code and make file for all of the programs.
(2) EXEC executable versions of the programs, which can be run at   the DOS command line by simply typing the name of the program. Also included are any INI files (e.g. MICRODIG.INI) needed by the programs.
(3) OUTPUT contains some files that show examples of the output of some  selected programs.
(4) DATA includes example data files.
(5) SUB  subroutines called by the make files in SOURCE

DATA FORMAT
The above programs use the following data files. Note that the extensions indicated below represent my preferences and are not required by the programs.

.FBR    Digitized output of fibers from MICRODIG;  used as input by FIBER
.SCN    Digitized output of grain shapes from MICRODIG; used as input by RFPSHIM and SCN2FRY
.RFP    Rf-phi data for RFPSHIM
.PDS    Digitized output of PDS grain shapes, used by PDSCALC
.S3D    2D strain ellipses used by STRAIN3D to calculate 3D strain
.ROT    Sectional measurements of internal rotation used by IROTCALC
.DFM    Strain and internal rotation data for MEANDEFM
.SHR    Input measurements of shear-strain markers for SHEAR
.PLT    Output from FIBER and FBR_SIM for plotting results
.PRN    Printer-style output redirected to a file
.TXT    Data form, e.g. ORIENT.TXT: form for collecting ORIENT data
.WP6    Data form, e.g. ORIENT.WP6 in WordPerfect for Windows V. 6.1
.UST    Input data for USTAGE program
.UF1   
.UF2    | Output from USTAGE PROGRAM, in field-reference frame
.UF3    / The final digit indicates the axis number for the data
.UT1   
.UT2    | Output from USTAGE PROGRAM, in thin-section-reference frame
.UT3    / The final digit indicates the axis number for the data
.XT    X-ray texture data for analysis by XTGFIT

USE OF PROGRAMS FOR DEFORMATION ANALYSIS
There are several typical kinds of deformation analysis: PDS method, Fry method, and Rf-Phi Method.

PDS METHOD: Used to measure strain and internal rotation in pressure-solved rocks.
1) Find principal fabric directions X, Y, and Z. The rock is
cut parallel to cleavage which is assumed to be the XY plane.
2) The ORIENT program is used to transfer the orientation surface (OS) to the cleavage parallel cut, which is now designated by the axes A and B.
3) The orientation of fiber overgrowths in the AB (=XY) section are measured using the microscope. The average fiber direction, assumed to be
the X strain direction, is determined
4) This new information is used to cut and prepare an XZ section. The AZ2TP program is used to calculate strain axis directions for X, Y, and Z  in the field-reference frame.
5) PDS measurements are made for the XY and XZ sections. Our procedure is to make these measurements using a microscope with a camera lucida tube and digitizer tablet. The MICRODIG program controls data acquisition from this setup. PDS measurements consist of 4 points per grain, marking the most extreme points in the north, south, east and west directions. The sections must be oriented with the X direction pointing towards microscope north.
6) The PDS data are analyzed using the PDSCALC program.
7) The amount of extensional deformation in the X, Y, and Z directions is determined by making measurements of the modal abundance of fiber overgrowth in the XY and XZ sections. For unidirectional fiber overgrowth, the amount of extension Sx = 1/(1-M) where M = fractional modal abundance of fiber in the section. For multidirectional fiber overgrowth, the modal abundance of fiber only indicates the area dilatancy in the section Sa = 1/(1-M).
8) The fiber overgrowths can be digitized using the MICRODIG program and analyzed using the FIBER program. For unidirectional fibers, the FIBER program will estimate the component of internal rotation in the section.  For multidirectional fibers, FIBER will estimate internal rotation as well as the principal directions and magnitudes of the extensional stretches.
9) The total internal rotation for a sample can be estimated from  rotational data from the XY and XZ sections, as estimated for the previous step. The IROTCALC program is used for this purpose.
10) The MEANDEFM program is used to estimate the average deformation, including
both strain and rotation, for the suite of samples.

FRY METHOD: Used to measure strain in rocks where grain centers have deformed
relative to each other in a passive and homogeneous manner.
1) At least three sections are cut per rock sample, with each section at a high angle to the others. The AZ2TP and CONVAXES programs can be used to find the orientation axes for each of the thin sections.
2) Grain shapes are digitized in each section. The MICRODIG program  can be used to digitize the outlines of each grain (.SCN file format).  In this situation, one must digitize several fields of view in the microscope. MICRODIG allows the operator to offset different fields of view so that the Fry analysis only sees nearest-neighbor distances between grains within the same field of view.
3) The program SCN2FRY is used to convert the SCN file to the CE4 format used by Erslev’s INSTRAIN program. Digitized points around the perimeter of each grain are converted into a best-fit ellipse. The CE4 contains a listing of the points marking the ends of the long and short axes of the best-fit ellipse for each grain.
4) Fry strain is determined using Eric Erslev’s INSTRAIN program.
5) The results for the sections can be combined using STRAIN3D to estimate the 3D strain tensor for the sample.

RF-PHI METHOD: Used to measure strain in rocks where objects have deformed in a
passive and homogeneous manner.
1) At least three sections are cut per rock sample, with each section at a high angle to the others. The AZ2TP and CONVAXES programs can be used to find the orientation axes for each of the thin sections.
2) Grain shapes are digitized in each section. The MICRODIG program  can be used to digitize the outlines of each grain (.SCN file format).  Alternatively, one can make manual measurements of the long axis orientation, and the long and short dimensions or each grain (.RFP file format).
3) The data for each section is analyzed using the RFPSHIM program.
4) The results for the sections can be combined using STRAIN3D to estimate the 3D strain tensor for the sample.

FAIR USAGE AND CITATIONS
I have included the source code so that the calculations can be
inspected. Comments in the code provide a detailed outline of the procedures and include references to the literature for further details, where appropriate. An important objective is to make it easier for others to experiment with the programs, with the hope that such efforts will lead to improvements. If you distribute modified versions of these programs, please also include a copy of the original versions or, at the very least, indicate my name and address as a source for the original programs. Also, clearly indicate in the modified program where the original version was obtained from and that the program has been modified.
If you use these programs in an substantial way, then I request that you
make note of this in any publications that results.
Thank you for your interest. Please do not hesitate to contact me if you
have any questions, comments, or criticisms.

MODIFICATION AND COMPILATION
If you want to modify the programs included here, it is important to note that some of the subroutines in the IOTASKS module make calls to the DOS interrupts. These calls are handled through a set of assembly language routines that are included in the libraries QBX.QLB and QBX.LIB. The QBASIC interpreter must be started using the following commands:
SET LIB=BC7LIB
QBX.EXE /L QBX.QLB /AH %1
Use the following commands to compile a program:
>>> Set the library environmental variable
SET LIB=BC7LIB

>>> Compile the main module:
BC progname.bas progname.obj /AH/D/O/Ot/Lr/FPi/E

>>> Compile all subroutine modules needed:
BC subname.bas subname.obj /AH/D/O/Ot/Lr/FPi/E

>>> Link all of the object files to make the final executable.
>>> Note that the command below should be continued on one line.
Link /E progname.obj+subname.obj+…+subname.obj, progname.exe,
nul.map, BCL70ENR QBX;

REFERENCES
Brandon, M.T., 1995, Representation of geologic strain data  in strain-magnitude space. Journal of Structural Geology,  17, 1375-1385.

Brandon, M.T., Cowan, D.S., Feehan, J.G., 1993, Comment on  “Kinematic analysis of the San Juan thrust system, Washington  by H. Maekawa and E.H. Brown, Geological Society of America  Bulletin, 105, 839-840.

Cowan, D.S., and Brandon, M.T., 1994, A symmetry-based method for  kinematic analysis of large-slip brittle fault zones, American Journal of Science, 294, 257-306.

Feehan, J., and Brandon, M.T., ms., A quantitative estimate of the relative contribution of ductile flow to exhumation of a thrust wedge, San Juan – Cascade nappes, NW Washington state.

Ring, U., and Brandon, M.T., 1994, Kinematic data for the Coast Range fault and implications for exhumation of the Franciscan subduction complex, Geology, 22, 735-738.

Ring, U., and Brandon, M.T., ms., Ductile strain, coaxial deformation, and mass loss in the Franciscan subduction complex (California, U.S.A.).

EXPANDED DESCRIPTION OF YALE DEFORMATION PROGRAMS

AZ2TP program v. 1.1, 12/1/96  Mark Brandon, Yale University
============================================================================
This program converts from an azimuth direction in a thin section to
a trend and plunge in the field-reference frame.

For input, the program requires the trend and plunge of the thin-section
reference directions pointing towards microscope N and E,
and the azimuth in the thin section of the feature of interest.

As output, the program gives the trend and plunge of the feature of interest
in the field-reference frame. Also given are the orientations of directions
located at azimuths of 90, 180 and 270 degrees to the feature of interest.

AZIMUTH program v. 1.2, 12/1/96 Mark Brandon, Yale University
============================================================================
This program calculates the mean azimuth of fiber overgrowths or selvages in
a thin section as measured on a microscope stage.

Output is directed to the printer and includes a histogram and statistics for
the azimuth distribution. The program can accommodate up to 500 observations.

CONVAXES program v. 1.1, 12/1/96  Mark Brandon, Yale University,
============================================================================
This program converts between the AXES and EULER methods for representing
the 3D orientation of axes in strain analysis.

Consider a geographic coordinate frame defined by the axes NED:
north, east, and down, and strain axes defined by XYZ.

The AXES method specifies the trend and plunge of the X and Y axes.

The EULER method uses the Euler angles to define three successive rotations
needed to move a set of XYZ strain axes from orientations parallel to the NED
axes to their actual geographic orientation. The first rotation is
by Alpha degrees around the D axis. The second rotation is by Beta degrees
around the current position of the X axis. The third is by Gamma degrees
around the current position of the Z axis. Positive angles indicate right-
handed rotations. When finished, Alpha and Beta give the strike (0-360) and
dip (0-90) of the XY plane, and Gamma gives the pitch (= rake) (0-360) of
X in the XY plane. For more details about the Euler method, see Fry
(1979, Journal of Structural Geology, v. 1, p. 221-229).

ERATE program v. 1.1, 12/1/96  Mark Brandon, Yale University
===========================================================================
This program converts between a constant strain rate and finite strain.
The calculations are after Pfiffner and Ramsey (1982, JGR, 87, 311-321).

>>> Program options:
1) Calculate strain rate from finite strain and time
2) Calculate finite strain from strain rate and time
3) Calculate time from finite strain and strain rate

EXHUME program  v. 2.1, 12/1/96  Mark Brandon, Yale University
=============================================================================
This program determines the contribution that ductile strain makes
to the exhumation of a particle accreted to the base of the wedge
(see Brandon and others, 1994, for details).

Note that the program reports the time/depth/deformation history
in a tabular form. This information can be transferred to a
graphics/plotting program by selecting the option to send the output
of the EXHUME program to a file.

>>> The program requires the following information:
1) directions and magnitudes of the principal stretches
2) direction, sense, and magnitude of rotational component of deformation
3) depth of initial accretion
4) duration of residence in the wedge
5) azimuth of the transport direction for the wedge

FBR_SIM program v. 1.4, 12/1/96   Mark Brandon, Yale University
============================================================================
Simulates fiber growth and cleavage development for a generalized deformation
as predicted by Brandon’s semi-deformable (SA) fiber model.

Results are normalized so that the average radius of a section through the
reference sphere is one, which corresponds to a reference sphere of
radius 4/Pi. Note that the average section (with a radius equal to one)
is located at a distance of 0.619 from the center of reference sphere.

A distinction is made between unidirectional and multidirectional fibers.

UNIDIRECTIONAL SA fibers are generally orientated in one direction
tend to converge inward at their tips. They are formed in
sections where the minor principal stretch is less than one.

MULTIDIRECTIONAL SA fibers are oriented in many divergent directions
in the section. They are formed in sections where the minor
principal stretch is greater than one.

FIBER program v. 1.6, 12/1/96   Mark Brandon, Yale University
=============================================================================
This program analyzes a set of digitized antitaxial fibers and
estimates averages for various deformation parameters as interpreted
by Brandon’s semi-deformable antitaxial (SA) fiber model.

The input file should contain the digitized traces of 20 or more fibers,
with points for each fiber ordered from youngest to oldest (i.e., outward from
the fiber/grain interface). The digitized fibers should be representative of
all non-truncated fibers in the thin section and each fiber should be
represented by a minimum of 3 points.

The input file must have the extension .FBR.

For this program to operate correctly, the user must distinguish between
unidirectional and multidirectional fiber growth.

UNIDIRECTIONAL SA FIBERS are generally oriented in one direction and
tend to converge inward at their tips. They are formed in sections where
the minor principal stretch is less than one. For this case, the user
must specify major and minor principal stretches and the average orientation
of selvages for the section. The program returns estimates of the internal
rotation and the mean section radius of the grains.

MULTIDIRECTIONAL SA FIBERS are oriented in many divergent directions in
the section, ideally with a uniform distribution in azimuth. They are
formed in sections where the minor principal stretch is greater than one.
For this case, the user must specify the area dilation, equal to the
product of the principal stretches for the section. The program returns
estimates of the direction and magnitude of the principal stretches, the
internal rotation, and the mean section radius of the grains.

>>> The input file must have the extension .FBR and the following format:
LINE 1: Sample description          (less than 80 characters)
LINE 2: Digitization program and measurement units
LINE 3: ORIENTATION DATA            (label entered as ASCII text)
LINE 4: Trend, Plunge               (section direction for microscope N)
LINE 5: Trend, Plunge               (section direction for microscope E)
REPEAT THE FOLLOWING LINES FOR EACH FIBER:
NorthCoord. EastCoord.              (youngest point, at fiber/grain interface)
|          |                   (intermediate points)
NorthCoord. EastCoord.              (oldest point)
END  Object number: i               (end of ith fiber)

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.

The reference frame is defined by microscope axes, north and east.
North is away from the viewer and east is to the viewer’s right,
when viewed externally sitting at the microscope. Note that digitized
data derived from the microscope image must account for any inversion
or rotation relative to the external reference frame.

IROTCALC program v. 1.1, 12/1/96   Mark Brandon, Yale University
============================================================================
Given a set of measured section rotations, this routine first calculates the
the total internal rotation for each sample and then finds the average
internal rotation tensor for all of the samples in the dataset.

The total internal rotation for each sample is determined by vector
addition of the measured section rotations.

The average internal rotation is determined by converting each
observation to a ‘reduced’ rotation, defined by multiplying the rotation
angle by (1/(N*1000)) where N is the number of samples. The rotation axis
and the ‘reduced’ rotation angle are used to construct a 3×3 ‘reduced’
rotation tensor for the sample. Summing these reduced tensors and then
multiplying by 1000 gives the estimated average internal rotation tensor.

>>> The input file must have the extension .ROT and the following format:
LINE 1:  Descriptive information about data (less than 80 characters)
LINE 2 to (N+1):
Y_trend  Y_plunge  Y_Rotation_Angle   Z_trend  Z_plunge  Z_Rotation_Angle

NOTES:
1) The program assumes that input data are in a free-format form
with individual entries separated by spaces or commas.
2) Rotation_angle is the rotation in degrees around the positive end
of the designated axis. The sense of rotation (positive or negative)
is determined by the right-hand rule.
3) Directions must indicate the positive end of the axis in the
field reference frame, with positive and negative plunges indicating
down and up, respectively.
4) The program asks for only the Y and Z rotations because it is assumed
that rotations can only be measured in the XZ and XY sections
(fiber overgrowths are usually not observed in YZ sections).
5) Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.

MEANDEFM program  v. 1.3, 12/1/96   Mark Brandon, Yale University
=============================================================================
Given an observed deformation gradient tensor F, this program finds the
equivalent velocity gradient tensor L, based on the assumption that the
deformation is the result of a steady flow. Also calculated are averages
for the kinematic vorticity number, the kinematic dilatancy number, and the
strain tensor using the Hankel-tensor method of Brandon (JSG, 1995).

Input file must have the extension .DFM.

>>> Input file must have the extension .DFM and the following format:
LINE 1: Descriptive information about data file (<80 characters long)
LINE 2 to N+1:
TSx  PSx  Sx   TSy  PSy  Sy   TSz  PSz  Sz  Trot Prot RotAng

Sx, Sy, Sz are the principal stretches and TS, PS define the trend and
plunge of the principal directions, designated by X, Y, and Z. Trot and
Prot are the trend and plunge of the axis of rotation and RotAng is the
rotation angle in degrees with polarity defined by the right-hand rule.

If internal rotation measurements are not available, the entries can
be flagged out by Trot, Prot, RotAng = 999, 99, 9.

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.

MICRODIG program v. 2.3, 12/1/96   Mark Brandon, Yale University
===========================================================================
This program works with a camera-lucid tube and a digitizing tablet to measure
deformed objects as viewed through a microscope.

Parameters for your specific microscope/digitizer system must be set
in the MICRODIG.INI file, which must be located in the same directory
as the MICRODIG program.

The reference frame for the digitized data is defined by microscope north
and east. When viewed externally, north is away from the viewer and
east is to the viewer’s right. Note that the screen display mimics the
inverted view seen through the microscope, but the digitized output does not.

For each pair of coordinate values recorded, the first value corresponds to the
north axis and the second to the east axis. Coordinates are measured relative
to an arbitrary origin. The user can calibrate the coordinate frame to a
specified length scale, with microns being the preferred unit.

The keys on the digitizer pluck have the following functions:
P: (Key 1) Enters a point
D: (Key 2) Deletes the last point entered
C: (Key 3) Closes the present object (twice will clear the screen)
X: (Key 4) Choice: offset origin (for Fry method), change scale factor,
or close current digitizing file

MICRODIG writes an ASCII file using the following format:
LINE 1: Sample description                  (less than 80 characters)
LINE 2: Digitization program and measurement units used
LINE 3: ORIENTATION DATA                    (label in ASCII text)
LINE 4: Trend, Plunge                       (field orientation for microscope N)
LINE 5: Trend, Plunge                       (field orientation for microscope E)
THE FOLLOWING LINES ARE REPEATED FOR EACH OBJECT:
NorthCoord. EastCoord.                      (first point for the ith object)
|          |                           (intermediate points)
NorthCoord. EastCoord.                      (last point for the ith object)
END  Object number: i                       (end of data for the ith object)

.PDS = four ‘maximum-extent’ points in N,E,W,S directions; used by PDSCALC
.SCN = digitized outlines of grains; used by RFPSHIM and SCN2FRY
.FBR = digitized fiber overgrowths; used by FIBER

NEWCUT program v. 1.2, 12/1/96   Mark Brandon, Yale University
============================================================================
This program calculates the orientation of a new surface relative to an
existing orientation surface.

The existing orientation surface is defined by axes ABC.

The new surface is designated by axes DEF.

Axes are assumed to be right-handed (AxB = C, DxE = F), with C and F normal
to the old and new surfaces, respectively.

All axes should be specified relative to a common reference frame
(e.g., geographic reference frame: NED).
The required input is the trend and plunge of A and B, and D and E.

The calculated result is the Euler angles for the orientation of the new
surface relative to ABC for the old surface.

The Euler angles define the three successive rotations needed to move a set
of axes that start parallel to the ABC axes to a final orientation parallel
to DEF. The first rotation is by Alpha degrees around the C axis. The second
rotation is by Beta degrees around the new position of the D axis. The third
is by Gamma degrees around the new position of the F axis. Positive angles
indicate right-handed rotations. Thus, relative to ABC, Alpha and Beta give
the strike (0-360) and dip (0-90) of the DE plane, and Gamma gives the pitch
(= rake) (0-360) of D in the DE plane. For more details about Euler angles as
used in geology, see Fry (1979, Jour. of Structural Geology, v. 1, p. 221-229).

ORIENT program v. 1.2, 12/1/96   Mark Brandon, Yale University
============================================================================
This program helps with the transfer of orientation information from
an original orientation surface (OS) to a new OS cut in a rock sample.

The OS, which is used to define the orientation of the rock in the field-
reference frame, is defined by a directed strike {0,360}, dip {0,90}, and
dip direction {N,S,W,E,R} (R indicates an attitude measured using the right-
hand convention).

The program determines the directed strike, dip, and dip direction for the
new OS in the field-reference frame, and the azimuth of the strike/dip symbol
on the OS itself. The text file ORIENT.TXT provides further instructions
about the information needed for this program.

PDSCALC program v. 1.4, 12/1/96  Mark Brandon, Yale University
============================================================================
This program calculates SMT strain using the projected-dimension strain
(PDS) method. The required input is a MICRODIG file containing grain data
from an XY or XZ principal section. The section is assumed to have been
aligned with X oriented towards microscope N. Each grain is represented by
four points, indicating the maximum extent of the grain in the N, E, W, and
S directions. These points can be in any order and relative to any origin.
They are used to calculate the caliper dimensions in the XY or XZ directions.

The input file must have the extension .PDS.

>>> The input file must have an extension of .PDS and the following format:
LINE 1: Sample description                (less than 80 characters)
LINE 2: Digitization program and measurement units used
LINE 3: ORIENTATION DATA                  (label in ASCII text)
LINE 4: Trend, Plunge                     (field orientation for microscope N)
LINE 5: Trend, Plunge                     (field orientation for microscope E)
REPEAT THE FOLLOWING LINES FOR EACH GRAIN:
NorthCoord. EastCoord.                    (northernmost point in N direction)
NorthCoord. EastCoord.                    (southernmost point in N direction)
NorthCoord. EastCoord.                    (easternmost point in E direction)
NorthCoord. EastCoord.                    (westernmost point in E direction)
END  Object number: i                     (end of data for the ith grain)

The program can handle up to 300 grains.
Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.
The reference frame is defined by microscope axes, north and east.
North is away from the viewer and east is to the viewer’s right,
when viewed externally sitting at the microscope. Note that digitized
data derived from the microscope image must account for any inversion
or rotation relative to the external reference frame.

==============RFPSHIM PROGRAM v.4.2, 5/6/03 MTB==========
This program finds a best-fit strain ellipse for Rf-phi data using the
algebraic method of Shimamoto and Ikeda (Tectonophysics, 1976), with
uncertainties calculated by the bootstrap method.

Data can be entered as long and short axes measurements (.RFP data)
or as digitized grain outlines (.SCN data).

The best-fit strain ellipses can be used to estimate the 3D-strain ellipsoid
using the STRAIN3D program.

Output from this program can be directed to a file or to a printer.
If a printer is to be used, it must be connected to the parallel port
LPT1 and must be set to on-line mode.

>>> The .RFP file must use an extension of .RFP and the following format:
LINE 1: Sample description              (less than 80 characters)
LINE 2: Additional sample information   (less than 80 characters)
LINE 3: ORIENTATION DATA                (label entered as ASCII text)
LINE 4: Trend, Plunge                   (field orientation for image N)
LINE 5: Trend, Plunge                   (field orientation for image E)
REPEAT FOR EACH GRAIN: LongDimension ShortDimension  PhiPrimeAngle

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.
The reference frame for the data is defined by north and east image axes.
These directions are referred to their 3D field direction according
to the trend and plunge information given under ORIENTATION DATA.
Angles in the image are defined relative to image north, and are defined
as positive for rotations that move from image north to image east.

Note that digitized data derived from a image image must account
for any inversion or rotation of the image relative to the thin section
reference directions.

The calculation can handle up to 600 grains. Each grain is represented by
long and short dimensions of the grain outline as approximated by an ellipse.
Any unit of distance can be used. PhiPrimeAngle indicates the orientation in
degrees of the long axis measured relative to image north with positive
angles designated as defined above.

>>> The .SCN file must use an extension of .SCN and the following format:
LINE 1: Sample description              (less than 80 characters)
LINE 2: Digitization program and measurement units
LINE 3: ORIENTATION DATA                (label entered as ASCII text)
LINE 4: Trend, Plunge                   (section direction for image N)
LINE 5: Trend, Plunge                   (section direction for image E)
REPEAT FOLLOWING LINES FOR EACH GRAIN
NorthCoord. EastCoord.                  (first point on grain boundary)
|          |                        (additional points for boundary)
NorthCoord. EastCoord.                  (last point on grain boundary)
END  Object number: i                   (end of data for the ith grain)

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.
The reference frame is defined by image axes, north and east.
Note that digitized data derived from a microscope image must account
for any inversion or rotation of the image relative to the thin section
reference directions.

The calculation can take up to 600 grains. Each grain must be represented
by at least 6 digitized points, but more points (up to 600) are needed for
precision results. Any distance unit of can be used. Angle are reported
relative to the image north axis, with positive angles indicating a
rotation from the image north direction to the image east direction.

SCN2FRY program v. 1.0, 12/1/96  Mark Brandon, Yale University
============================================================================
This program converts a .SCN data file to a file format that can be
used by Eric Erslev’s INSTRAIN program.

The .SCN file contains digitized outlines of grains. For the Fry method
to work, objects within each field of view must be digitized relative to a
single coordinate frame. Data collected from different fields of view must be
offset by a sufficient amount to ensure that the digitized values do not
overlap. The MICRODIG program provides options to ensure that these
requirements are fulfilled.

The new file will have the format of a .CE4 file where each digitized grain is
represented by a best-fit ellipse defined by four X-Y coordinates that mark
the end points of the long and short axes of the section ellipse.

>>> The input file must use the extension .SCN  and the following format:
LINE 1: Sample description              (less than 80 characters)
LINE 2: Digitization program and measurement units
LINE 3: ORIENTATION DATA                (label entered as ASCII text)
LINE 4: Trend, Plunge                   (field orientation for microscope N)
LINE 5: Trend, Plunge                   (field orientation for microscope E)
REPEAT FOLLOWING LINES FOR EACH GRAIN
NorthCoord. EastCoord.                  (first point)
|          |                        (intermediate points)
NorthCoord. EastCoord.                  (last point)
END  Object number: i                   (marks end of the ith grain)

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.
The reference frame is defined by microscope axes, north and east.
North is away from the viewer and east is to the viewer’s right,
when viewed externally sitting at the microscope. Note that digitized
data derived from the microscope image must account for any inversion
or rotation relative to the external reference frame.

The calculation requires that each grain must have at least 6 digitized
points, but no more than 300 points.

>>> The output file is designated by the extension .CE4. The file is made
up of four coordinate points per grain, using the following format:
LINE 1: EastCoord NorthCoord  (for 1st end point of long axis)
LINE 2: EastCoord NorthCoord  (for 2nd end point of long axis)
LINE 3: EastCoord NorthCoord  (for 1st end point of short axis)
LINE 4: EastCoord NorthCoord  (for 2nd end point of short axis)
REPEAT LINES ABOVE FOR EACH GRAIN

The reference frame is defined by microscope axes, north and east.
North is away from the viewer and east is to the viewer’s right.
Labels and background information are printed to the right of the
data records. This extra information is ignored by the INSTRAIN program.

SHEAR program  v. 1.2, 12/1/96, Mark Brandon, Yale University
============================================================================
This program calculates Rs and theta prime from a set of sheared objects.
The Wellman method is used first to determine an approximate solution, then
a nonlinear optimization routine is used to find a best-fit Rs and
Theta prime that minimizes the sum of the squared difference between
observed and calculated shear angles.

The input data is entered by the user or read in from a data file
that contains a shear-strain measurement– T, P — on each line.

T, which is the shear direction or baseline azimuth, is a directed vector
measured with respect to north with a range {-360, 360; clockwise is positive}.

P, which is the shear strain angle, is a clockwise angle in the range {0,180}
from the baseline azimuth to a line that was originally perpendicular to
the shear strain direction.
The relation between P and the angular shear strain parameter, Psi, used by
Ramsay and Huber (1983, p. 129), is: P = 90 – Psi

STRAIN3D program  v. 1.2, 12/1/96  Mark Brandon, Yale University
============================================================================
This program calculates a best-fit strain ellipsoid from 2-D section
ellipses measured on 3 or more arbitrarily oriented planes, using a
method after Owens (1984, JSG, v. 6, p. 571-578).

Improvements are:
(1) Singular-value decomposition is used to find a unique stable solution,
(2) Owen’s scaling factors are subtracted out which reduces the inversion
to finding 6 unknown parameters.

The input file must have an extension of .S3D.

>>> The input file must use an extension of .S3D and the following format:
LINE 1: Sample description (less than 80 characters)
LINES 2 TO N+2, repeat for each section ellipse (at least 3 ellipses):
Tmajor  Pmajor  Lmajor   Tminor  Pminor  Lminor

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.

Each section ellipse is specified by the trend, plunge, and lengths
of its major and minor axes. Note that program only uses the ratio
Lmajor/Lminor so that major and minor lengths can be entered as Rs and
1 if more convenient. The program works best when section ellipses are
oriented at high angles to each other.

STRETCH program  v. 1.1, 12/1/96   Mark Brandon, Yale University
=============================================================================
Given a finite strain tensor, this program can be used to find
the stretch associated with lines of different orientation.

USTAGE program v. 2.2,  12/1/96    Mark Brandon, Yale University
===========================================================================
This program calculates the orientation of crystal axes as measured on a
five-axis U-stage.

>>> The input file must use the extension .UST and the following format:

Line 1: Sample description            (less than 80 characters)
LINE 2: ORIENTATION DATA              (label entered as ASCII text)
LINE 3: Trend, Plunge                 (field orientation for microscope N)
LINE 4: Trend, Plunge                 (field orientation for microscope E)
LINE 5: Label for first axis          (up to 8 characters)
LINE 6: Label for second axis         (up to 8 characters)
LINE 7: Label for third axis          (up to 8 characters)
LINE 8 AND ON: NS_axis  IEW_axis  IV_axis  1st_axis  2nd_axis  3rd_axis
where NS_axis = {-90<>90, E+}, IEW_axis = {-90<>+90, N+}, and
IV_axis = {-360<>+360, Clockwise+}, and nxx_axis = {N,E,V} where N E V
indicates the position of each axis, whether towards microscope
North, East, or Vertical.  For example: 23  -43  56  N E V

Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.

NOTE: For lines 5-7, leave blank those axis directions that were not measured.
Lines 8 and on should only report axis positions for those axes that were
actually measured in the order they were specified in lines 5-7.

>>> The user can select several types of output files:
Tabulated numerical results are saved in .PRN files.

Export data files for use with SPHERISTAT or PCON are designated by
extensions: .UT1, .UT2, .UT3 or .UF1, .UF2, .UF3.
The letters T vs. F indicate a thin-section vs. field reference frame.
The numbers indicate the axis number represented by the data file.

>>> Export data files have the following format:
Line 1: Sample description
LINE 2: Axis name and reference frame
LINE 3: LINEATION                       (needed for PCON program)
LINE 4 AND ON: Trend  Plunge

======================XTGFIT PROGRAM  v. 2.5 MTB 3/24/01==========
Finds the best-fit quadratic coefficients for XTG data using the
MRQ and SVD routines from Press and others (1986, p. 526-528).
The user can also select to find a best-fit background and/or an
isotropic absorption factor. The absorption factor is used to correct
for intensity changes due to sample tilt. Background and net intensities
are treated separately using an equation relating absorption to sample tilt.
The inverse method also uses the standard errors for the measured
intensity to calculate weighting factors for each observation.
This version requires that the input data use the .XT data format.
Results are reported in both the XTG and field reference frames.
Parameter errors are estimated from the parameter covariance matrix,
which is scaled upward by the value of the reduced chi square when
reduced chi square is greater than one.

>>> The input file is after the Sintag XTG output file format. It must have
>>> an extension of ‘.XT?’.  The specific format is:
LINE 1: Sample description                (less than 80 characters)
LINE 2: 2-Theta for peak, entered in character positions 1-7 in line
LINE 3: Preset limits (This record is for information only.)
LINE 4: Acquistion date/time in: mm dd yy hh mm ss, entered in character
positions 1-30 in line. (This record is for information only.)
LINE 5: Data mode during XTG acquistion, as reported in data file.
This record is for information only. Options include:
‘1: LINEAR BACKGROUND MEASURED AT EACH TILT STEP’
‘2: LINEAR BACKGROUND MEASURED AT EACH POSITION’
‘3: NONLINEAR BACKGROUND MEASURED AT EACH TILT STEP’
‘4: NONLINEAR BACKGROUND MEASURED AT EACH POSITION’
LINE 6: ORIENTATION DATA   (label in ASCII text)
LINE 7: Trend, Plunge      (field orientation for the +T direction)
LINE 8: Trend, Plunge      (field orientation for the +R direction)
REPEAT THE FOLLOWING LINES FOR EACH INTENSITY MEASUREMENT:
Tilt  Azimuth  Uncorrected_intensity  Std_error  Corrected_Intensity  Std_Error

The program can handle up to 700 measurements. Xray intensities are
assumed to be in counts per second (cps), but other units can be used.
Comment lines, marked by a leading semicolon, can be placed anywhere in
the file. Blank lines are ignored.

The XRD reference frame is given by a right-handed set of axes {BAG}:
B (bisector) lies in the plane of the diffraction beam, and bisects the smaller
angle (180-2theta) of the diffracted beam.
A (goniometer axis) parallels the 2theta rotation axis and has a polarity
indicated by the cross product GxB.
G (generator) points towards the generator in the plane of the diffracted beam
with a direction equal to BxA.
The sample reference frame is given by the right-handed axes {TRN},
which are equal to {BAG} when tilt and azimuth are zero.
T is the transverse direction, R is the rolling direction, and
N is the sheet normal.
The orientation data specified in the input file describes the field
orientations of the +T and +R directions for the sample as mounted
in the XTG stage.
Rotations of the XTG stage are defined by the tilt and azimuth angles.
A positive tilt corresponds to a right-handed rotation around the
+A axis, and a positive azimuth, by a right-handed rotation around
the +N direction.