Geophysics Data Analysis Techniques in C.E.R.I

c e r i 8 1 04 d ata a nalysis in g eophysics l.w
1 / 32
Embed
Share

Explore the world of geophysics data analysis with Dr. Robert (Bob) Smalley at C.E.R.I. Learn about UNIX documentation, man pages, and the importance of manuals in software usage. Discover the structure of a man page and how to navigate through command documentation effectively.

  • Geophysics
  • Data Analysis
  • C.E.R.I
  • UNIX Documentation
  • Man Pages

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. C E R I- -8 1 04 D ata A nalysis in G eophysics D r. R obert (B ob) S malley 3 8 9 2 C entral A ve, R oom 1 03 rsmalley@ memphis.edu F all 2 02 3 T u & T h 1 1 :2 0 am 8 1 04 D ata A nalysis in G eophysics D r. R obert (B ob) S malley 3 8 9 2 C entral A ve, R oom 1 03 rsmalley@ memphis.edu F all 2 02 3 T u & T h 1 1 :2 0 am - -1 2 :45 pm C E R I 6 7 8 6 7 8 - -49 2 9 49 2 9 1 2 :45 pm M eeting 1 5 M eeting 1 5 T ue. T ue. O ct 1 9 , 2 02 3 O ct 1 9 , 2 02 3 C E R I N ew/ L ong B uilding: S tudent C omputer L ab C lass webpage to be announced. M y homepage (has older versions of the course) http:/ / www.ceri.memphis.edu/ people/ smalley/ C E R I N ew/ L ong B uilding: S tudent C omputer L ab C lass webpage to be announced. M y homepage (has older versions of the course) http:/ / www.ceri.memphis.edu/ people/ smalley/

  2. U N IX documentation intially had no documentation U N IX documentation had no documentation (as it was intuitive?!) U N IX U N IX intially (as it was intuitive?!) T he manager at A T &T B ell L abs made the developers write a manual. T his devolved into a standard format for providing interactive documentation on (most) U N IX commands. Introducing the T he manager at A T &T B ell L abs made the developers write a manual. T his devolved into a standard format for providing interactive documentation on (most) U N IX commands. Introducing the man (manual) page (manual) page

  3. If you've had someone tell you to R T F M , depending on what software you are using, that manual might be a challenge to find. If you've had someone tell you to R T F M , depending on what software you are using, that manual might be a challenge to find. O n L inux, however, you'll find hundreds upon hundreds of manuals ready to view. from) https:/ / www.zdnet.com/ article/ what they O n L inux, however, you'll find hundreds upon hundreds of manuals ready to view. (as usual U N IX is very proud of itself for this useful feature that helps the user, above propaganda from) https:/ / www.zdnet.com/ article/ what- -are they- -important (as usual U N IX is very proud of itself for this useful feature that helps the user, above propaganda are- -man linux- -education/ man- -pages education/ pages- -and and- -why why- -are are- - important- -to to- -your your- -linux https://man7.org/linux/man-pages/man1/man.1.html

  4. T he structure of a man page T he structure of a man page M an pages are all laid out with specific sections, which usually include other stuff, but usually no examples as the man pages are clearly written and easy to understand) N A M E S Y N O P S IS D E S C R IP T IO N O P T IO N S A U T H O R R E P O R T IN G B U G S C O P Y R IG H T S E E A L S O C O N F IG U R A T IO N E X IT S T A T U S M an pages are all laid out with specific sections, which usually include (plus other stuff, but usually no examples as the man pages are clearly written and easy to understand):: N A M E - - name of command in question. S Y N O P S IS - - structure of command. D E S C R IP T IO N - - description of command. O P T IO N S - - available options for command. A U T H O R - - the author. R E P O R T IN G B U G S how to reporting bugs to the developer(s). C O P Y R IG H T - - information about command license. S E E A L S O - - points to full documentation or related commands. C O N F IG U R A T IO N - - configuration details for a command or device. E X IT S T A T U S - - possible exit status values. (plus name of command in question. structure of command. description of command. available options for command. the author. how to reporting bugs to the developer(s). information about command license. points to full documentation or related commands. configuration details for a command or device. possible exit status values.

  5. L ets do our first programming example L et s do our first programming example W e are going to use S cenario B ased T raining for the labs W e are going to use S cenario B ased T raining for the labs

  6. W hat is S cenario W hat is S cenario- -B ased T raining? B ased T raining? S B T is It It uses a learning S B T is a a training uses a highly structured learning objectives training system highly structured script objectives in in an system.. script of operational environment.. of real real world world experiences experiences to to meet meet an operational environment S ystem S ystem concept is concept is integrated integrated throughout throughout training. training. E xperiences E xperiences new and new and different different experiences experiences are are important. important. O perational O perational environment environment the the real real thing. thing.

  7. W hat is S cenario W hat is S cenario- -B ased T raining? B ased T raining? T hink of T hink of learning learning to play to play the the piano: piano: L earning L earning to to play play notes notes on on a a scale scale is is the the foundation foundation but playing a but playing a song requires song requires constant rearrangement. constant rearrangement.

  8. W hat is S cenario W hat is S cenario- -B ased T raining? B ased T raining? L earning to program L earning to program is is very very similar: similar: L earning about program control (decision making, loops, etc.) is the foundation for writing programs. L earning about program control (decision making, loops, etc.) is the foundation for writing programs. B ut writing correct, efficient programs requires combining those foundations to accomplish the specified task. B ut writing correct, efficient programs requires combining those foundations to accomplish the specified task.

  9. W hat is S cenario teaches programming life W hat is S cenario- -B ased T raining? programming in in the life" " programming B ased T raining? the context i.e. by programming.. F or S B T S B T teaches context of of what you will do in what you will do in real real programming i.e. by programming F or example: example: F or scientific data processing have the student plan and design programs to accomplish some specified tasks F or scientific data processing have the student plan and design programs to accomplish some specified tasks.. R ather than just practicing each of the programming components separately. R ather than just practicing each of the programming components separately.

  10. W e are going to cheat a bit here. W e are going to cheat a bit here. W e will use the M ac G U I to create directories for now. W e will use the M ac G U I to create directories for now. W e will use the M ac text editor to edit files (save it as a U nicode U T F W e will use the M ac text editor to edit files (save it as a U nicode U T F - -8 file, the default) for now. 8 file, the default) for now. I like to use the language the script is written in as the extension (the last part of the name after the final period/ dot) sh or I like to use the language the script is written in as the extension (the last part of the name after the final period/ dot) here that would be or bash , so I use here that would be , so I use sh . . O pen the text editor, enter O pen the text editor, enter echo here I am , and save it as hereIam.sh , and save it as

  11. W e now have to stop cheating and use the U N IX command line. F irst S econd go to the directory where you made the file ( N ext enter properties. W e need to make the file we just created executable , i.e. give it permission to be run as a program. E nter W e now have to stop cheating and use the U N IX command line. F irst - - O pen a terminal window. S econd go to the directory where you made the file (cdcommands) N ext enter ls l to see a list of the files in the directory and their properties. W e need to make the file we just created executable , i.e. give it permission to be run as a program. E nter chmod +x hereIam.sh<CR> O pen a terminal window. commands) to see a list of the files in the directory and their

  12. F inally run the program. F inally run the program. E nter ./hereIam.sh<CR> on the command line. It should print here I am in the terminal window. N O T E --- In general, the M ac is not. T he M ac is case sensitive in the command line. Y ou have to be careful (all the time) to not name 2 files in the same directory something like (you can set up your M ac so it is case sensitive you format the disk). E nter It should print N O T E on the command line. in the terminal window. --- U N IX / L IN U X is C A S E S E N S IT IV E . In general, the M ac is not. T he M ac is case sensitive in the command line. Y ou have to be careful (all the time) to not name 2 files in the same directory something like a.sh and (you can set up your M ac so it is case sensitive it is an option when you format the disk). U N IX / L IN U X is C A S E S E N S IT IV E . and A.sh as it will confuse O S X it is an option when as it will confuse O S X

  13. B eing seismologists T here was a M 8 .1 earthquake recently in the S outh S andwich subduction zone. W e are going to use a program written to produce maps and graphics in E arth S cience named G eneric M apping T ools or G M T It will have features for plotting magnetic anomalies on ship tracks, focal mechanisms, faults, topography, contour lines, etc. B eing seismologists - - let s make a map of earthquakes T here was a M 8 .1 earthquake recently in the S outh S andwich subduction zone. W e are going to use a program written to produce maps and graphics in E arth S cience named G eneric M apping T ools or G M T It will have features for plotting magnetic anomalies on ship tracks, focal mechanisms, faults, topography, contour lines, etc. let s make a map of earthquakes

  14. S o, what do we want to do S o, what do we want to do P lot some symbols on a map showing where the earthquakes happened P lot some symbols on a map showing where the earthquakes happened

  15. If you enter the command "gmt module_name", ", gmt standard text only format U N IX man (for man specified module. % gmt psxy gmt psxy [core] 6.2.0 [64-bit] - Plot lines, polygons, and symbols in 2-D If you enter the command " standard text only format U N IX man (for gmt will spit out the manual) page for the will spit out the ual) page for the specified module. P rogram is M odule is P rogram is gmt M odule is psxy S ee for a prettier page with the same text (plus a few examples!!! and some nice color figures) https://docs.generic-mapping-tools.org/latest/psxy.html S ee for a prettier page with the same text (plus a few examples!!! and some nice color figures)

  16. %gmt6 psxy gmt psxy [core] 6.2.0 [64-bit] - Plot lines, polygons, and symbols in 2-D usage: gmt psxy [<table>] -J<args> -R<west>/<east>/<south>/<north>[/<zmin>/<zmax>][+r] [-A[m|p|x|y]] [-B<args>] [-C<cpt>] [-D<dx>/<dy>] [-E[x|y|X|Y][+a][+c[l|f]][+n][+p<pen>][+w<width>]] [-F<arg>] [-G<fill>|+z] [-H[<scale>]] [-I[<intens>]] [-K] [-L[+b|d|D][+xl|r|x0][+yb|t|y0][+p<pen>]] [-N[c|r]] [-O] [-P] [-S[<symbol>][<size>]] [-T] [-U[<label>][+c][+j<just>][+o<dx>/<dy>]] [-V[<level>]] [-W[<pen>][<attr>]] [-X[a|c|f|r]<xshift>] [-Y[a|c|f|r]<yshift>] [-Z<value>|<file>[+f|l]] [-a<col>=<name>[,...]] [-bi[<ncol>][t][w][+l|b]] [-di<nodata>] [-e[~]<pattern>] [-f[i|o]<info>] [-g[a]x|y|d|X|Y|D|[<col>]z<gap>[+n|p]] [-h[i|o][<nrecs>][+c][+d][+m<segheader>][+r<remark>][+t<title>]] [-i<cols>[+l][+d<divide>][+s<scale>][+o<offset>][,...][,t[<word>]]] [-l<label>[<mods>]] [-p[x|y|z]<azim>[/<elev>[/<zlevel>]][+w<lon0>/<lat0>[/<z0>][+v<x0>/<y0>]] [-q[i|o][~]<rows>[,...][+c<col>][+a|f|s]] [-t[<transp>[/<transp2>[+f][+s]]] [-wa|y|w|d|p<period][/<phase>][+c<col>]] [-:[i|o]] [--PAR=<value>] Usage shows all the switches (switch heaven or hell). Items in brackets [ ] are optional, if no brackets are required. W e will not look at each switch. shows all the switches (switch heaven or hell). Items in brackets [ ] are optional, if no brackets are required. W e will not look at each switch.

  17. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps -Rspecifys coordinate range: 35 Wto21 W&62 Sto54.5 S. -R Specify the min/max coordinates of your data region in user units. Use dd:mm[:ss] for regions given in arc degrees, minutes [and seconds]. Use -R<xmin/xmax/ymin/ymax>+u<unit> for regions given in projected coordinates. with <unit> selected from e|f|k|M|n|u. Use [yyy[-mm[-dd]]]T[hh[:mm[:ss[.xxx]]]] format for time axes. Append +r if -R specifies the coordinates of the lower left and upper right corners of a rectangular area. Use -R<gridfile> to use its limits (and increments if applicable). Use -Rg and -Rd as shorthands for -R0/360/-90/90 and -R-180/180/-90/90. Derive region from closed polygons from the Digital Chart of the World (DCW): Append a comma-separated list of ISO 3166 codes for countries to set region, i.e., <code1>,<code2>,... etc., using the 2-character ISO country codes (see pscoast -E+l for list). To select a state of a country (if available), append .state, e.g, US.TX for Texas. To select a whole continent, give =AF|AN|AS|EU|OC|NA|SA as <code>. Use +r to modify the region from polygon(s): Append <inc>, <xinc>/<yinc>, or <winc>/<einc>/<sinc>/<ninc> to round region to these multiples; use +R to extend region by those increments instead, or use +e which is like +r but makes sure the region extends at least by 0.25 x <inc>. Or use -R<code><x0>/<y0>/<n_columns>/<n_rows> for origin and grid dimensions, where <code> is a 2-char combo from [T|M|B][L|C|R] (top/middle/bottom/left/center/right) and grid spacing must be specified via -I<dx>[/<dy>] (also see -r).

  18. A s you can see, the switches can also be quite complicated and have a large amount of documentation. A s you can see, the switches can also be quite complicated and have a large amount of documentation. A s you can also see, the documentation also usually pretty terse and has undocumented syntax. A s you can also see, the documentation also usually pretty terse and has undocumented syntax. R emember the U N IX philosophy one thing well with no bells and whistles. R emember the U N IX philosophy small, lean, mean programs that do one thing well with no bells and whistles. small, lean, mean programs that do

  19. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps S et the projection (-J), scale and other metadata such as projection center, standard meridians, etc. S et projection to M ercator, Mgoes with width), and the units= cm. ), scale and other metadata such as projection center, standard meridians, etc. S et projection to M ercator, -JM, setting the width ( goes with width), and the units= cm. S et the projection ( setting the width (mgoes with goes with scale scale, -J Select map proJection. (<scale> in inch/degree, <width> in inch) Append +dh for map height, +du for max (upper) or +dl for min (lower) map dimension [+dw for width]. Azimuthal projections set -Rg unless polar aspect or -R<...>+r is set. -Ja|A<lon0>/<lat0>[/<hor>]/<scl> (or <radius>/<lat>)|<width> (Lambert Azimuthal EA) -Jl|L<lon0>/<lat0>/<lat1>/<lat2>/<scl>|<width> (Lambert Conformal Conic) -Jm|M[<lon0>/[<lat0>/]]<scl>|<width> (Mercator) -Jn|N[<lon0>/]<scl>|<width> (Robinson projection) -JZ|z For z component of 3-D projections. Same syntax as -JX|x, i.e., -Jz|Z<z-scl>|<height>[d|l|p<power>|t|T] (Linear, log, and power projections)

  20. S et projection to M ercator, S et projection to M ercator, -JM, setting the width ( with setting the width (mgoes with width), and the units= cm. goes with scale scale, Mgoes goes with width ), and the units= cm. P reviously one could only set the scale maps have scales, 1 :1 00,000 for example. P reviously one could only set the scale as from a cartographer's point of view maps have scales, 1 :1 00,000 for example. as from a cartographer's point of view T he problem with this rigid interpretation for making maps is that those of us that are not serious cartographer's and want a map that fits on the page or a journal column. W e just care about the overall dimensions and let the scale come out as necessary. T he problem with this rigid interpretation for making maps is that those of us that are not serious cartographer's and want a map that fits on the page or a journal column. W e just care about the overall dimensions and let the scale come out as necessary. T he authors of G M T finally decided to allow defining the map size (width) in some unit (cm in this case), and let the map be at an arbitrary scale. T he authors of G M T finally decided to allow defining the map size (width) in some unit (cm in this case), and let the map be at an arbitrary scale.

  21. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps P lot a symbol, P lot a symbol, S, a circle, , a circle, c , with a size of , with a size of 0.25 cm. m. -S Select symbol type and symbol size (in inch). Choose between -(xdash), +(plus), st(a)r, (b|B)ar, (c)ircle, (d)iamond, (e)llipse, (f)ront, octa(g)on, (h)exagon, (i)nvtriangle, (j)rotated rectangle, (k)ustom, (l)etter, (m)athangle, pe(n)tagon, (p)oint, (q)uoted line, (r)ectangle, for many, many pages for many, many pages

  22. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps S et symbol pen attributes with comma) and line color black (this is for the symbol S et symbol pen attributes with W: width comma) and line color black (this is for the symbol outline : width 1, (note , (note separator is a outline) ) separator is a -W Set pen attributes [Default pen is default,black]: <pen> is a comma-separated list of three optional items in the order: <width>[c|i|p], <color>, and <style>[c|i|p]. <width> >= 0.0 sets pen width (default units are points); alternatively a pen name: Choose among faint, default, or [thin|thick|fat][er|est], or wide. <color> = (1) <gray> or <red>/<green>/<blue>, all in range 0-255; (2) #rrggbb, all in the range 0-255 using hexadecimal numbers; (3) <c>/<m>/<y>/<k> in 0-100% range; (4) <hue>-<sat>-<val> in ranges 0-360, 0-1, 0-1; (5) any valid color name. <style> = (1) pattern of dashes (-) and dots (.), scaled by <width>; (2) "dashed", "dotted", "dashdot", "dotdash", or "solid"; (3) <pattern>[:<offset>]; <pattern> holds lengths (default unit points) of any number of lines and gaps separated by underscores. The optional <offset> shifts elements from start of the line [0].

  23. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps S et the fill color for the symbols, 255for grey, or ( red/ green/ / blue (now separator is slashes) S et the fill color for the symbols, -G, then for grey, or (0-255/ 0-255/ 0-255) for each of red/ green/ / blue (now separator is slashes) , then can use color names, or ) for each of can use color names, or 0- -G<fill> Specify color or pattern [no fill]. Specify <fill> as one of: 1) <gray> or <red>/<green>/<blue>, all in the range 0-255; 2) #rrggbb, all in the range 0-255 using hexadecimal numbers; 3) <c>/<m>/<y>/<k> in range 0-100%; 4) <hue>-<sat>-<val> in ranges 0-360, 0-1, 0-1; 5) any valid color name; 6) P|p<pattern>[+b<color>][+f<color>][+r<dpi>]; Give <pattern> number from 1-90 or a filename, optionally add +r<dpi> [0]. Optionally, use +f<color> or +b<color> to change fore- or background colors (no <color> sets For PDF fill transparency, append @<transparency> in the range 0-100 [0 = opaque]. -G option can be present in all segment headers (not with -S). transparency).

  24. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps ssand_eqs.dat is is the input file name directory from which you run the shell script (or you need to give path information also). T his can go anywhere in the command. the input file name, this file must exist in the , this file must exist in the directory from which you run the shell script (or you need to give path information also). T his can go anywhere in the command. % cat ssand_eqs.dat -24.7934 -58.8957 21.73 4.8 -26.5665 -59.7692 80.92 5.2 E ach line has L ong, L at, D epth, M agnitude separated by a space E ach line has L ong, L at, D epth, M agnitude separated by a space

  25. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps M odule and plots appropriately (i.e. the P rojection of data in [assumed] long M odule psxy takes and plots appropriately (i.e. the -JM says to make a M ercator P rojection of data in [assumed] long lat takes x(long) and (long) and y( (lat lat) from first 2 columns says to make a M ercator lat format). ) from first 2 columns format). W e will use the other two columns shortly. W e will use the other two columns shortly.

  26. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps T he documented can be combined, and which need a separate T he Bswitch is very complicated, confusing and most poorly documented (the documentation says to look for examples!) can be combined, and which need a separate Bswitch. switch is very complicated, confusing and most poorly (the documentation says to look for examples!), especially in which flags , especially in which flags switch. T he first the plot with the T he first B says annotate on the the plot with the lat says annotate on the West and lat lons and est and Southern sides of , and just draw the border on the East and North sides. outhern sides of lons, and just draw the border on the orth sides. ast

  27. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps T he documented can be combined, and which need a separate T he second standard wide border (this is the giveaway that the figure was made with G M T ) letting G M T decide on the size of the divisions (nothing after the T he Bswitch is very complicated, confusing and most poorly documented (the documentation says to look for examples!) can be combined, and which need a separate Bswitch. T he second B says how to annotate ( standard wide border (this is the giveaway that the figure was made with G M T ) letting G M T decide on the size of the divisions (nothing after the aor orf). ). switch is very complicated, confusing and most poorly (the documentation says to look for examples!), especially in which flags , especially in which flags switch. ) the says how to annotate (a) and fill ( ) and fill (f) the

  28. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred P > ex1.sh.ps C hanges from landscape to P ortrait mode. C hanges from landscape to P ortrait mode. T ry the line without the garbage (that is actually readable if you know how to read it) to the screen. T ry the line without the > ex1.sh.ps, it will spit a lot of ascii garbage (that is actually readable if you know how to read it) to the screen. , it will spit a lot of ascii

  29. gmt6 psxy -R-35/-21/-62/-54.5 -JM15c -BWSen -Baf ssand_ eqs.dat -Sc0.25c -W1,black -Gred > ex1.sh.ps R edirects output to a file named R edirects output to a file named ex1.sh.ps T ry the line without the garbage (that is actually readable if you know how to read it) to the screen. T ry the line without the > ex1.sh.ps, it will spit a lot of ascii garbage (that is actually readable if you know how to read it) to the screen. , it will spit a lot of ascii

  30. S elect data set units if needed from S elect data set units if needed from e|| f|| k|| M|| n|| u.. http://gmt.soest.hawaii.edu/doc/latest/gmtselect.html Units For map distance unit, append unit d for arc degree, m for arc minute, and s for arc second, or e for meter [Default], f for foot, k for km, M for statute mile, n for nautical mile, and u for US survey foot. By default we compute such distances using a spherical approximation with great circles. Prepend - to a distance (or the unit is no distance is given) to perform Flat Earth calculations (quicker but less accurate) or prepend + to perform exact geodesic calculations (slower but more accurate).

  31. If we look in our directory, we now have 4 files If we look in our directory, we now have 4 files % ls ex1.sh ex1.sh.ps gmt.history ssand_eqs.dat % W e started with 2 files W e started with 2 files ex1.sh our program , a shell script our program , a shell script ssand_eqs.dat the data for our plot the data for our plot

Related


More Related Content