Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

run_GPS_case_sub 1.8 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  1. #!/usr/bin/env bash
  2. # Testing gpsgridder for small vs large region, with our without weights
  3. #
  4. # Get data, region, dinc, ginc, decimate, weight option from first six arguments
  5. #
  6. D=$1
  7. R=-R$2
  8. I=$3
  9. ginc=$4
  10. dec=$5
  11. W=$6
  12. #
  13. # Reformat the data and set the minimum sigma at 0.6 mm/yr
  14. #
  15. gmt select $D $R -fg | awk '{su = ($5 < .6 ? .6 : $5);sv = ($6 < .6 ? .6 : $6);print($1,$2,$3,$4,su,sv) }' > data.lluv
  16. #
  17. # Use blockmean to avoid aliasing and combine u,v into one file
  18. gmt blockmean $R -I$I data.lluv -fg -i0,1,2,4 -W > blk.llu
  19. gmt blockmean $R -I$I data.lluv -fg -i0,1,3,5 -W > blk.llv
  20. gmt convert -A blk.llu blk.llv -o0-2,6,3,7 > tmp.lluv
  21. #
  22. # Change some of the e-components of the vectors and scale errors by factor of 5
  23. # We expect the result with weight to differ from the run without considering weights
  24. #
  25. awk '{if($1 > -116.6 && $1 < -116.5 && $2 > 33.5 && $2 < 33.7) print($1,$2,-$3,$4,5*$5,5*$6); else print($0);}' < tmp.lluv > blk.lluv
  26. #
  27. # Do the gridding.
  28. #
  29. # Only use ~1/4 of the eigenvalues
  30. gmt gpsgridder $R -I$ginc -GGPS_%s.nc blk.lluv -fg -Fd4 -r -Cn0.25+feigen.txt -S0.50 $W
  31. #
  32. gmt set FORMAT_GEO_MAP dddF
  33. gmt select blk.lluv $R -fg | awk '{ print($0," 0 ") }' > data.lluvenct
  34. #
  35. # first make a mask
  36. #
  37. gmt grdlandmask -Gmask.nc -RGPS_u.nc -Df
  38. gmt grdmath GPS_u.nc mask.nc MUL = GPS_u.nc
  39. gmt grdmath GPS_v.nc mask.nc MUL = GPS_v.nc
  40. #
  41. # make the map
  42. #
  43. gmt pscoast -R -JM7i -P -Glightgray -Ba1f30m -BWSne -K -Df -X0.7i -Wfaint
  44. gmt psxy @CA_fault_data.txt -J -R -W.5 -O -K
  45. gmt psvelo data.lluvenct -J -R -Se.008i/0.95/8 -A9p -W0.4p,red -O -K
  46. gmt psxy -R -J -O -K -W0.25p,green -L << EOF
  47. -116.6 33.5
  48. -116.5 33.5
  49. -116.5 33.7
  50. -116.6 33.7
  51. EOF
  52. # Shrink down heads of vectors shorter than 5 km
  53. gmt grdvector GPS_u.nc GPS_v.nc -Ix$dec/$dec -J -R -O -Q0.03i+e+n5 -Gblue -W0.4p,blue -S100i --MAP_VECTOR_SHAPE=0.2
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...