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 867 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
36
  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. # With the new mode calculation we are unable to get 5 for the SW block, it comes out as 5.5
  8. # This test is only for blockmode
  9. log=etest.log
  10. cat << EOF > data.d
  11. # Block NW (1 value)
  12. 0.4 1.35 5
  13. # Block NE (2 values)
  14. 1.3 1.7 4
  15. 1.7 1.3 6
  16. # Block SW (5 values)
  17. 0.2 0.2 3
  18. 0.4 0.4 4
  19. 0.6 0.6 5
  20. 0.5 0.5 6
  21. 0.2 0.7 7
  22. # Block SE (6 values)
  23. 1.3 0.2 2
  24. 1.4 0.4 3
  25. 1.7 0.6 4
  26. 1.5 0.6 6
  27. 1.2 0.8 7
  28. 1.9 0.18 8
  29. EOF
  30. echo "All the mode values should be 5" > $log
  31. echo "Plain modes" >> $log
  32. gmt blockmode -R0/2/0/2 -I1 -r data.d >> $log
  33. echo "Extended modes" >> $log
  34. gmt blockmode -R0/2/0/2 -I1 -r -E data.d >> $log
  35. $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...