-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_example.py
More file actions
56 lines (48 loc) · 1.8 KB
/
Copy pathplot_example.py
File metadata and controls
56 lines (48 loc) · 1.8 KB
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
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
"""
Example script demonstrating the tidal analysis plotting functionality.
This script shows how to generate tidal analysis plots for different stations,
datums, and epochs using the compute_spring_datums module.
"""
from compute_spring_datums import generate_tidal_plot
def main():
print("=== Tidal Analysis Plot Generation Examples ===\n")
# Example 1: La Jolla with NAVD88 datum
print("1. La Jolla (9410230) - NAVD88 Datum")
filename, summary = generate_tidal_plot(
station_id='9410230',
epoch='1983-2001',
datum='NAVD88'
)
print(f" MHWS: {summary['mhws']:.3f} m")
print(f" MLWS: {summary['mlws']:.3f} m")
print(f" Plot: {filename}\n")
# Example 2: San Francisco with MLLW datum
print("2. San Francisco (9414290) - MLLW Datum")
filename, summary = generate_tidal_plot(
station_id='9414290',
epoch='1983-2001',
datum='MLLW'
)
print(f" MHWS: {summary['mhws']:.3f} m")
print(f" MLWS: {summary['mlws']:.3f} m")
print(f" Plot: {filename}\n")
# Example 3: San Diego with different epoch
print("3. San Diego (9410170) - 2002-2020 Epoch")
filename, summary = generate_tidal_plot(
station_id='9410170',
epoch='2002-2020',
datum='NAVD88'
)
print(f" MHWS: {summary['mhws']:.3f} m")
print(f" MLWS: {summary['mlws']:.3f} m")
print(f" Plot: {filename}\n")
print("✅ All plots generated successfully!")
print("✅ Each plot shows:")
print(" - Predicted tide curve (blue)")
print(" - Spring daily highs (red dots)")
print(" - Spring daily lows (green dots)")
print(" - MHWS and MLWS reference lines")
print(" - Spring tide windows (gray vertical lines)")
if __name__ == "__main__":
main()