#### DESCRIPTION #######################################################
########################################################################
##   Looks for oddities in orientation and fixes if minor. Also finds ##
##  orthogonal horizontal pairs and puts the perpendicular component  ##
##  orientation code in the kuser0 field. YOU SHOULD FOLLOW UP ON ANY ##
##  WARNINGS/MESSAGES OUTPUT BY THIS PROGRAM AND VERIFY THEY ARE THE  ##
##  CORRECT ACTION.  FAILURE TO DO SO WILL LIKELY LEAD TO PROBLEMS!!! ##
##                                                                    ##
##  Next Version: deal with stations where stream code varies with    ##
##                the component (rare but exists)                     ##
##                                                                    ##
##   LAST EDITED: Jun. 14, 2008 at 18:00 GMT by Garrett Euler         ##
##   VERSION INFO:                                                    ##
##            2.7: lots of fixes, still a crufty game                 ##
##            2.6: station specific fixes now in place                ##
##            2.5: sac macro sig dig fixes                            ##
##            2.4: better handling of when input and output           ##
##                 directories are equal (skip copying)               ##
##            2.3: threading support added to optimize efficiency     ##
##            2.2: found more orientation problems that need fixes    ##
##                 - fixes: Z,N,E specific fixes, orientation equal   ##
##                 but should be orthogonal fixes, and sac read fix   ##
##                 - added: can set minor angle now                   ##
##            2.1: code cleaning                                      ##
##            2.0: fixes minor orientation issues and finds           ##
##                 rotatable pairs                                    ##
##            1.1: no more tables - pull values from files and check  ##
##            1.0: initial version                                    ##
########################################################################

#### USAGE #############################################################
########################################################################
##  Command line input:                                               ##
##     fixorient.pl in_data_dir new_data_dir nproc [minor]            ##
##                                                                    ##
##     where:                                                         ##
##        *in_data_dir - input data directory                         ##
##        *new_data_dir - output data directory                       ##
##        *nproc - number of processor threads for this task          ##
##        *minor - angles less than this value will be deemed minor   ##
##                 and adjustments will be allowed - for instance if  ##
##                 a horizontal pair is almost orthogonal (92 deg     ##
##                 from one another) a value of 2 or more will allow  ##
##                 adjustment so they are orthogonal. In degrees.     ##
##                 Default is 3.                                      ##
########################################################################

