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

etest.sh 774 B

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
  1. #!/usr/bin/env bash
  2. #
  3. # Test to make sure the -E option works as advertised.
  4. # We have data that will fall in to 4 separate blocks
  5. # in a -R0/2/0/2 -I2 -r situation (2x2 blocks)
  6. # In all blocks mean = median = mode = 5.
  7. # This test is just for blockmean
  8. log=etest.log
  9. cat << EOF > data.d
  10. # Block NW (1 value)
  11. 0.4 1.35 5
  12. # Block NE (2 values)
  13. 1.3 1.7 4
  14. 1.7 1.3 6
  15. # Block SW (5 values)
  16. 0.2 0.2 3
  17. 0.4 0.4 4
  18. 0.6 0.6 5
  19. 0.5 0.5 6
  20. 0.2 0.7 7
  21. # Block SE (6 values)
  22. 1.3 0.2 2
  23. 1.4 0.4 3
  24. 1.7 0.6 4
  25. 1.5 0.6 6
  26. 1.2 0.8 7
  27. 1.9 0.18 8
  28. EOF
  29. echo "All the mean values should be 5" > $log
  30. echo "Plain means" >> $log
  31. gmt blockmean -R0/2/0/2 -I1 -r data.d >> $log
  32. echo "Extended means" >> $log
  33. gmt blockmean -R0/2/0/2 -I1 -r -E data.d >> $log
  34. $AWK '{if (NF == 6 && $3 != 5) print $0}' $log > fail
Tip!

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

Comments

Loading...