SYNOPSIS

PERL PROGRAM NAME:

AUTHOR: Juan Lorenzo (Perl module only)

DATE:

DESCRIPTION:

Version:

USE

NOTES

Examples

SYNOPSIS

SEISMIC UNIX NOTES SUUTM - UTM projection of longitude and latitude in SU trace headers

suutm <stdin >stdout [optional parameters]                            



Optional parameters:                                                  

   counit=(from header) input coordinate units code:                  

                   =1: length (meters or feet; no UTM projection)     

                   =2: seconds of arc                                 

                   =3: decimal degrees                                

                   =4: degrees, minutes, seconds                      

   idx=23          reference ellipsoid index (default is WGS 1984)    

   a=(from idx)    user-specified semimajor axis of ellipsoid         

   f=(from idx)    user-specified flattening of ellipsoid             

   zkey=           if set, header key to store UTM zone number        

   verbose=0       =1: echo ellipsoid parameters                      



   lon0=           central meridian for TM projection in degrees      

                   (default uses the 60 standard UTM longitude zones) 

   xoff=500000     false Easting (default: UTM)                       

   ysoff=10000000  false Northing, southern hemisphere (default: UTM) 

   ynoff=0         false Northing, northern hemisphere (default: UTM) 



Notes:                                                                

   Universal Transverse Mercator (UTM) coordinates are defined between

   latitudes 80S (-80) and 84N (84). Longitude values must be between 

   -180 degrees (west) and 179.999... degrees (east).                 



   Latitudes are read from sy and gy (N positive), and longitudes     

   are read from sx and gx (E positive).                              

   The UTM zone is determined from the receiver coordinates gy and gx.



   Use suazimuth to calculate shot-receiver azimuths and offsets.     



Reference ellipsoids:                                                 

   An ellipsoid may be specified by its semimajor axis a and its      

   flattening f, or one of the following ellipsoids may be selected   

   by its index idx (semimajor axes in meters):                       

    0  Sphere with radius of 6371000 m                                

    1  Airy 1830                                                      

    2  Australian National 1965                                       

    3  Bessel 1841 (Ethiopia, Indonesia, Japan, Korea)                

    4  Bessel 1841 (Namibia)                                          

    5  Clarke 1866                                                    

    6  Clarke 1880                                                    

    7  Everest (Brunei, E. Malaysia)                                  

    8  Everest (India 1830)                                           

    9  Everest (India 1956)                                           

   10  Everest (Pakistan)                                             

   11  Everest (W. Malaysia, Singapore 1948)                          

   12  Everest (W. Malaysia 1969)                                     

   13  Geodetic Reference System 1980 (GRS 1980)                      

   14  Helmert 1906                                                   

   15  Hough 1960                                                     

   16  Indonesian 1974                                                

   17  International 1924 / Hayford 1909                              

   18  Krassovsky 1940                                                

   19  Modified Airy                                                  

   20  Modified Fischer 1960                                          

   21  South American 1969                                            

   22  World Geodetic System 1972 (WGS 1972)                          

   23  World Geodetic System 1984 (WGS 1984) / NAD 1983               





UTM grid:

The Universal Transverse Mercator (UTM) system is a world wide

coordinate system defined between 80S and 84N. It divides the

Earth into 60 six-degree zones. Zone number 1 has its central

meridian at 177W (-177 degrees), and numbers increase eastward.



Within each zone, an Easting of 500,000 m is assigned to its 

central meridian to avoid negative coordinates. On the northern

hemisphere, Northings start at 0 m at the equator and increase 

northward. On the southern hemisphere a false Northing of 

10,000,000 m is applied, i.e. Northings start at 10,000,000 m at 

the equator and decrease southward.



Coordinate encoding (sx,sy,gx,gy):

   counit=1  units of length (coordinates are not converted)

   counit=2  seconds of arc

   counit=3  decimal degrees 

   counit=4  degrees, minutes and seconds encoded as integer DDDMMSS 

             with scalco=1 or DDDMMSS.ss with scalco=-100 (see segy.h)

Units of length are also assumed, if counit <= 0 or counit >= 5.





Author: 

   Nils Maercklin, RISSC, University of Naples, Italy, March 2007



References:

NIMA (2000). Department of Defense World Geodetic System 1984 - 

   its definition and relationships with local geodetic systems.

   Technical Report TR8350.2. National Imagery and Mapping Agency, 

   Geodesy and Geophysics Department, St. Louis, MO. 3rd edition.

J. P. Snyder (1987). Map Projections - A Working Manual. 

   U.S. Geological Survey Professional Paper 1395, 383 pages.

   U.S. Government Printing Office.





Trace header fields accessed: sx, sy, gx, gy, scalco, counit

Trace header fields modified: sx, sy, gx, gy, scalco, counit

User's notes (Juan Lorenzo) untested

CHANGES and their DATES

Import packages

instantiation of packages

Encapsulated hash of private variables

sub Step

collects switches and assembles bash instructions by adding the program name

sub note

collects switches and assembles bash instructions by adding the program name

sub clear

sub a

sub counit

sub f

sub idx

sub lon0

sub scalco

sub verbose

sub xoff

sub ynoff

sub ysoff

sub zkey

sub get_max_index

max index = number of input variables -1