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

poldecimate.jl 1.4 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
  1. function poldecimate(out_path::ASCIIString="")
  2. # OUT_PATH -> Path to where the PS file will be written. If not in input must be set via the "outPath" global var
  3. # PS -> Full name of the created postscript file (built from OUT_PATH)
  4. # PATH -> Path to where this file lives (useful for gmtest.m)
  5. #
  6. # Testing gmt gmtspatial decimation near poles
  7. #
  8. # Input was made this way.
  9. #gmt gmtmath -T0/2000/1 -o1 0 360 RAND = x
  10. #gmt gmtmath -T0/2000/1 -o1 60 90 RAND = y
  11. #gmt gmtmath -T0/2000/1 -o1 0 100 RAND = z
  12. #paste x y z > polar.txt
  13. pato, fname = fileparts(@__FILE__)
  14. ps = out_path * fname * ".ps"
  15. path = pato * "/"
  16. gmt("destroy"), gmt("gmtset -Du"), gmt("destroy") # Make sure we start with a clean session
  17. # NN averaging
  18. results = gmt("gmtspatial -Aa100k -fg " * path * "polar.txt")
  19. gmt("psxy -R0/360/60/90 -JA0/90/4.5i -P -K -Bafg -BWsne " * path * "polar.txt -Sc0.05i -Ggreen -X1.5i -Y0.75i > " * ps)
  20. gmt("pstext -R -J -O -K -N -F+f12+jLM -Dj0.25i >> " * ps, "90 60 N = 2000")
  21. gmt("psxy -R -J -O -K " * path * "polar.txt -Sc0.05i -Bafg -BWsne -Gdarkseagreen1 -Y5i >> " * ps)
  22. gmt("psxy -R -J -O -K -Sc0.05i -Gred >> " * ps, results)
  23. gmt("pstext -R -J -O -K -N -F+f12+jLM -Dj0.25i >> " * ps, @sprintf("90 60 N = %d", size(results,1)))
  24. gmt("psxy -R -J -O -T >> " * ps)
  25. rm("gmt.conf")
  26. return ps, path
  27. end
  28. poldecimate() = poldecimate("")
Tip!

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

Comments

Loading...