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

rectest.sh 1.1 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
  1. #!/usr/bin/env bash
  2. #
  3. # Test to make sure the -Ei 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. However, we
  7. # are returning the record numbers that go with those
  8. # modes, and compare to given answers.
  9. # This test is only for blockmode
  10. log=rectest.log
  11. cat << EOF > data.d
  12. # Block NW (1 value)
  13. 0.4 1.35 5 A
  14. # Block NE (2 values)
  15. 1.3 1.7 4 B
  16. 1.7 1.3 6 C
  17. # Block SW (5 values)
  18. 0.2 0.2 3 D
  19. 0.4 0.4 4 E
  20. 0.6 0.6 5 F
  21. 0.5 0.5 6 G
  22. 0.2 0.7 7 H
  23. # Block SE (6 values)
  24. # Note: Because there is no mode the search for steep gradients in the cdf
  25. # finds two modes, and when -Er is used we cannot average sources. So the
  26. # truth below reflects that -Er- gives J (10) and -Er+ gives M (13).
  27. 1.3 0.2 2 I
  28. 1.4 0.4 3 J
  29. 1.7 0.6 4 K
  30. 1.5 0.6 6 L
  31. 1.2 0.8 7 M
  32. 1.9 0.18 8 N
  33. EOF
  34. cat << EOF > truth.d
  35. 1
  36. 2
  37. 6
  38. 10
  39. 1
  40. 3
  41. 6
  42. 13
  43. EOF
  44. # Record numbers should match truth.d"
  45. gmt blockmode -R0/2/0/2 -I1 -Q -Er- -r data.d -o3 >> $log
  46. gmt blockmode -R0/2/0/2 -I1 -Q -Er+ -r data.d -o3 >> $log
  47. diff $log truth.d --strip-trailing-cr > fail
Tip!

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

Comments

Loading...