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

test_earthtide_interval.sh 1.8 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
  1. #!/usr/bin/env bash
  2. # try different
  3. # test -T with -S
  4. testts(){
  5. gmt earthtide -T2019-01-02T -S
  6. gmt earthtide -T2019-01-01T/2019-01-02T/1h -S | tail -n 1
  7. gmt earthtide -T2019-01-01T/2019-01-02T/5m -S | tail -n 1
  8. gmt earthtide -T2019-01-01T/2019-01-02T/3s -S | tail -n 1
  9. gmt earthtide -T2019-01-01T/2019-01-02T/2h -S | tail -n 1
  10. gmt earthtide -T2019-01-01T/2019-01-02T/24h -S | tail -n 1
  11. gmt earthtide -T2019-01-01T/2019-01-02T/1d -S | tail -n 1
  12. gmt earthtide -T2018-01-01T/2019-01-02T/6d -S | tail -n 1
  13. gmt earthtide -T2018-01-01T/2019-01-02T/4+n -S | tail -n 1
  14. }
  15. testts | tee ./test_earthtide_interval.dat
  16. # check if all lines are same
  17. [[ $(testts | uniq | wc -l ) == 1 ]] && echo ok || { echo "test failed" ; exit 1 ; }
  18. echo
  19. # test -T with -L
  20. testtl(){
  21. gmt earthtide -T2019-01-02T -L0/0
  22. gmt earthtide -T2019-01-01T/2019-01-02T/1h -L0/0 | tail -n 1
  23. gmt earthtide -T2019-01-01T/2019-01-02T/5m -L0/0 | tail -n 1
  24. gmt earthtide -T2019-01-01T/2019-01-02T/3s -L0/0 | tail -n 1
  25. gmt earthtide -T2019-01-01T/2019-01-02T/2h -L0/0 | tail -n 1
  26. gmt earthtide -T2019-01-01T/2019-01-02T/24h -L0/0 | tail -n 1
  27. gmt earthtide -T2019-01-01T/2019-01-02T/1d -L0/0 | tail -n 1
  28. gmt earthtide -T2019-01-01T/2019-01-02T/4+n -L0/0 | tail -n 1
  29. }
  30. # see output
  31. testtl | tee -a ./test_earthtide_interval.dat
  32. # check if all lines are same
  33. [[ $(testtl | uniq | wc -l ) == 1 ]] && echo ok || { echo "test failed" ; exit 1 ; }
  34. echo
  35. {
  36. gmt earthtide -T2018-01-01T/2019-01-02T/4y -S 2>&1
  37. gmt earthtide -T2018-01-01T/2019-01-02T/4y -S 2>&1
  38. gmt earthtide -L21/52 2>&1 1>/dev/null # do not show error when -L is without T, just use current time
  39. gmt earthtide -L0/2 -T2010-01-01T/2010-01-01T00:00:01/10+n
  40. gmt earthtide -L0/2 -T2010-01-01T/2010-01-01T00:00:01/2+n
  41. } | tee -a ./test_earthtide_interval.dat
Tip!

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

Comments

Loading...