|
|
@ -24,6 +24,10 @@ import math
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# the harmonics included below in the python code were provided directly to WRL from BOM.
|
|
|
|
# the harmonics included below in the python code were provided directly to WRL from BOM.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
START_TIME = '2020-01-01'
|
|
|
|
|
|
|
|
END_TIME = '2020-12-31'
|
|
|
|
|
|
|
|
OUTPUT_NAME = 'levels.csv'
|
|
|
|
|
|
|
|
|
|
|
|
harm = {}
|
|
|
|
harm = {}
|
|
|
|
speed = 0
|
|
|
|
speed = 0
|
|
|
|
amp = 1
|
|
|
|
amp = 1
|
|
|
@ -225,24 +229,24 @@ MSL = 0.9952
|
|
|
|
|
|
|
|
|
|
|
|
# Now do the maths
|
|
|
|
# Now do the maths
|
|
|
|
|
|
|
|
|
|
|
|
start_time = datetime.datetime(2019, 11, 29, 0, 0, 0)
|
|
|
|
start_time = datetime.datetime.strptime(START_TIME, '%Y-%m-%d')
|
|
|
|
end_time = datetime.datetime(2019, 12, 5, 0, 0, 0)
|
|
|
|
end_time = datetime.datetime.strptime(END_TIME, '%Y-%m-%d')
|
|
|
|
|
|
|
|
|
|
|
|
time_step = datetime.timedelta(minutes=15)
|
|
|
|
time_step = datetime.timedelta(minutes=15)
|
|
|
|
|
|
|
|
|
|
|
|
x = []
|
|
|
|
x = []
|
|
|
|
y = []
|
|
|
|
y = []
|
|
|
|
F = open("tide.out", "w")
|
|
|
|
F = open(OUTPUT_NAME, "w")
|
|
|
|
t = start_time
|
|
|
|
t = start_time
|
|
|
|
while (t < end_time):
|
|
|
|
while (t < end_time):
|
|
|
|
offset = t - datetime.datetime(t.year, 1, 1, 0, 0, 0)
|
|
|
|
offset = t - datetime.datetime(t.year, 1, 1, 0, 0, 0)
|
|
|
|
yr = t.year - sy
|
|
|
|
year_idx = t.year - sy
|
|
|
|
t1 = (offset.days) * 24.0 + offset.seconds / 3600.0
|
|
|
|
t1 = (offset.days) * 24.0 + offset.seconds / 3600.0
|
|
|
|
z = MSL
|
|
|
|
z = MSL
|
|
|
|
for constit in harm.keys():
|
|
|
|
for constit in harm.keys():
|
|
|
|
if constit in node_factor:
|
|
|
|
if constit in node_factor:
|
|
|
|
nf = node_factor[constit][yr]
|
|
|
|
nf = node_factor[constit][year_idx]
|
|
|
|
ea = equalibrium_arg[constit][yr]
|
|
|
|
ea = equalibrium_arg[constit][year_idx]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
nf = 1.0
|
|
|
|
nf = 1.0
|
|
|
|
ea = 0.0
|
|
|
|
ea = 0.0
|
|
|
|