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 903 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
37
38
39
40
41
42
43
44
45
46
  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. # median, and compare to given answers.
  9. # This test is only for blockmedian
  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. 1.3 0.2 2 I
  25. 1.4 0.4 3 J
  26. 1.7 0.6 4 K
  27. 1.5 0.6 6 L
  28. 1.2 0.8 7 M
  29. 1.9 0.18 8 N
  30. EOF
  31. cat << EOF > truth.d
  32. 1
  33. 2
  34. 6
  35. 11
  36. 1
  37. 3
  38. 6
  39. 12
  40. EOF
  41. # Record numbers should match truth.d"
  42. gmt blockmedian -R0/2/0/2 -I1 -Er- -r data.d -o3 > $log
  43. gmt blockmedian -R0/2/0/2 -I1 -Er+ -r data.d -o3 >> $log
  44. 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...